A researcher’s question

The patients lived longer.
Did the treatment help?

Susan sees longer survival among patients who received Treatment X. Fitter patients were more likely to receive it and might have lived longer either way.

In the Causal Roadmap preview, Susan plans a fair comparison. Here she tries a Cox model, a causal survival forest and CAST to see when a survival benefit appears and how long it lasts. The cohort is simulated, so she can check each estimate.

01 / Effects over time

Does the three-year benefit last seven years?

In the lab’s 2,000-person cohort, Susan estimates how survival would differ if everyone received Treatment X or everyone received the alternative. A difference of three percentage points means three more people alive per hundred under X. The simulation includes measured confounding and no hidden confounding.

Cox. Susan starts with a familiar Cox model. Its fitted survival curves put survival 3.1 percentage points higher under X at three years and 3.2 points higher at seven. With one fixed treatment coefficient, this model can show a changing gap but cannot show the curves crossing.

Causal survival forest (CSF). Susan estimates the difference separately at five follow-up times. The forest puts it at +18.1 points at three years and −0.1 at seven. The seven-year interval includes both benefit and harm.

CAST. Susan fits a smooth curve to the five forest estimates, accounting for their correlation. The fitted difference is +10.3 points at three years and +5.3 at seven. The curve gives her an estimate between the five time points, but it also pulls the seven-year estimate away from zero. Which estimate comes closer to the simulated truth?

Try this comparison in the lab. Switch from 36 to 84 months, then select “Reveal simulated truth.”

Can a Cox model still be useful?

Yes. A well-specified Cox model can estimate survival curves and standardized survival differences. Proportional hazards concerns the hazard ratio over time; it does not require identical absolute benefits for everyone. Interactions or time-varying coefficients extend the model. Whatever the model, a causal interpretation still needs the study design and identification assumptions.

Hernán’s discussion of hazard ratios explains why a hazard ratio also needs care as a causal summary.

Three panels. Left: survival curves for treated and control separate steadily, labelled HR = 0.5, one number, whole follow-up. Middle: log(−log S) against log time gives two parallel lines whose gap is log 0.5 at every time. Right: the survival difference the one number implies rises to about 25 points and then narrows as both groups run out of survivors.
A constant hazard ratio of 0.5 can still produce an absolute survival difference that rises and falls. This illustration is computed from a specified survival model, not estimated from the cohort.

02 / The methods

What does each tool estimate, and where can it fail?

Susan’s target is the difference in survival at a particular time. Here is what each approach contributes to that comparison.

Methods in the teaching examples
ToolWhat it returnsWhat can go wrong
Unadjusted comparisonThe observed survival gap between groups.Treatment selection can create a gap even without a treatment effect.
Cox modelHazard ratios and model-based survival curves, which can be standardized to a target population.Misspecified relationships or proportional hazards can distort the target contrast. Adjustment does not remove unmeasured confounding.
Prediction forests (RSF)Survival predictions, with treatment as an input or a separate model in each arm.Good prediction does not ensure accurate treatment-effect estimation or valid causal assumptions.
Causal survival forest (CSF)Effect estimates at specified horizons, accounting for treatment assignment and censoring under assumptions.Hidden confounding, poor overlap, sparse follow-up or poorly learned nuisance models can undermine estimates and intervals.
CASTA smooth trajectory fitted to CSF estimates across horizons, using their covariance.The trajectory model can miss the shape of the effect. A smooth, narrow band can still miss the truth.
Calipers mark gaps at several places on two paths, with a curve-fitting instrument beneath.
CSF estimates the gaps at selected horizons. CAST connects those estimates through a trajectory model.
What is specific to this implementation?

This demo fits a quadratic CAST trajectory by generalized least squares using estimated covariance across five horizon estimates. Between-horizon values depend on that model. The band is pointwise, not simultaneous, and does not fully account for approximation or model-selection uncertainty.

All examples here compare a decision made at baseline. Treatment strategies that change as health evolves need a longitudinal target and suitable methods, such as longitudinal TMLE or modified treatment policies. That is a different analysis.

Compare the prediction forests and full diagnostics or inspect the R implementation.

03 / A lab with an answer key

Could the analysis fool Susan?

These are precomputed simulated studies, so we know each scenario’s true average effect. Change one feature, predict what will happen, then reveal the truth. Each panel is one study, not a repeated-sampling validation.

Loading the simulated study…
Other comparisons to try
  1. A familiar model: choose benefit throughout follow-up and show Cox. Can a constant hazard ratio produce a changing absolute benefit?
  2. A changing effect: switch to early benefit, later reversal. Compare the early and late horizons.
  3. Treatment selection: show the unadjusted comparison, then increase measured confounding.
  4. A missing cause: increase hidden confounding. Does adjustment still recover the answer key?
Check the repeated-simulation evidence CSF intervals and CAST bands

How often did the intervals contain the truth?

