R/pamm-ic.R
pamm_ic_cr.RdCompeting-risks extension of pamm_ic. The event time is drawn
from the all-cause conditional hazard within \((L, R]\) and a cause is
assigned: observed causes are retained (with the time drawn so that it follows
the cause-specific conditional density, via rejection), unknown causes are
sampled with probability proportional to the cause-specific hazards at the
imputed time (see impute_ic_cr). Each completed data set is
transformed with as_ped_cr (cause-specific hazards) and re-fit.
Cf. Delord & Genin (2016) for MI of interval-censored competing-risks data.
pamm_ic_cr(
formula,
data,
cause,
model_formula = NULL,
cut = NULL,
max_time = NULL,
m = 10L,
iter = 1L,
censor_code = 0L,
id = "id",
engine = "gam",
...
)A two-sided formula whose left-hand side is an interval-censored
response Surv(L, R, type = "interval2") and whose right-hand side lists
the covariates to retain (as in as_ped).
A data frame in standard (one row per subject) format.
Name of the column in data giving the observed cause for
events (any factor/character coding). Rows with the censoring code are
treated as right-censored; NA marks an event with unknown cause.
Optional model formula passed to pamm
(e.g.\ ped_status ~ s(tend) + x). If NULL, a default
ped_status ~ s(tend) + <covariates> formula is constructed.
Optional fixed vector of interval cut-points shared across all
imputations. If NULL, the finite interval endpoints are used.
Optional cap on the cut-points.
Number of imputations (default 10).
Number of impute-refit iterations per imputation chain (default
1 = classic one-step MI: all m imputations are drawn from the
single initialiser fit). For iter = k > 1, each chain alternates
imputation and re-fitting on its own completed data set k times, so
later imputations are drawn from fits whose dependence on the midpoint
initialiser is progressively attenuated – a sequential ("chained") MI
scheme that
progressively removes initialiser bias under sparse inspection, at roughly
iter-fold fitting cost. Simulation evidence (see the package's
interval-censoring benchmark): with inspection gaps that are small
relative to the time scale, iter = 1 is unbiased; with wide gaps
(mean gap of order 1/3 of the follow-up), early-time survival estimates
from iter = 1 are biased upward and iter = 3 removes most
of that bias (iter = 5 essentially all of it), with bias shrinking
roughly geometrically in iter. Caveat: with flexible time-varying
effect terms and small samples, iterating can occasionally amplify a
weakly identified imputation chain into divergent estimates with very
wide intervals (without mgcv warnings) – inspect pooled smooth
effects for plausibility when iterating such models.
Value of cause that encodes censoring (default 0).
Name of the subject identifier column.
Estimation engine passed to pamm ("gam" or
"bam").
Further arguments passed to pamm / mgcv.
An object of class pamm_ic with type = "cr"; fits
are cause-specific (stacked ped_cr) pamm objects and
cause_levels records the competing causes.