ltrcrrf {LTRCforests} | R Documentation |
Fit a LTRC relative risk forest
Description
An implementation of the random forest algorithms utilizing LTRC rpart
trees LTRCART
as base learners for left-truncated right-censored
survival data with time-invariant covariates. It also allows for (left-truncated)
right-censored survival data with time-varying covariates.
Usage
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
)
Arguments
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 non-negative 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 |
Details
This function extends the relative risk forest algorithm (Ishwaran et al. 2004)
to fit left-truncated and right-censored data,
which allows for time-varying covariates. The algorithm is built based on employing
the fast C code from rfsrc
.
Value
An object belongs to the class ltrcrrf
, as a subclass of
rfsrc
.
References
Andersen, P. and Gill, R. (1982). Cox’s regression model for counting processes, a large sample study. Annals of Statistics, 10:1100-1120.
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 left-truncated and right-censored data, with application to time-varying covariate data. Biostatistics, 18(2):352–369.
See Also
predictProb
for prediction and tune.ltrcrrf
for mtry
tuning.
Examples
#### Example with time-varying 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 time-varying data by specifying id:
LTRCRRFobj = ltrcrrf(formula = Formula, data = pbcsample, id = ID, stepFactor = 3,
ntree = 10L)