Learn R Programming

cosso (version 2.1-0)

cosso.cox: Estimate the log-relative risk using Smoothing Splines with COSSO penalty.

Description

Estimate the log-relative risk function in a Cox proportional hazards model by solving a penalized partial likelihood function.

Usage

cosso.cox(x,time,status,wt=rep(1,ncol(x)),scale=FALSE,nbasis,basis.id,parallel=FALSE,cpus=1)

Arguments

x
input matrix; the number of rows is sample size, the number of columns is the data dimension. The range of input variables is scaled to [0,1].
time
observed event time.
status
status indicator. 1: dead; 0: alive.
wt
weights for predictors. Default is rep(1,ncol(x)).
scale
if TRUE, each predictor variable is rescaled to [0,1] interval. Dafault is FALSE.
nbasis
number of "knots" to be used. Ignored when basis.id is specified.
basis.id
index of observations to be used as "knots".
parallel
parallelize task using snowfall package? Default is FALSE. Recommended when either sample size or number of predictor is large.
cpus
number of available processor units. Default is 1.

Value

  • An object with S3 class "cosso".
  • familytype of regression model.
  • timeobserved event time.
  • statusstatus indicator.
  • wtweights.
  • basis.idpre-specified or randomly selected index that are used as "knots".
  • tunea list containing tuning result

Details

In a proportional hazards model, the log-relative risk function is first assumed to have an additive form $$\lambda(t|x)=\lambda(t)\exp[\eta(x)]\,~\eta(x)=\sum_{j=1}^p\eta_j(x_j),$$ and then estimated via the penalized partial likelihood: $$-partial~likelihood/nobs+\lambda_0\sum_{j=1}^p\theta^{-1}_jw_j^2||\eta_j||^2, s.t.~\sum_{j=1}^p\theta_jnbais as "knots", which reduces the dimension of the kernel matrices from nobs to nbasis. Unless specified via basis.id or nbasis, the number of "knots" is determined by max(35,12nobs^{2/9}). The weights can be specified based on either user's own discretion or adaptively computed from initial function estimates. See Storlie et al. (2011) for more discussions. One possible choice is to specify the weights as the inverse $L_2$ norm of initial function estimator, see SSANOVAwt.cox.

References

Leng, C. and Zhang, H. H. (2006) "Model selection in nonparametric hazard regression", Nonparametric Statistics, 18, 417--429.

See Also

tune.cosso.cox, plot.cosso, predict.cosso

Examples

Run this code
data(veteran)
t0=proc.time()
## Use half of the observations for demonstration
set.seed(27695)
train.id <- sort(sample(1:nrow(veteran),ceiling(nrow(veteran)/2)))
cossoCox <- cosso.cox(veteran[train.id,5:7],veteran[train.id,1],veteran[train.id,2],nbasis=20)
print((proc.time()-t0)[3])

## Parallel Computing
## Not recommended in this example
data(veteran)
t0=proc.time()
## Use half of the observations for demonstration
set.seed(27695)
train.id <- sort(sample(1:nrow(veteran),ceiling(nrow(veteran)/2)))
cossoCox <- cosso.cox(veteran[train.id,5:7],veteran[train.id,1],veteran[train.id,2],parallel=TRUE,cpus=2)
print((proc.time()-t0)[3])

## Adaptive COSSO-Cox
data(veteran)
adawt <- SSANOVAwt.cox(veteran[,5:7],veteran[,1],veteran[,2])
ada.CoxObj <- cosso.cox(veteran[,5:&],veteran[,1],veteran[,2],adawt,FALSE,parallel=FALSE)

Run the code above in your browser using DataLab