Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.lqs

Predict from an lqs Fit


Description

Predict from an resistant regression fitted by lqs.

Usage

## S3 method for class 'lqs'
predict(object, newdata, na.action = na.pass, ...)

Arguments

object

object inheriting from class "lqs"

newdata

matrix or data frame of cases to be predicted or, if object has a formula, a data frame with columns of the same names as the variables used. A vector will be interpreted as a row vector. If newdata is missing, an attempt will be made to retrieve the data used to fit the lqs object.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

...

arguments to be passed from or to other methods.

Details

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.

Value

A vector of predictions.

Author(s)

B.D. Ripley

See Also

Examples

set.seed(123)
fm <- lqs(stack.loss ~ ., data = stackloss, method = "S", nsamp = "exact")
predict(fm, stackloss)

MASS

Support Functions and Datasets for Venables and Ripley's MASS

v7.3-54
GPL-2 | GPL-3
Authors
Brian Ripley [aut, cre, cph], Bill Venables [ctb], Douglas M. Bates [ctb], Kurt Hornik [trl] (partial port ca 1998), Albrecht Gebhardt [trl] (partial port ca 1998), David Firth [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.