Draw interval-censored event times given the biomarker history
Source:R/imputeEventTime.R
imputeEventTime.RdExperimental. One draw of each subject's event time
from \(f(T \mid L < T \le R, Y, X) \propto f(Y \mid T, X) f(T \mid
X)\): \(f(Y \mid T)\) from the longitudinal sub-model on a grid of
n_grid intervals tiling \((L, R]\) (conditionalYT()),
times the survival model's probability of each grid interval
(marginalT()); an interval is drawn with those weights and
\(T\) uniformly within it. A right-censored subject (\(R = \infty\))
uses the same equal-probability grid from \(L\) out to the survival
model's tail as predictRisk(). A subject with \(L = R\) keeps
\(T = L\). Used by fitIntervalBJM.
Usage
imputeEventTime(
data_fit_all,
long_fit_all,
survival_fit_all,
bounds,
time_variable,
survival_variable_all = NULL,
survival_trans_function = NULL,
n_grid = 40,
n_draws = 1
)Arguments
- data_fit_all
Longitudinal data, one data frame per biomarker.
- long_fit_all
Output of
longitudinalSub().- survival_fit_all
Interval-censored output of
survivalSub().- bounds
Data frame with columns
id,L,R(and, with competing risks, the observed event typeD).- time_variable, survival_variable_all, survival_trans_function
As in
predictRisk().- n_grid
Grid intervals per subject.
- n_draws
Independent draws per subject (the weights are computed once and reused).