covTest (version 1.02)

lars.glm: Function to fit least angle regression path of solution for Ll-penalized (lasso) logistic regression and the Cox proportional hazards model.

Description

Function to fit least angle regression path of solution for Ll-penalized (lasso) logistic regression and the Cox proportional hazards model.

Usage

lars.glm(x, y, status = NULL, family = c("binomial", "cox"), standardize=TRUE,frac.arclength=.1)

Arguments

x
N by p matrix of predictors
y
N-vector of outcome values
status
Optional N-vector of censoring indicators for Cox Proportioanl hazards model. 1=failed; 0=censored.
family
"binomial" or "cox"
standardize
Should predictor be standardized? Default TRUE
frac.arclength
Step length parameter for glmpath. See help file for glmpath for details

Value

beta
Matrix of estimated coefficients, with LAR steps in the rows.
a0
Estimate of intercept
lambda0
Raw values of lambda used
lambda
Values of lambda multiplied by sdx, the standard deviation of each predictor
lambda2
Value of lambda2 (L2 penalty parameter)
act
Actions (predictor added) at each step
maxp
Maximum number of predictors entered
family
family used- "binomial" or "cox"
call
Call to lars.glm
pathobj
Result of call to glmpath or coxpath

Details

This function estimates the least angle regression path of solution for Ll-penalized (lasso) logistic regression and the Cox proportional hazards model, using the R functions glmpath and coxpath written by Park and Hastie. These latter functions use the predictor-corrector strategy devised by Park and Hastie (2007). An additional L2 penalty can be added for stability.

References

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

See Also

covTest, predict.glm.Rd

Examples

Run this code
x=matrix(rnorm(100*10),ncol=10)
x=scale(x,TRUE,TRUE)/sqrt(99)

#logistic
y=5*x[,2]+rnorm(100)
y=1*(y>0)
a=lars.glm(x,y,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")
  

Run the code above in your browser using DataCamp Workspace