ltrccif {LTRCforests} | R Documentation |
Fit a LTRC conditional inference forest
Description
An implementation of the random forest and bagging ensemble algorithms utilizing
LTRC conditional inference trees LTRCIT
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
ltrccif(
formula,
data,
id,
mtry = NULL,
ntree = 100L,
bootstrap = c("by.sub", "by.root", "by.user", "none"),
samptype = c("swor", "swr"),
sampfrac = 0.632,
samp = NULL,
na.action = "na.omit",
stepFactor = 2,
trace = TRUE,
applyfun = NULL,
cores = NULL,
control = partykit::ctree_control(teststat = "quad", testtype = "Univ", minsplit =
max(ceiling(sqrt(nrow(data))), 20), minbucket = max(ceiling(sqrt(nrow(data))), 7),
minprob = 0.01, mincriterion = 0, saveinfo = FALSE)
)
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 |
mtry |
number of input variables randomly sampled as candidates at each node for
random forest algorithms. The default |
ntree |
an integer, the number of the trees to grow for the forest.
|
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
|
applyfun |
an optional |
cores |
numeric. See |
control |
a list of control parameters, see |
Details
This function extends the conditional inference survival forest algorithm in
cforest
to fit left-truncated and right-censored data,
which allow for time-varying covariates.
Value
An object belongs to the class ltrccif
, as a subclass of
cforest
.
References
Andersen, P. and Gill, R. (1982). Cox's regression model for counting processes, a large sample study. Annals of Statistics, 10:1100-1120.
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.ltrccif
for mtry
tuning.
Examples
#### Example with time-varying data pbcsample
library(survival)
Formula = Surv(Start, Stop, Event) ~ age + alk.phos + ast + chol + edema
## Fit an LTRCCIF on the time-invariant data, with mtry tuned with stepFactor = 3.
LTRCCIFobj = ltrccif(formula = Formula, data = pbcsample, ntree = 20L, stepFactor = 3)