covTest (version 1.02)

predict.lars.glm: Function to make predictions from lars.glm fit

Description

Function to make predictions from lars.glm fit

Usage

"predict"(object, x, lambda, time=NULL, status = NULL, ...)

Arguments

object
x
N by p matrix of predictors
lambda
Value of L1- regularization parameter at which predictions are desired
time
Optional N-vector of survival times, required for Cox Proportional hazards model.
status
Optional N-vector of censoring indicators, required for Cox Proportional hazards model. 1=failed; 0=censored.
...
additional arguments (not used)

Value

Vector of predicted values, on the linear predictor scale.

References

Park, M.Y. and Hastie, T. (2007) 1l regularization path algorithm for generalized linear models. JRSSB B 69(4), 659-677

See Also

lars.glm, covTest

Examples

Run this code
#logistic
x=matrix(rnorm(100*10),ncol=10)
x=scale(x,TRUE,TRUE)/sqrt(99)
y=4*x[,2]+rnorm(100)
y=1*(y>0)
a=lars.glm(x,y,family="binomial")
yhat=predict.lars.glm(a,x,family="binomial")

# Cox model
#y=6*x[,2]+rnorm(100)+10
#status=sample(c(0,1),size=length(y),replace=TRUE)
#a=lars.glm(x,y,status=status,family="cox")
#yhat=predict.lars.glm(a,x,family="cox")

Run the code above in your browser using DataLab