Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 050
Research workflow/3 steps

PS weighting for survival outcomes (PSsurvival)

01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 3 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 3
01
Data prep

Load package and survival data

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Load simdata_bin, which holds a binary treatment Z, covariates, and right-censored (time, event) outcomes for two arms A and B.

Reads fromNot specified Feeds into#2
Key code
# Install:  install.packages("PSsurvival")
library(PSsurvival)
data(simdata_bin)

head(simdata_bin)
table(simdata_bin$Z)

Reference / docs ↗

Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

One row per unit: covariates X, treatment Z, follow-up time, and an event/censoring indicator.

Show data format & exampleHide example
Z X1 B1 time event
A 0.31 1 12.4 1
B -0.8 0 20.0 0
A 1.05 1 6.7 1
B -0.2 0 15.3 0
03
Read the evidence

Results & interpretation

1 figure Workflow discussion 0
01FigureOverlap-weighted counterfactual survival curves for the two treatment arms.

Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.

The estimate

\Delta S(t)=S_1(t)-S_0(t),\quad \hat S_z(t)=\prod_{t_k\le t}!\Big(1-\frac{\sum_i w_i\,dN_i(t_k)}{\sum_i w_i\,Y_i(t_k)}\Big)

Context & interpretation

⚠️ Unofficial community showcase of PSsurvival (docs). Not affiliated with the authors — all credit to Fan Li & coauthors; this summarizes public documentation.

What it does. PSsurvival extends propensity-score weighting to censored time-to-event data, estimating counterfactual survival functions, survival differences, and marginal hazard ratios under binary or multiple treatments.

How it works. It combines propensity-score balancing weights (IPW, overlap/ATO, ATT, with optional symmetric trimming) with inverse-probability-of-censoring weights to handle dependent censoring. surveff() returns weighted counterfactual survival probabilities and their differences; marCoxph() fits a weighted Cox model for a marginal hazard ratio; weightedKM() produces weighted Kaplan-Meier and cumulative-incidence curves. The censoring model can be Weibull or Cox, and variances come from analytic sandwich formulas or the bootstrap. Overlap weights smoothly down-weight extreme propensity scores, reducing the variance inflation that plagues IPW survival estimators (Cheng, Li, Thomas & Li, AJE 2022).

Assumptions. Unconfoundedness, positivity (relaxed under OW), correctly specified PS and censoring models, and non-informative censoring conditional on covariates.

What you get — Weighted counterfactual survival curves and survival-difference estimates, a marginal hazard ratio, with analytic or bootstrap SEs/CIs.

Example output

Treatment groups: A, B 
Number of groups: 2 
Estimand: overlap 
Censoring method: weibull 
Variance method: analytical 
Evaluation times: 666 time points

Survival function estimates:
        A      B
[1,] 0.9979 1.0000
[2,] 0.9960 1.0000
[3,] 0.9960 0.9973

Treatment effect estimates:
     B vs A
[1,] 0.0021
[2,] 0.0040
[3,] 0.0013

Links: package · paper

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion