Skip to content
AI.info

Causal inference

Outcome Regression and Counterfactual Model Diagnostics

Design outcome regressions for causal estimation, treatment interactions, cross-fitting, calibration, and supported counterfactual prediction.

By the end you can

Example

The subgroup that rarely or never receives one of the treatments

Some subgroups in a study rarely or never receive one of the treatments. The failure has a name — positivity — and a stated mechanism. A review published in 2012 puts it in two sentences: “Positivity violations occur when certain subgroups in a sample rarely or never receive some treatments of interest. The resulting sparsity in the data may increase bias with or without an increase in variance and can threaten valid inference.”

Take the second sentence slowly, because it removes the defence most teams reach for. The sparsity may raise bias “with or without an increase in variance”. A subgroup effect can arrive with a narrow interval and a stable-looking value and still be wrong. What has gone missing is not precision. It is comparison.

Set that against the model a team is proud of. A gradient-boosted learner, trained on the whole study population, predicts observed outcomes accurately. Its test error is low enough that nobody argues with it. So they ask it the question the study existed to answer: does treatment help the rare high-risk patients? The model returns an effect for that subgroup, and the number looks exactly as reliable as every other number it has produced.

The subgroup contains twelve untreated patients. Every claim about what would have happened to a high-risk patient left alone rests on those twelve. Mostly it rests on the region past them, where the model has stopped comparing anyone to anyone and is continuing a curve it learned elsewhere. This is precisely a subgroup that rarely receives one of the treatments of interest. By the review's own account, the estimate can hold steady while the bias grows.

The validation report cannot see this. Test error averages over everybody, and everybody is mostly ordinary patients who received both treatments in workable quantities. A subgroup thin enough to break the estimate is far too small to move the average that was supposed to guard it.

What would have caught it are checks that refuse to average. Calibrate predictions against observed outcomes separately within each arm, not across the pooled data. Read residuals by slice — risk level, site, time, subgroup — instead of as a single figure. Flag counterfactual predictions that sit where propensity or neighbour density says no comparable unit lives. Then refit under different interactions, different learners and a restricted target population, and see whether the effect survives.

  • Prognostic fit is how well the model predicts the outcomes that actually happened, and it is the only thing a held-out test set can grade.
  • Effect modification is what the team thought it had found: a treatment contrast that changes as the baseline traits of the patient change.
  • Support is the positivity assumption, violated when subgroups “rarely or never receive some treatments of interest”. In the high-risk subgroup that means twelve untreated patients carrying the entire counterfactual.
  • Cross-fitting keeps the data that fits the nuisance models apart from the data that scores the target. It is the K-fold sample splitting that Chernozhukov and colleagues named and analysed in 2018.

Every patient needs two predictions and only one of them can be checked

An outcome regression is asked for the outcome under each treatment strategy, for every unit in the study. The effect is the gap between the two. One of those predictions describes something that happened and can be held against a recorded outcome. The other describes a world that was never run.

That asymmetry is the whole difficulty. Predictive validation grades the first prediction and is silent about the second. The second is where the estimate for the rare subgroup came from.

What goes into the model follows from this. It has to carry baseline prognosis — everything known about a unit before treatment that shapes the outcome. It has to let treatment interact with those baseline traits, or it has no way of expressing that treatment works differently for different people. And it must not contain anything measured after treatment. Adjust for something the treatment itself caused and the effect you are trying to measure gets absorbed into the covariate.

The choice of learner is then a choice about what you are willing to give up. A parametric model fixes the functional form in advance. That makes it readable, and makes its extrapolation an assumption the analyst stated rather than one the fit invented. A flexible learner — trees, boosting, forests, neural models — finds shapes nobody specified, and extrapolates in ways nobody specified either.

That last sentence has been measured in public. A competition at the 2016 Atlantic Causal Inference Conference, “Is Your SATT Where It's At?”, drew thirty competitors across two tracks. The black-box track alone ran 7,700 simulated realisations — 77 scenarios, 100 replications each. Every one was built on 4,802 complete-case observations with 58 covariates from the Collaborative Perinatal Project. Lack of overlap was one of the knobs the organisers turned deliberately. Dorie and Hill say what that does to a model, in their 2019 report on the competition: “This type of lack of overlap can be particularly challenging for methods that rely on models since many methods will attempt to extrapolate beyond the range of common support.”

