Description Usage Arguments Details Value Source Examples
Function to fit a high dimensional Cox survival model using Univariate Shrinkage
1 |
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 |
This function builds a prediction model for survival data with high-dimensional covariates, using the Unvariate Shringae method.
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 |
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.
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])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.