predict.lmridge {lmridge} | R Documentation |
Predict method for Linear Ridge Model Fits
Description
Predicted values based on linear ridge regression model for scalar or vector values of biasing parameter K
.
Usage
## S3 method for class 'lmridge'
predict(object, newdata, na.action=na.pass, ...)
Arguments
object |
An object of class "lmridge". |
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 |
... |
Not presently used in this implementation. |
Details
The predict.lmridge
function produces 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.
Value
predict.lmridge
produces a vector of predictions or a matrix of predictions for scalar or vector values of biasing parameter.
Note
Variables are first looked for in newdata
and then are searched for in the usual way (which will include the environment of the formula used in the fit). A warning will be given if the variables found are not of the same length as those in the newdata
if it was supplied.
Author(s)
Muhammad Imdad Ullah, Muhammad Aslam
References
Cule, E. and De lorio, M. (2012). A semi-Automatic method to guide the choice of ridge parameter in ridge regression. arXiv:1205.0686v1 [stat.AP].
Hoerl, A. E., Kennard, R. W., and Baldwin, K. F. (1975). Ridge Regression: Some Simulation. Communication in Statistics, 4, 105-123. doi:10.1080/03610927508827232.
Hoerl, A. E. and Kennard, R. W., (1970). Ridge Regression: Biased Estimation of Nonorthogonal Problems. Technometrics, 12, 55-67. doi:10.1080/00401706.1970.10488634.
Imdad, M. U. Addressing Linear Regression Models with Correlated Regressors: Some Package Development in R (Doctoral Thesis, Department of Statistics, Bahauddin Zakariya University, Multan, Pakistan), 2017.
See Also
The ridge model fitting lmridge
, ridge residuals residuals
, ridge PRESS press.lmridge
Examples
mod <- lmridge(y~., as.data.frame(Hald), K = seq(0, 0.2, 0.05))
predict(mod)
predict(mod, newdata = as.data.frame(Hald[1:5, -1]))