sword
is a R package which implements the methodology that we study in our article. The main function of sword is sw_reg
. It allows to use the Inverse Probability of Censoring Weighting (IPCW) method to fit random forest and gam model to Φ(T) , where T is a right censored variable and Φ is a given function.
Different types of weights are available (Kaplan-Meier, Cox, Random Survival Forest (RSF)) and custom weights may be provided. cox_reg
, rsf_reg
, rrt_reg
and rlt_reg
are functions which implement benchmarks models based on respectively: the Cox model, the Random Survival Forest algorithm, the Relative risk tree model, and the Reinforcement Learning Tree algorithm, all studied in our article. The package also provides different performance measures of the quality of fit of the models.
sword
can be used to get a quick insight about the precision of the IPCW method for the estimation of E[Φ(T)|X] when X is a vector of covariates, and to compare its performances with alternative models.
Technically, sword is a wrapper for statistical algorithms provided in the R packages randomForestSRC, rpart, surv, mgcv, and RLT.
sword is not available on CRAN and it can only be installed via devtools :
# First, install "devtools" :
install.packages("devtools")
# install "sword" :
devtools::install_github("YohannLeFaou/sword")
The vignette of the sword package explains the principle of the method and illustrates through an example how the package can be used.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.