Implements Estimator I (AJE 2022, Eq. 2) combining propensity score weighting and inverse probability of censoring weighting to estimate counterfactual survival functions and treatment effects. Variance estimation uses bootstrap only. Estimate Counterfactual Survival Functions Using Cox Censoring Scores
surv_cox(
data,
time_var,
event_var,
treatment_var,
eval_times = NULL,
weight_result,
censoring_formula,
censoring_control = list(),
ties = "efron"
)List containing:
Matrix [time x J] of survival function estimates S^(j)(t).
Time points evaluated.
Treatment level values.
Number of treatment levels.
List of weight vectors by treatment group.
List of censoring score vectors by group.
Weighting method and target estimand.
Input objects.
Binary indicator matrix [n x J] for treatment groups.
Original time and event vectors.
Data frame.
Name of time variable.
Name of event indicator (1 = event, 0 = censored).
Name of treatment variable.
Numeric vector of time points. If NULL, uses all unique event times.
Output from estimate_weights().
Formula for censoring score model.
Control parameters for coxph().
Default list().
Tie handling method for Cox model. Default "efron".
Estimates counterfactual survival function for each treatment group j: $$S^{(j)}_w(t) = 1 - \frac{\sum_i w_i I(A_i=j) \delta_i I(T_i \leq t) / K_c^{(j)}(T_i, X_i)}{\sum_i w_i I(A_i=j)}$$
Censoring scores are estimated using Cox proportional hazards models fit separately within each treatment group. Variance estimation for Cox-based survival functions is performed using bootstrap only (no analytical variance available).