Learn R Programming

rqPen (version 2.2.2)

predict.rq.pen: Prediction from a quantile regression penalized model

Description

Returns predicted values from "rq.pen" object for "newx" covariates.

Usage

# S3 method for rq.pen
predict(object, newx,...)

Arguments

object

rq.pen object.

newx

Matrix of covariates used for prediction.

...

Needed for consistency with generic predict.

Value

Returns predicted values from the model.

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(800),nrow=100)
y <- 1 + x[,1] - 3*x[,5] + rnorm(100)
lassoModel <- rq.lasso.fit(x,y,lambda=1)
n2 <- matrix(rnorm(80),nrow=10)
preds <- predict(lassoModel,n2)
# }

Run the code above in your browser using DataLab