Resampling Survival Curves for Confidence Bands
Source:R/km_wlr_calculations_helpers.R
resampling_survival.RdPerforms resampling to generate survival curves for a group, used for constructing confidence bands.
Details
Each column is one resampled deviation \(\hat S^*(t) - \hat S(t)\) at at.points,
for one column of multipliers G_draws (one row per subject). With no weights or all weights
equal, the multipliers perturb the events only:
\(-\hat S(t) \sum_{s \le t} \sum_i G_i w_i dN_i(s) / Y_w(s)\); these results are unchanged.
With weights that are not all equal, the deviation is built from the per-subject influence
contributions \(\psi_i(t)\) of the robust variance (see KM_diff, section
"Variance of the Kaplan-Meier estimate"):
\(-\hat S(t) \sum_i G_i w_i \psi_i(t)\), so its variance over draws is the robust variance
\(\hat S(t)^2 \sum_i w_i^2 \psi_i(t)^2\), which equals that of
survival::survfit(weights = w, robust = TRUE). The weights are treated as fixed and known.
Both forms need at.points to hold every event time of the group
(KM_diff arranges this).