predict.liureg {fastliu} | R Documentation |
Predict method for liureg objects
Description
Predict method for liureg objects
Usage
## S3 method for class 'liureg'
predict(object, newdata, ...)
Arguments
object |
A |
newdata |
A data frame of new values for |
... |
Not used in this implementation. |
Value
Depending on whether the lambda
is a scalar or a vector,
the predict.liureg
function returns a vector or matrix of predictions, respectively.
Author(s)
Murat Genç
See Also
liureg()
, predict()
, summary()
, pressliu()
, residuals()
Examples
data("Hitters")
Hitters <- na.omit(Hitters)
X <- model.matrix(Salary ~ ., Hitters)[, -1]
y <- Hitters$Salary
lam <- seq(0, 1, 0.01)
liu.mod <- liureg(X, y, lam)
# Predictions based on original X matrix.
predict(liu.mod)
# Predictions based on newdata. newdata can be a matrix or a data.frame.
predict(liu.mod, newdata=X[1:5, ])
[Package fastliu version 1.0 Index]