predictSurvProb.orsf: Compute predictions using an oblique random survival forest.

Description Usage Arguments Value Examples

View source: R/oblique_survival_forest_predictSurvProb.R

Description

Compute predictions using an oblique random survival forest.

Usage

1
2
## S3 method for class 'orsf'
predictSurvProb(object, newdata, times, ...)

Arguments

object

A fitted model from which to extract predicted survival probabilities

newdata

A data frame containing predictor variable combinations for which to compute predicted survival probabilities.

times

A vector of times in the range of the response variable, e.g. times when the response is a survival object, at which to return the survival probabilities.

...

Additional arguments that are passed on to the current method.

Value

A matrix of survival probabilities containing 1 row for each observation and 1 column for each value in times.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
data("pbc",package='survival')
pbc$status[pbc$status>=1]=pbc$status[pbc$status>=1]-1
pbc$id=NULL
fctrs<-c('trt','ascites','spiders','edema','hepato','stage')
for(f in fctrs)pbc[[f]]=as.factor(pbc[[f]])
pbc=na.omit(pbc)

orsf=ORSF(data=pbc,ntree=30)
times=seq(365, 365*4,length.out = 10)

predict(orsf,newdata=pbc[c(1:5),],times=times)

## End(Not run)

obliqueRSF documentation built on March 14, 2019, 1:06 a.m.