fit
|
A survatr_fit.
|
interventions
|
A named list of causatr_intervention objects (causatr::static(), causatr::shift(), causatr::scale_by(), causatr::threshold(), causatr::dynamic()). The element names are carried through to the intervention column of the result.
|
times
|
Numeric vector of time points at which to evaluate the survival curve. Must all be elements of fit$time_grid — extrapolation beyond the observed grid is rejected with survatr_time_extrapolation.
|
type
|
Estimand. For a single-event fit: one of “survival”, “risk”, “risk_difference”, “risk_ratio”, “rmst”, “rmst_difference”, “rmtl” (restricted mean time lost, t - RMST), “rmtl_difference”, or “quantile” (survival-time quantile / median; default “risk_difference”). For a competing-risks fit (surv_fit(…, competing = )): one of “cif” (per-cause cumulative incidence), “cif_difference”, “cif_ratio” (default), “yll” (per-cause years of life lost, int F^(j)), all-cause “survival” / “risk” / “rmst” / “rmtl”, or all-cause “quantile” (from the summed cause-specific hazards). Mixing a CIF estimand with a single-event fit (or vice versa) aborts with survatr_competing_type; “yll” on a single-event fit aborts with survatr_yll_needs_cr.
|
cause
|
Competing-risks only. Integer vector selecting which cause(s) to report for the cif estimands, or NULL (the default) for all causes. Validated against the fitted causes; ignored for survival / risk and for single-event fits.
|
q
|
For type = “quantile”, the quantile level(s) of the survival-time distribution to report – a numeric vector with every entry in (0, 1) (default 0.5 = median). The result is indexed by q (one tau_hat per (intervention, q)) rather than by time. Aborts with survatr_quantile_unreached when the curve never crosses 1 - q on the grid, and survatr_bad_q for out-of-range q. Ignored for other types.
|
reference
|
Name of the intervention used as the reference in difference / ratio contrasts. Defaults to the first name in interventions. Ignored by type = “survival”, “risk”, “rmst”, and “cif” (no pairwise contrast).
|
ci_method
|
One of “none” (point estimates only), “sandwich” (delta-method cross-time IF aggregation via causatr:::prepare_model_if()), or “bootstrap” (resample individuals, refit the hazard model per replicate, percentile or Wald CIs). Default “none”.
|
conf_level
|
Confidence level for the CIs when ci_method != “none”. Numeric scalar in (0, 1), default 0.95.
|
n_boot
|
Integer; number of bootstrap replicates. Ignored when ci_method != “bootstrap”. Default 500L.
|
boot_ci
|
One of “percentile” (sample-quantile CI) or “wald” (point estimate +/- z * sd(replicates)). Default “percentile”. Percentile is transform-invariant and is the safer default for ratios / RMST.
|
parallel
|
One of “no”, “multicore”, “snow”; forwarded to boot::boot(). Default “no”.
|
ncpus
|
Integer; number of CPUs for parallel bootstrap. Default 1L.
|
seed
|
Integer scalar or NULL. When non-null, set.seed(seed) is called before the bootstrap loop so the replicate sequence is reproducible. Default NULL.
|
cluster
|
NULL (the default; per-individual sandwich) or a single column name in the fit’s person-period data identifying the independent sampling cluster (site, household, provider, repeated enrolment). The label must be constant within id and have no NA. When supplied, the sandwich variance is cluster-robust (the per-individual influence functions are summed within cluster before the cross-product) and the bootstrap resamples whole clusters. cluster = “<id-column>” reproduces the per-individual sandwich exactly (singleton clusters). Supported for gcomp, IPW, IPCW, longitudinal ICE-hazard, and competing-risks fits.
|
…
|
Unused; reserved for future chunks.
|