estimate() turns any
survalis learner into a plug-in G-computation
(outcome-standardisation) estimator of a covariate-adjusted contrast
between the two levels of a binary treatment.
Given formula = Surv(time, status) ~ x1 + x2 (the
right-hand side lists the confounders) and
treatment = "a", estimate():
fits the working model
Surv(time, status) ~ a * (x1 + x2) with the chosen
learner,
sets a to each level for every
subject and predicts \(\hat S(t \mid X_i,
a)\),
averages over subjects to get counterfactual mean curves \(\bar S_a(t) = n^{-1} \sum_i \hat S(t \mid X_i, a)\),
contrasts them into one of
estimand |
quantity |
|---|---|
"RMST_diff" |
\(\int_0^\tau \bar S_1 - \int_0^\tau \bar S_0\) |
"RMST_ratio" |
\(\int_0^\tau \bar S_1 \big/ \int_0^\tau \bar S_0\) |
"survival_diff" |
\(\bar S_1(\tau) - \bar S_0(\tau)\) |
"survival_ratio" |
\(\bar S_1(\tau) \big/ \bar S_0(\tau)\) |
library(survalis)
#> Registered S3 method overwritten by 'survalis':
#> method from
#> plot.formula graphics
est <- estimate(
Surv(time, status) ~ age + karno + celltype, data = veteran,
model = "coxph", estimand = "RMST_diff",
treatment = "trt", tau = 300,
R = 100, seed = 1
)
est
#> <survalis_estimate> RMST difference at tau = 300 (model: coxph)
#> treatment: trt (2 vs 1)
#> estimate: -14.3905 95% CI [-37.9061, 7.8690] (100 bootstrap, refit)
#> plug-in G-formula; causal reading needs exchangeability, positivity,
#> consistency, no interference and a correct outcome model.The confidence interval is a nonparametric subject
bootstrap. By default (refit = TRUE) the working
model is refitted inside every replicate, so the interval reflects
model-estimation error as well as sampling variability. For an expensive
learner you can set refit = FALSE to get an interval that
is conditional on the fitted model – faster, but narrower than
it should be.
estimate() is a plug-in G-formula
estimator. It is not doubly robust and carries no protection
against outcome-model misspecification beyond the
treatment-by-confounder interactions it adds automatically. The estimate
has a causal interpretation only under:
formula;For a non-manipulable attribute (sex, a biomarker), read the result as a covariate-adjusted marginal contrast, not an effect.