Description Usage Arguments Value Author(s) References See Also Examples
Function to make predictions from lars.glm fit
1 2 |
object |
Result of call to lars.glm
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) |
Vector of predicted values, on the linear predictor scale.
Rob Tibshirani
Park, M.Y. and Hastie, T. (2007) 1l regularization path algorithm for generalized linear models. JRSSB B 69(4), 659-677
lars.glm, covTest
1 2 3 4 5 6 7 8 9 10 11 12 13 | #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")
|
Loading required package: lars
Loaded lars 1.2
Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16
Loading required package: glmpath
Loading required package: survival
Loading required package: MASS
Warning message:
In predict.glmpath(object$pathobj, x, s = lambda, mode = "lambda", :
no s argument; mode switched to step
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.