Learn R Programming

survivalSL (version 0.98)

LIB_RSF: Library of the Super Learner for Survival Random Survival Forest

Description

Fit survival random forest tree for given values of the regularization parameters.

Usage

LIB_RSF(formula, data, nodesize, mtry, ntree, seed=NULL)

Value

formula

The formula object used for model construction.

model

The estimated model.

data

The data frame used for learning.

times

A vector of numeric values with the times of the predictions.

predictions

A matrix with the predictions of survivals of each subject (lines) for each observed time (columns).

Arguments

formula

A formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function.

data

A data frame whose columns correspond to the variables present in the formula.

nodesize

The value of the node size.

mtry

The number of variables randomly sampled as candidates at each split.

ntree

The number of trees.

seed

A random seed to ensure reproducibility during bootstrap sampling. If NULL, a seed is randomly assigned.

Details

The survival random forest tree is obtained by using the randomForestSRC package.

References

Simon, N., Friedman, J., Hastie, T. and Tibshirani, R. (2011) Regularization Paths for Cox's Proportional Hazards Model via Coordinate Descent, Journal of Statistical Software, Vol. 39(5), 1-13, https://www.jstatsoft.org/v39/i05/

Examples

Run this code
data("dataDIVAT2")

# The estimation of the model

formula<-Surv(times,failures) ~ age + hla + retransplant + ecd
model <- LIB_RSF(formula, data=dataDIVAT2, nodesize=10,
  mtry=2, ntree=100, seed=NULL)

# The predicted survival of the first subject of the training sample
plot(y=model$predictions[1,], x=model$times, xlab="Time (years)",
ylab="Predicted survival", col=1, type="l", lty=1, lwd=2, ylim=c(0,1))

Run the code above in your browser using DataLab