The results split cleanly along the line this lesson is about. Methods that flexibly modelled the response surface performed best overall, so flexibility earned its place on point estimation. Interval coverage stayed broken anyway. The nine worst methods covered below 75% of the time. CBPS and h2o Ensemble bought their coverage with average interval lengths of 0.78 and 6.1. BART's own intervals averaged about 82% coverage until a TMLE augmentation lifted them to near-nominal. Winning on error and telling the truth about uncertainty were not the same achievement. No amount of the first supplied the second.

Accuracy is evidence about the half of the model that had something to be accurate against.

Analogy

Two repair estimates for every machine

A maintenance planner writes two figures against every machine on the floor: what it costs to run it to failure, and what it costs to service it early. Only one plan is chosen, so at the end of the year only one of the two columns can be checked against what actually happened.

A planner whose chosen-plan figures came out right has learned nothing about the other column. And the other column is the one that decided which plan to choose.

Machines make this look tidier than it is. A machine's physics does not select its own maintenance plan. A patient's circumstances very often select the treatment.

A comparison is only as trustworthy as the half of it nobody can score.

Visual

The route from target to support, and where it usually breaks

Read the audit as a route, with a stop at each decision, where any stop can invalidate the ones before it.

State the target first: which treatment strategies, in which population, compared how. That stop is not a matter of analytical taste, and it has a date on it. ICH's E9(R1) addendum on estimands was adopted at Step 4 on 20 November 2019, and the FDA adopted it as guidance for industry on 12 May 2021. It defines what the first stop produces: “An estimand is a precise description of the treatment effect reflecting the clinical question posed by a given clinical trial objective. It summarises at a population level what the outcomes would be in the same patients under different treatment conditions being compared.” The estimand is assembled from four attributes — treatment condition, population, variable and population-level summary. That is the map's first stop written as a checklist.

The guideline also fixes when the stop happens: “The targets of estimation are to be defined in advance of a clinical trial.” In advance. Not at analysis time, and not after a flexible learner has shown you which subgroup looks interesting.

Then choose baseline covariates, taking nothing measured after treatment. Decide how treatment is allowed to interact with those covariates, because that decision is what lets the effect vary at all. Validate the fit against observed outcomes, which establishes that the model is competent at the half of its job that can be graded.

Then audit support, and expect this last stop to be the one that hurts. It is where the twelve untreated patients would finally have shown up, long after the model had passed everything else.

FigureProcess · 5 steps
  1. 1

    Specify target

    Population, treatment contrast, outcome, and horizon.

  2. 2

    Choose baseline covariates

    Common causes and prognostic variables measured before treatment.

  3. 3

    Model interactions

    Represent plausible effect modification.

  4. 4

    Validate observed fit

    Calibration, residuals, slices, and cross-fitting.

  5. 5

    Audit support

    Flag predictions under rare treatment-covariate combinations.

Steps

Build the ladder and watch what moves

A specification ladder is one model after another, each more flexible than the last, all of them aimed at the same causal contrast: same target, same population, same baseline covariates, and no post-treatment variable on any rung.

You are not climbing it to find the rung that fits best. You are climbing it to see whether the estimated effect moves as the flexibility increases. An effect that holds steady is resting on the data. An effect that swings is resting on the functional form. The honest report says which one you have.

Somebody has built the exhaustive version of that ladder, and published what it found in 2015. For each of 417 NHANES variables tested against all-cause mortality, Patel and Ioannidis fitted 8,192 Cox models — every combination of 13 adjustment covariates. Then they read the spread of the estimates that came back. They call that spread vibration of effects. The result: “For 31% of the 417 variables, we observed a Janus effect, with the effect being in opposite direction in the 99th versus the 1st percentile of analyses.”

For nearly a third of the questions, then, the estimate did not merely swing. It reversed sign, and both signs were available to an analyst who fitted one model and reported it. Name “a Janus effect” and you are naming a result that exists in the specification space rather than in the data.

The practical reading for a hand-built ladder of four or five rungs is not that 8,192 is the target. It is that your four or five are a sample from a space that large. A single reported specification is a sample of size one from it. The range across your rungs — not the estimate on your favourite rung — is the quantity worth putting in the report.

