ltrcrrf  R Documentation 
An implementation of the random forest algorithms utilizing LTRC rpart
trees LTRCART
as base learners for lefttruncated rightcensored
survival data with timeinvariant covariates. It also allows for (lefttruncated)
rightcensored survival data with timevarying covariates.
ltrcrrf(
formula,
data,
id,
ntree = 100L,
mtry = NULL,
nodesize = max(ceiling(sqrt(nrow(data))), 15),
bootstrap = c("by.sub", "by.root", "by.node", "by.user", "none"),
samptype = c("swor", "swr"),
sampfrac = 0.632,
samp = NULL,
na.action = "na.omit",
stepFactor = 2,
trace = TRUE,
nodedepth = NULL,
nsplit = 10L,
ntime
)
formula 
a formula object, with the response being a

data 
a data frame containing 
id 
variable name of subject identifiers. If this is present, it will be
searched for in the 
ntree 
an integer, the number of the trees to grow for the forest.

mtry 
number of input variables randomly sampled as candidates at each node for
random forest like algorithms. The default 
nodesize 
an integer, forest average terminal node size. 
bootstrap 
bootstrap protocol.
(1) If 
samptype 
choices are 
sampfrac 
a fraction, determining the proportion of subjects to draw
without replacement when 
samp 
Bootstrap specification when 
na.action 
action taken if the data contains 
stepFactor 
at each iteration, 
trace 
whether to print the progress of the search of the optimal value
of 
nodedepth 
maximum depth to which a tree should be grown. The default behaviour is that this parameter is ignored. 
nsplit 
an nonnegative integer value for number of random splits to consider
for each candidate splitting variable. This significantly increases speed.
When zero or 
ntime 
an integer value used for survival to constrain ensemble calculations
to a grid of 
This function extends the relative risk forest algorithm (Ishwaran et al. 2004)
to fit lefttruncated and rightcensored data,
which allows for timevarying covariates. The algorithm is built based on employing
the fast C code from rfsrc
.
An object belongs to the class ltrcrrf
, as a subclass of
rfsrc
.
Andersen, P. and Gill, R. (1982). Cox’s regression model for counting processes, a large sample study. Annals of Statistics, 10:11001120.
H. Ishwaran, E. H. Blackstone, C. Pothier, and M. S. Lauer. (2004). Relative risk forests for exercise heart rate recovery as a predictor of mortality. Journal of the American StatisticalAssociation, 99(1):591–600.
Fu, W. and Simonoff, J.S. (2016). Survival trees for lefttruncated and rightcensored data, with application to timevarying covariate data. Biostatistics, 18(2):352–369.
predictProb
for prediction and tune.ltrcrrf
for mtry
tuning.
#### Example with timevarying data pbcsample
library(survival)
Formula = Surv(Start, Stop, Event) ~ age + alk.phos + ast + chol + edema
# Built a LTRCRRF forest (based on bootstrapping subjects without replacement)
# on the timevarying data by specifying id:
LTRCRRFobj = ltrcrrf(formula = Formula, data = pbcsample, id = ID, stepFactor = 3,
ntree = 10L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.