Good coverage for CSF estimates at individual horizons does not guarantee good coverage for the smoothed CAST trajectory. In a separate study of 300 simulated 600-person cohorts, the nominal 95% intervals contained each cohort's true average effect at 36 months this often:

36-month coverage in the October 19 propensity comparison.
Propensity optionCSF intervalCAST pointwise band
Forest76.0%84.3%
Logistic94.3%44.3%
Super Learner93.7%47.7%

These percentages describe coverage across repeated simulated studies, not the fraction of people who benefit. This comparison uses the reversal scenario, moderate measured confounding and no hidden confounding; it is separate from the lab above, which uses the forest option with 2,000-person cohorts. Treatment assignment is logistic by construction, so the results do not establish a generally best propensity model.

CAST adds a quadratic approximation to the CSF estimates. A precise smooth fit can still miss a nonquadratic effect curve. Its band is pointwise, not simultaneous across time, and does not fully account for approximation or model-selection uncertainty.

04 / Build a fair comparison

What would happen to these same patients under the other option?

That is Susan’s causal question. Each person receives only one treatment, so their alternative outcome is unobserved. She can still ask about an average: how would survival differ if the same eligible population received X rather than the comparison treatment?

Her first obstacle is confounding. Baseline fitness affects both treatment choice and survival. She can account for recorded common causes, but a missing cause can bias every method she tries. More accurate outcome prediction alone cannot settle that problem.

One cohort imagined under two alternative treatment paths.
Compare two treatment worlds for the same population. The records show only the path each person took.

The Causal Roadmap preview follows Susan as she specifies who could receive either treatment, when follow-up starts and which factors guided treatment choice. Here, each method needs the recorded factors to account for the common causes of treatment and survival.

What would make the comparison credible?
  • Confounding: a defensible account of treatment choice, including the common causes the records miss.
  • Positivity: both options are possible for the patient groups in the question.
  • Consistency: the treatment labels correspond to the specified strategies.
  • Follow-up: conditional on the variables used, censoring carries no further information about survival, with enough chance of remaining observed to each horizon.

These are assumptions to defend and challenge. A well-fitted model does not verify them.

Thought experiment One average, different individual effects

These ten invented records illustrate the missing counterfactual at one fixed horizon, with no censoring. This thought experiment uses its own teaching data. Start with the observed records, then compare two possible completions of what is missing.

Bold teal outcomes are observed. Question marks are missing. Dotted, italic outcomes are hypothetical completions.

We observe 3 of 5 treated people alive and 2 of 5 control people alive. That observed contrast alone does not identify the causal effect. Ten alternative outcomes remain missing.

The observed outcomes and treatment assignments stay identical in both possible worlds.
PersonReceivedIf treatedIf control
01TreatmentAlive?
02TreatmentAlive?
03TreatmentAlive?
04TreatmentDied?
05TreatmentDied?
06Control?Alive
07Control?Alive
08Control?Died
09Control?Died
10Control?Died

Here “helped” means alive under treatment and dead under control at this horizon; “harmed” means the reverse. Neither completion is an estimate or a recovered truth. Other completions could also change the average. Even knowing both marginal survival probabilities would not reveal how the two outcomes pair within people.

05 / Return to Susan’s question

What can she now say?

Susan can report an estimated survival difference for a defined population, treatment contrast and horizon, with uncertainty and the assumptions it needs. She should also say which plausible failures would change the conclusion, and what information would help most.

A recovered baseline health measure could strengthen her confounding argument. It cannot create a treatment comparison where only one option was available. A more flexible curve cannot supply either missing piece.

Does the average tell her who benefits?

An effect may vary across patient profiles, and an average can hide those differences. The exported lab results are cohort averages, not clinical subgroup estimates. A subgroup analysis needs sufficient data, appropriate uncertainty and separation of discovery from evaluation. Even a credible subgroup average does not reveal an individual patient’s unobserved alternative outcome.

What is the most useful next step: a better measurement, a supported narrower question, or another study?

Explore the illustrated Causal Roadmap (v2) ↗

For causal educators.

Teach the story with runnable R code, synthetic data, a study guide and draft slides. Both documents include editable LaTeX sources and ready-to-use PDFs.

Sources and technical reading

Sources

  1. Dang & Balzer · Start with the Target Trial Protocol, Then Follow the Roadmap for Causal InferenceEpidemiology. 2023;34(5):619–623. The design-to-interpretation framework used here.
  2. Yang et al. · CASTTime-varying treatment effects; the methods preprint.
  3. Cui et al. · Causal survival forestsHeterogeneous effects with right-censored outcomes.
  4. Hernán · The hazards of hazard ratiosWhy a single hazard ratio can mislead when effects change over time.
  5. Grambsch & Therneau · Proportional hazards tests and diagnosticsScaled Schoenfeld residuals as a check on proportional hazards.
  6. Hernán & Robins · Causal Inference: What IfIndividual and average causal effects, identification, and generalization.
  7. Igor Shuryak · CAST repository and R sourceSimulation code, methods and MIT license.