Learn R Programming

liureg (version 1.1.2)

predict.liu: Predict Method for Liu Regression Model Fits

Description

Predicted values based on the Liu regression model for scalar or vector values of biasing parameter \(d\).

Usage

# S3 method for liu
predict(object, newdata, na.action = na.pass, terms = NULL, …)

Arguments

object

An object of class "liu".

newdata

An optional data frame in which to look for variables with which to predict.

na.action

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

terms

The terms object used.

Not presently used in this implementation.

Value

predict.liu produces a vector of prediction or a matrix of predictions for scalar or vector values of biasing parameter \(d\).

Details

The predict.liu function predicted values, obtained by evaluating the regression function in the frame newdata which defaults to model.frame (object). If newdata is omitted the predictions are based on the data used for the fit. In that case how cases with missing values in the original fit are handled is determined by the na.action argument of that fit. If na.action=na.omit omitted cases will not appear in the predictions, whereas if na.action=na.exclude they will appear (in predictions), with value NA.

See Also

Liu model fitting liu, Liu residuals residuals.liu, Liu PRESS press.liu, Testing of Liu Coefficients summary.liu

Examples

Run this code
# NOT RUN {
mod <- liu(y~., data = as.data.frame(Hald), d = seq(-5, 5, 0.1))
predict(mod)

predict(mod, newdata=as.data.frame(Hald[1:5, -1]))
# }

Run the code above in your browser using DataLab