predict.lqs.Rd
Predict from an resistant regression fitted by lqs
.
# S3 method for lqs predict(object, newdata, na.action = na.pass, ...)
object | object inheriting from class |
---|---|
newdata | matrix or data frame of cases to be predicted or, if |
na.action | function determining what should be done with missing
values in |
... | arguments to be passed from or to other methods. |
A vector of predictions.
This function is a method for the generic function
predict()
for class lqs
.
It can be invoked by calling predict(x)
for an
object x
of the appropriate class, or directly by
calling predict.lqs(x)
regardless of the
class of the object.
Missing values in newdata
are handled by returning NA
if the
linear fit cannot be evaluated. If newdata
is omitted and
the na.action
of the fit omitted cases, these will be omitted on the
prediction.
set.seed(123) fm <- lqs(stack.loss ~ ., data = stackloss, method = "S", nsamp = "exact") predict(fm, stackloss)#> 1 2 3 4 5 6 7 8 #> 35.500000 35.579646 30.409292 19.477876 18.592920 19.035398 19.000000 19.000000 #> 9 10 11 12 13 14 15 16 #> 15.734513 14.079646 13.362832 13.000000 13.920354 13.486726 6.761062 7.000000 #> 17 18 19 20 21 #> 8.557522 8.000000 8.362832 13.154867 23.991150