customRSF: Random Survival Forests using the 'randomSurvivalForest' R...

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

Description

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

Usage

1
customRSF(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 function rsf from packagerandomSurvivalForest.

Value

An object of class ModelLearned.

Author(s)

Christoph Bernau bernau@ibe.med.uni-muenchen.de

References

Ishwaran, H., et al. (2008) Random Survival Forests, The Annals of Applied Statistics, 2, 841-860

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
##load example data
if(require(pensim)){
require(survHD)
require(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 ridge regression, and with L2 penalty equal to 100:
fit.rsf <- customSurv(X=beerX,y=beerY, learnind=learnind, ntree=50,customSurvModel=customRSF)
##linear risk score
##survival probabilities at each uncensored time
mytimegrid <- sort(c(0.0,beerY[beerY[,2]==1,1]))
SurvivalProbs <- predict(fit.rsf,beerX[testind,],type='SurvivalProbs',timegrid=mytimegrid,gbm=FALSE)@SurvivalProbs
plot(SurvivalProbs,xlab="Time", ylab="Probability of Survival")
}

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