Learn R Programming

PSsurvival (version 0.2.0)

surv_cox: Survival Effect Estimation with Cox Censoring Scores

Description

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

Usage

surv_cox(
  data,
  time_var,
  event_var,
  treatment_var,
  eval_times = NULL,
  weight_result,
  censoring_formula,
  censoring_control = list(),
  ties = "efron"
)

Value

List containing:

survival_matrix

Matrix [time x J] of survival function estimates S^(j)(t).

eval_times

Time points evaluated.

treatment_levels

Treatment level values.

n_levels

Number of treatment levels.

weights_by_group

List of weight vectors by treatment group.

censoring_scores_by_group

List of censoring score vectors by group.

method, estimand

Weighting method and target estimand.

censoring_result, ps_result, weight_result

Input objects.

Z_matrix

Binary indicator matrix [n x J] for treatment groups.

time_vec, event_vec

Original time and event vectors.

Arguments

data

Data frame.

time_var

Name of time variable.

event_var

Name of event indicator (1 = event, 0 = censored).

treatment_var

Name of treatment variable.

eval_times

Numeric vector of time points. If NULL, uses all unique event times.

weight_result

Output from estimate_weights().

censoring_formula

Formula for censoring score model.

censoring_control

Control parameters for coxph(). Default list().

ties

Tie handling method for Cox model. Default "efron".

Details

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).