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

Confounder-adjusted survival curves for a treatment (adjustedCurves)

Source adjustedCurves — Robin Denz
01
The method workspace

Follow the analysis.

Select a node to explore the method

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

Time-to-event, treatment, confounders

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

What happens here

Set up the censored outcome, the treatment, and the confounders of treatment assignment.

Formula
T=\min(T^{*},C),\qquad \delta=\mathbb 1\{T^{*}\le C\}
Reads fromNot specified Feeds intoNot specified
Key code
# time (T), status (event 1/0), group (treatment), x1,x2 (confounders)

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

Right-censored time-to-event data: an event time, an event/censoring indicator, a treatment, and the confounders.

Show data format & exampleHide example

Format — one row per unit: time, status (1=event, 0=censored), group (treatment), confounders x*.

library(adjustedCurves)
adj <- adjustedsurv(data=df, variable='group', ev_time='time',
                    event='status', method='iptw_km',
                    treatment_model=glm(group ~ x1 + x2, family='binomial'))
plot(adj)
03
Read the evidence

Results & interpretation

2 figures Workflow discussion 2
01FigureConfounder-adjusted survival curves for treated (1) vs control (0), with 95% confidence bands — the adjusted gap is the causal effect on survival, not a raw Kaplan-Meier.
02FigureA scenario where, once confounders are accounted for, the two groups' adjusted curves nearly coincide — no survival benefit after de-confounding.

Figures reproduced from adjustedCurves — Robin Denz — unofficial community showcase; all credit to the original authors.

Context & interpretation

⚠️ Unofficial community showcase of adjustedcurves. Not affiliated with the authors; all credit to them.

Compare survival between treatment groups after removing confounding — via IPTW, the g-formula or AIPW — instead of a raw Kaplan-Meier that quietly bakes in selection.

Peer notes

Discuss the workflow (2)

  • 2

    Raw Kaplan-Meier between treatment groups in an observational study is the mistake I see most. IPTW-adjusted curves should be the default.

  • 0

    Reporting the RMST difference alongside the curves is the part clinicians actually act on. Good to see it as its own step.

    1

    Yes — survival-at-t plus RMST difference communicates far better than a hazard ratio nobody can interpret.

IN THE MARGINS

Peer discussion