Use predict() on an lmRob Object
Extracts the fitted values from an lmRob
object and returns a matrix of predictions.
## S3 method for class 'lmRob' predict(object, newdata, type = "response", se.fit = FALSE, terms = labels(object), ...)
object |
an lmRob object. |
newdata |
a data frame containing the values at which predictions are required. This argument can be missing, in which case predictions are made at the same values used to compute the object. Only those predictors referred to in the right side of the formula in object need be present by name in |
type |
a single character value specifying the type of prediction. The only choice is "response". If "response" is selected, the predictions are on the scale of the response. |
se.fit |
a logical value. If |
terms |
this argument is presently unused. |
... |
additional arguments required by the generic |
a vector of predictions, or a list consisting of the predictions and their standard errors if se.fit = TRUE
.
predict
can produce incorrect predictions when the newdata
argument is used if the formula in object
involves data-dependent transformations, such as poly(Age, 3)
or sqrt(Age - min(Age))
.
data(stack.dat) stack.rob <- lmRob(Loss ~ ., data = stack.dat) predict(stack.rob) predict(stack.rob, newdata = stack.dat[c(1,2,4,21), ], se.fit = TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.