lars.glm: Function to fit least angle regression path of solution for...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/funcs.R

Description

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

Usage

1
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

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.

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

Author(s)

Rob Tibshirani

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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")
  

covTest documentation built on May 29, 2017, 8:30 p.m.