rf.time: Library of the Super Learner for Survival Random Forest Tree

View source: R/rf.time.R

rf.timeR Documentation

Library of the Super Learner for Survival Random Forest Tree

Description

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

Usage

rf.time(times, failures, group, cov.quanti, cov.quali,
data, nodesize, mtry, ntree)

Arguments

times

The name of the variable related the numeric vector with the follow-up times.

failures

The name of the variable related the numeric vector with the event indicators (0=right censored, 1=event).

group

The name of the variable related to the exposure/treatment. This variable shall have only two modalities encoded 0 for the untreated/unexposed patients and 1 for the treated/exposed ones. The default value is NULL: no specific exposure/treatment is considered. When a specific exposure/treatment is considered, it will be forced in the algorithm or related interactions will be tested when possible.

cov.quanti

The name(s) of the variable(s) related to the possible quantitative covariates. These variables must be numeric.

cov.quali

The name(s) of the variable(s) related to the possible qualitative covariates. These variables must be numeric with two levels: 0 and 1. A complete disjunctive form must be used for covariates with more levels.

data

A data frame for training the model in which to look for the variables related to the status of the follow-up time (times), the event (failures), the optional treatment/exposure (group) and the covariables included in the previous model (cov.quanti and cov.quali).

nodesize

The value of the node size.

mtry

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

ntree

The number of trees.

Details

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

Value

model

The estimated model.

group

The name of the variable related to the exposure/treatment.

cov.quanti

The name(s) of the variable(s) related to the possible quantitative covariates.

cov.quali

The name(s) of the variable(s) related to the possible qualitative covariates.

data

The data frame used for learning. The first column is entitled times and corresponds to the observed follow-up times. The second column is entitled failures and corresponds to the event indicators. The other columns correspond to the predictors.

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 times (columns).

Author(s)

Yohann Foucher <Yohann.Foucher@univ-poitiers.fr>

Camille Sabathe <camille.sabathe@univ-nantes.fr>

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


data(dataDIVAT2)

# The estimation of the model
model<-rf.time(times="times", failures="failures", data=dataDIVAT2,
  cov.quanti=c("age"),  cov.quali=c("hla", "retransplant", "ecd"), nodesize=10, mtry=2, ntree=100)

# 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))
     

RISCA documentation built on March 31, 2023, 11:06 p.m.

Related to rf.time in RISCA...