uniCox: Function to fit a high dimensional Cox survival model using...

Description Usage Arguments Details Value Source Examples

View source: R/uniCox.R

Description

Function to fit a high dimensional Cox survival model using Univariate Shrinkage

Usage

1
uniCox(x,y,status,lamlist=NULL,nlam=20,del.thres=.01, max.iter=5)

Arguments

x

Feature matrix, n obs by p variables

y

Vector of n survival times

status

Vector of n censoring indicators (1= died or event occurred,0=survived, or event was censored)

lamlist

Optional vector of lambda values for solution path

nlam

Number of lambda values to consider

del.thres

Convergence threshold

max.iter

Maximum number of iterations for each lambda

Details

This function builds a prediction model for survival data with high-dimensional covariates, using the Unvariate Shringae method.

Value

A list with components

lamlist

Values of lambda used

beta

Coef estimates, number of features by number of lambda values

mx

Mean of feature columns

vx

Square root of Fisher information for each feature

s0

Exchangeability factor for denominator of score statistic

call

Call to this function

Source

Tibshirani, R. Univariate shrinkage in the Cox model for high dimensional data (2009). http://www-stat.stanford.edu/~tibs/ftp/cus.pdf To appear SAGMB.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library(survival)
# generate some data
x=matrix(rnorm(200*1000),ncol=1000)
y=abs(rnorm(200))
x[y>median(y),1:50]=x[y>median(y),1:50]+3
status=sample(c(0,1),size=200,replace=TRUE)

xtest=matrix(rnorm(50*1000),ncol=1000)
ytest=abs(rnorm(50))
xtest[ytest>median(ytest),1:50]=xtest[ytest>median(ytest),1:50]+3

statustest=sample(c(0,1),size=50,replace=TRUE)


# fit uniCox  model
a=uniCox(x,y,status)

# look at results
 print(a)

# do cross-validation to examine choice of lambda
aa=uniCoxCV(a,x,y,status)

# look at results
 print(aa)

# get predictions on a test set
yhat=predict.uniCox(a,xtest)

# fit survival model to predicted values
coxph(Surv(ytest,statustest)~yhat[,7])

uniCox documentation built on May 29, 2017, 2:19 p.m.

Related to uniCox in uniCox...