FigureProcess · 5 steps
  1. 1

    Start simple

    Main effects and justified treatment interactions.

  2. 2

    Add flexibility

    Splines, trees, boosting, or ensembles.

  3. 3

    Cross-fit

    Separate nuisance training from target evaluation.

  4. 4

    Check arms and slices

    Calibration, residuals, and support by treatment.

  5. 5

    Compare causal estimates

    Point, interval, and influence across models.

Key idea

Tuning for prediction quietly shrinks the term that carries the effect

Regularization does not know what you are estimating. It finds a term that buys little accuracy and shrinks it, and the treatment interaction is usually exactly that term. Baseline prognosis explains most of the variation in outcomes, so a model tuned for overall prediction spends its capacity there and leaves the interaction underfit. The effect then looks flat, because flat is what the objective rewarded.

This is a named result, not a suspicion about learners. The double machine learning paper says so in its abstract — Chernozhukov and colleagues posted it in 2016 and published it in 2018: “In fact, estimates of such causal parameters obtained via naively plugging ML estimators into estimating equations for such parameters can behave very poorly due to the regularization bias.” The damage is to the rate itself; the bias blocks √n. The repair they give is structural rather than a tuning setting: a Neyman-orthogonal score, plus K-fold sample splitting, which they name cross-fitting.

Push the other way and the failure inverts. An unrestricted hunt through interactions will find heterogeneity in noise and hand back a confident subgroup effect with nothing underneath it. ISIS-2 is the demonstration nobody can argue with. It randomised 17,187 patients with suspected acute myocardial infarction. Aspirin cut 5-week vascular mortality from 11.8% to 9.4% — an odds reduction of 23%, SD 4, 2p < 0.00001 — reported in the Lancet on 13 August 1988. Peter Sleight later split that same trial by the 12 astrological birth signs. In 2000 he reported that “division into only 12 subgroups threw up two (Gemini and Libra) for which aspirin had a nonsignificantly adverse effect (9% ± 13%)”. Twelve subgroups, on a modifier that cannot possibly be one, and two of them came back pointing the wrong way. A flexible learner sweeping thousands of candidate interactions is running that search continuously, on modifiers that sound plausible enough that nobody laughs.

Neither failure is repaired by better tuning. Both are repaired the same way. Validate against the causal quantity rather than the outcome. Name the modifiers you care about before you look — the “nonsignificantly adverse effect (9% ± 13%)” for Gemini and Libra is what pre-specification exists to keep out of the abstract. Split the sample honestly, so the search and the estimate use different rows. And quote uncertainty on every heterogeneous effect you report.

An objective built around outcomes will trade away the contrast you came for, and it will never report the trade.

Outcome regression is one estimate, and it should not be the only one

There are conditions under which modelling the outcome is the right move. Prognosis is measured well. Both treatment strategies were genuinely available across the covariate range. The diagnostics hold up separately within each arm rather than only in aggregate. Under those conditions it uses what you know efficiently.

Even then, run something beside it. Weighting leans on a model of how treatment was assigned instead of a model of the outcome; doubly robust methods use both. When the estimates agree, the answer is not hostage to a single modelling choice. When they disagree, you have found where the assumptions are carrying the result, which is more useful than the agreement would have been.

And where the data is thin — where the twelve untreated patients were — no estimator rescues you. The alternative is not a better fit but a smaller question, and that move has been worked out and numbered. The optimal subsample for estimating an average treatment effect under limited overlap was derived by Crump and Imbens in 2009. Their abstract reduces it to something you can apply on a Tuesday: “For a wide range of distributions, a good approximation to the optimal rule is provided by the simple rule of thumb to discard all units with estimated propensity scores outside the range [0.1,0.9].”

The trade-off is in the title of their earlier working paper rather than in a footnote: Moving the Goalposts. To “discard all units with estimated propensity scores outside the range [0.1,0.9]” is to move them. The estimand changes. You are no longer reporting an effect for the study population; you are reporting one for the population where both strategies were actually tried. That is a real cost and it belongs in the report. But it is an honest, stated restriction, which is more than can be said for letting a flexible model manufacture a comparison nobody in the study ever supplied.

Flexibility is worth having only while the diagnostics still track the contrast; past that point it is confident invention.

Key takeaways