This function computes leave-one-out estimation of regression coefficients, cumulative hazard functions, and transition probability functions.
loo_ebmstate(
mstate_data,
mstate_data_expanded,
which_group,
patient_IDs,
initial_state,
tmat,
time_model,
backup_file = NULL,
input_file = NULL,
coxrfx_args = list(),
msfit_args = NULL,
probtrans_args = NULL
)
A list with: 95% bootstrap intervals for each regression coefficient and for transition probabilities; bootstrap samples of regression coefficients, cumulative hazards and transition probabilities.
Data in `long format`.
Data in `long format`, possibly with `expanded` covariates (as obtained by running mstate::expand.covs).
A character vector with the same meaning as the `groups` argument of the function CoxRFX
but named (with the covariate names).
The IDs of the patients whose cumulative hazards and transition probabilities one wishes to estimate.
The initial state for which transition probability estimates should be computed
Transition matrix for the multi-state model, as obtained by running mstate::transMat
The model of time-dependency: either 'clockforward' or 'clockreset'.
Path to file. Objects generated while the present function is running are stored in this file.
This avoids losing all estimates if and when the algorithm breaks down. See argument input_file
.
Path to backup_file
(see argument backup_file
). If this argument is given, all other arguments should be NULL
.
Named list with arguments to the CoxRFX
function other than Z
,surv
and groups
.
Named list with arguments to the msfit_generic.coxrfx
function other than object
,newdata
and trans
.
Named list with arguments to the probtrans_ebmstate
function other than initia_state
,cumhaz
and model
.
Rui Costa
In a given bootstrap sample there might not be enough information to generate
estimates for all coefficients. If a covariate has little or no variation in a given bootstrap sample,
no estimate of its coefficient will be computed. The present function will
keep taking bootstrap samples until every coefficient has been estimated
at least min_nr_samples
times.