View source: R/predict-liureg.R
| predict.liureg | R Documentation |
Predict method for liureg objects
## S3 method for class 'liureg'
predict(object, newdata, ...)
object |
A |
newdata |
A data frame of new values for |
... |
Not used in this implementation. |
Depending on whether the lambda is a scalar or a vector,
the predict.liureg function returns a vector or matrix of predictions, respectively.
Murat Genç
liureg(), predict(), summary(), pressliu(), residuals()
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, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.