surv.lars {timereg}R Documentation

Fits LASSO model for additive hazards model by Lars algorithm

Description

Fits the LASSO estimator for the additive risk model based on the least squares fitting criterion

L(β,S,s) = β^T S β - 2 β^T s

where S=int Z H Z dt and s=int Z H dN.

This is equivalent to an appropriate normal least squares problem on least squares data.

Usage

surv.lars(S, s, n, l1.weights = NULL, ...)

Arguments

S the S matrix defined above.
s the s vector defined above.
n number of subjects, used in lars to decide dimension.
l1.weights NOT WORKING yet. specifies the weights for the L1 penalty.
... unused arguments - for S3 compatibility

Details

Modified version of standard lars program in the LARS package. Essentially all scalings are removed from the lars program.

The matrices S and S can be computed using the aalen.test() function.

Value

see lars.

Author(s)

Thomas Scheike

References

Martinussen and Scheike, Model selection for the the additive risks hazards model, submitted.

Martinussen and Scheike, Dynamic Regression Models for Survival Data, Springer (2006).

LARS, Efron et al.

Examples

## makes data for pbc complete case
data(mypbc)
pbc<-mypbc
pbc$time<-pbc$time+runif(418)*0.1; pbc$time<-pbc$time/365
pbc<-subset(pbc,complete.cases(pbc)); 
covs<-as.matrix(pbc[,-c(1:3,6)])
covs<-cbind(covs[,c(1:6,16)],log(covs[,7:15]))
covs<-scale(covs); 

## computes the matrices needed for the least squares 
## criterion 
out<-aalen.test(Surv(time,status>=1)~const(covs),pbc,n.sim=0,robust=0)
S<-out$intZHZ; s<-out$intZHdN
n<-nrow(pbc)

## lasso for survival data 
fit<-surv.lars(S,s,n)
plot(fit)

cv<-surv.lars.cv(Surv(time,status>=1)~ const(covs),data=pbc)
beta<-mypredict.lars(fit,cv$cv.frac,type="coefficients",mode = "fraction")$coef
c(beta)

## fitting survival model with these coefficients
out<-aalen.test(Surv(time,status>=1)~ const(covs),data=pbc,fix.gam=1,n.sim=0,robust=0,
gamma=beta)
pout<-predict(out,Z=covs[1:20,],uniform=0,se=0)
plot(pout,multiple=1,se=0,uniform=0); 

full<-fit$beta[nrow(fit$beta),] # least squares solution
c(full)

[Package timereg version 1.2-2 Index]