customUniCox: Univarate shrinkage prediction in the Cox model

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

Description

Usually, this function is not called directly but embedded in a call to customSurv from the main package survHD (see examples).

See http://cran.r-project.org/web/packages/uniCox/index.html for more details

Usage

1
customUniCox(Xlearn, Ylearn, learnind,...)

Arguments

Xlearn

Gene expression data (a data.frame)

Ylearn

Survival Response, an object of class Surv.

learnind

An index vector specifying the observations that belong to the learning set. May be missing; in that case, the learning set consists of all observations and predictions are made on the learning set.

...

Further arguments that shall be passed to uniCox function from the uniCox R package (http://cran.r-project.org/web/packages/uniCox/index.html)

Value

An object of class ModelLearned.

Author(s)

Levi Waldron lwaldron@hsph.harvard.edu Christoph Bernau bernau@ibe.med.uni-muenchen.de

References

Tibshirani RJ: Univariate shrinkage in the cox model for high dimensional data. Stat Appl Genet Mol Biol 2009, 8:Article21.

See Also

learnSurvival

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
##load example data
if(require(pensim)){
library(survHD)
library(survHDExtra)
data(beer.exprs,package="pensim")
data(beer.survival,package="pensim")
##create Surv object (y)
beerY <- with(beer.survival,Surv(os,status))
##create mini X matrix (only using first 200 genes)
beerX <- t(as.matrix(beer.exprs))
beerX <- beerX[,1:200]
colnames(beerX) <- make.names(colnames(beerX),unique=TRUE)
##scale everything for testing.
beerX <- scale(beerX)
##define training and test sets:
set.seed(4)
allind <- 1:nrow(beerX)
learnind <- sample(allind,size=round(length(allind)*9/10))
testind <- allind[-learnind]
##fit a model with penalty equal to 10:
fit.unicox <- customSurv(X=beerX,y=beerY, learnind=learnind, lambda=10,customSurvModel=customUniCox)
##linear risk score
predict(fit.unicox@model,newdata=beerX[testind,],type='lp')
##survival probabilities at each uncensored time
mytimegrid <- sort(c(0.0,beerY[beerY[,2]==1,1]))
SurvivalProbs <- predict(fit.unicox,beerX[testind,],type='SurvivalProbs',timegrid=mytimegrid,gbm=TRUE)@SurvivalProbs
plot(SurvivalProbs,xlab="Time", ylab="Probability of Survival")

}

bernau/survHDExtra documentation built on May 12, 2019, 4:22 p.m.