Foundations to Frontier
Tests
A. Mathematical Foundations › A5 Statistics › Causal inference

The Potential Outcomes Framework

A causal effect compares what happens to the same unit under two different actions. Only one of them ever happens, so causal inference is a missing-data problem. You will define potential outcomes, individual and average effects (ATE, ATT), the assumptions (consistency, SUTVA, ignorability, positivity) that make them estimable, decompose the naive comparison into effect plus selection bias, and analyse randomized trials with Neyman's variance, Fisher's exact test and regression adjustment.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Two futures, one life

Did the new wheel design make the rover faster? To be sure, you’d need to drive the same rover on the same day over the same ground, once with the new wheels and once with the old ones. You can only do one. The other is a “what if” that never happened.

Each unit has two potential outcomes: one with the treatment and one without. We only see one of them. That’s the fundamental problem of causal inference. The way out is to compare groups that are alike except for the treatment, and flipping a coin to decide who gets it is the most reliable way to make them alike.

Two possible futures per unit, but you only see one
unit 1 Cunit 2 Tunit 3 Cunit 4 Tunit 5 Cunit 6 Cunit 7 Tunit 8 Cunit 9 Tunit 10 Cunit 11 Cunit 12 Tunit 13 Cunit 14 Tunit 15 Tunit 16 T
true ATE 3.52 · this assignment's naive difference 2.75 · average over 600 assignments 3.48 (bias -0.05)
true ATE
Green: Y(0), outcome without treatment. Orange: Y(1), with treatment. Filled = observed, faded/dashed = the counterfactual we never see. Under coin-flip assignment the naive difference is unbiased (the histogram centres on the true ATE). Under self-selection, units that would have done well anyway are the ones treated, so the naive difference adds a selection bias E[Y(0)|T=1] − E[Y(0)|T=0].
Why engineers care

Every A/B test of a planner, every flight trial of a new controller and every fleet rollout of a firmware update is a potential-outcomes comparison. Defining exactly which effect you want, and what makes your comparison fair, prevents expensive false conclusions.

📝 Quick check (Level 0)
0/3 answered
  1. 1. For one unit, how many potential outcomes do we observe?
  2. 2. The unseen outcome is called…
  3. 3. Random assignment makes the groups…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Notation (Neyman, 1923; Rubin, 1974)

For unit ii with binary treatment TiT_i:

  • Potential outcomes Yi(1),Yi(0)Y_i(1), Y_i(0). Individual effect τi=Yi(1)−Yi(0)\tau_i = Y_i(1) - Y_i(0), which is never observed.
  • Consistency: Yi=TiYi(1)+(1−Ti)Yi(0)Y_i = T_iY_i(1) + (1 - T_i)Y_i(0).
  • Estimands: ATE=E[Y(1)−Y(0)]\text{ATE} = \mathbb E[Y(1) - Y(0)]. ATT=E[Y(1)−Y(0)∣T=1]\text{ATT} = \mathbb E[Y(1) - Y(0)\mid T = 1] is the effect on those who got it. ATC is the same for the controls.

SUTVA

The Stable Unit Treatment Value Assumption has two parts. There is only one version of each treatment, and there is no interference: my outcome doesn’t depend on your treatment. Interference is common in multi-robot systems, networks and markets; one robot’s new route changes traffic for the others.

📝 Quick check (Level 1)
0/3 answered
  1. 1. ATT is the average effect among…
  2. 2. No interference means…
  3. 3. Y = T·Y(1) + (1 − T)·Y(0) is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Naive comparison = effect + selection bias

E[Y∣T=1]−E[Y∣T=0]⏟naive=E[Y(1)−Y(0)∣T=1]⏟ATT+E[Y(0)∣T=1]−E[Y(0)∣T=0]⏟selection bias\underbrace{\mathbb E[Y\mid T{=}1] - \mathbb E[Y\mid T{=}0]}_{\text{naive}} = \underbrace{\mathbb E[Y(1) - Y(0)\mid T{=}1]}_{\text{ATT}} + \underbrace{\mathbb E[Y(0)\mid T{=}1] - \mathbb E[Y(0)\mid T{=}0]}_{\text{selection bias}}

If skilled operators opt in to a new autonomy mode, they would have scored higher anyway. Selection bias is positive, and the upgrade looks better than it is.

Identification assumptions

  • Ignorability (unconfoundedness): (Y(0),Y(1))⊥T∣X(Y(0), Y(1))\perp T\mid X. Treatment is as good as random given covariates XX.
  • Positivity (overlap): 0<P(T=1∣X)<10 < P(T = 1\mid X) < 1.

Under these, ATE=EX[E[Y∣T=1,X]−E[Y∣T=0,X]]\text{ATE} = \mathbb E_X\big[\mathbb E[Y\mid T{=}1, X] - \mathbb E[Y\mid T{=}0, X]\big], the adjustment formula of A5.3-1. Randomization guarantees ignorability with no XX at all: (Y(0),Y(1))⊥T(Y(0), Y(1))\perp T.

🐍 Exercise 1: selection bias, ATE, ATT and ATC
Simulate potential outcomes where skilled operators opt in and benefit less. Verify that naive = ATT + selection bias exactly, that ATT < ATE < ATC, and that randomization removes the bias.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Naive difference − ATT =
  2. 2. Ignorability says potential outcomes are independent of T…
  3. 3. Positivity fails if…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Deriving the decomposition

Add and subtract E[Y(0)∣T=1]\mathbb E[Y(0)\mid T = 1]. By consistency, E[Y∣T=1]=E[Y(1)∣T=1]\mathbb E[Y\mid T{=}1] = \mathbb E[Y(1)\mid T{=}1] and E[Y∣T=0]=E[Y(0)∣T=0]\mathbb E[Y\mid T{=}0] = \mathbb E[Y(0)\mid T{=}0]. ∎ Under randomization, E[Y(0)∣T=1]=E[Y(0)∣T=0]\mathbb E[Y(0)\mid T{=}1] = \mathbb E[Y(0)\mid T{=}0] and ATT=ATE\text{ATT} = \text{ATE}.

Design-based inference for randomized trials

Treat the nn units and their potential outcomes as fixed. The only randomness is which n1n_1 are treated.

  • Neyman (1923): τ^=Yˉ1−Yˉ0\hat\tau = \bar Y_1 - \bar Y_0 is unbiased for the sample ATE, with
Var⁡(τ^)=S12n1+S02n0−Sτ2n\operatorname{Var}(\hat\tau) = \frac{S_1^2}{n_1} + \frac{S_0^2}{n_0} - \frac{S_\tau^2}{n}

Sτ2S_\tau^2 (the variance of individual effects) is unidentifiable, so dropping it gives a conservative variance.

  • Fisher’s exact test: under the sharp null Yi(1)=Yi(0)Y_i(1) = Y_i(0) for all ii, every outcome is known, so re-randomizing gives the exact null distribution of any statistic.
  • Regression adjustment (Lin, 2013): regress YY on TT, centred XX and T×XT\times X. It’s consistent and never less precise asymptotically.
Exercise 3.1: Why is Neyman’s variance conservative?

The true variance subtracts Sτ2/n≥0S_\tau^2/n\ge0. Omitting it overestimates the variance unless effects are constant (Sτ2=0S_\tau^2 = 0). The CI covers at least the nominal rate.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Neyman's variance estimate is…
  2. 2. Fisher's sharp null states…
  3. 3. Under randomization, ATT equals…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Field trials of a terrain classifier

Forty test traverses: randomly pick 20 to run the new terrain classifier and 20 the old one. Treat the 40 traverses as the population of interest. The Neyman interval covers the sample ATE at least 95% of the time over re-randomizations, and the Fisher test gives an exact p-value with no distributional assumptions. Both are ideal when the number of trials is small and expensive.

🐍 Exercise 2 (research): design-based analysis of a small trial
For a fixed population of 40 traverses, implement Neyman's conservative CI and Fisher's randomization test. Check coverage over 1000 re-randomizations and the test's behaviour with and without an effect.

Potential outcomes in AI, robotics and aerospace

  • Off-policy evaluation in RL and bandits: each logged context has a potential reward for every action; only the taken one is seen (Dudík, Langford and Li, 2011).
  • Heterogeneous effects / uplift: causal forests estimate τ(x)\tau(x) to target interventions (Wager and Athey, 2018), for example which robots benefit from a recalibration.
  • Interference: multi-agent and networked systems violate SUTVA. Cluster-randomized or switchback designs are used (Hudgens and Halloran, 2008).
  • Counterfactual explanations for ML models ask for the smallest input change that flips a decision (Wachter, Mittelstadt and Russell, 2018).

References

  1. J. Neyman (1923/1990). “On the application of probability theory to agricultural experiments.” Translated in Statistical Science, 5(4).
  2. D. Rubin (1974). “Estimating causal effects of treatments in randomized and nonrandomized studies.” Journal of Educational Psychology, 66(5).
  3. P. Holland (1986). “Statistics and causal inference.” JASA, 81(396).
  4. G. Imbens, D. Rubin (2015). Causal Inference for Statistics, Social, and Biomedical Sciences. Cambridge University Press.
  5. R. A. Fisher (1935). The Design of Experiments. Oliver & Boyd.
  6. W. Lin (2013). “Agnostic notes on regression adjustments to experimental data.” Annals of Applied Statistics, 7(1).
  7. S. Wager, S. Athey (2018). “Estimation and inference of heterogeneous treatment effects using random forests.” JASA, 113(523).
  8. M. Hudgens, M. E. Halloran (2008). “Toward causal inference with interference.” JASA, 103(482).
  9. M. Dudík, J. Langford, L. Li (2011). “Doubly robust policy evaluation and learning.” ICML.
  10. S. Wachter, B. Mittelstadt, C. Russell (2018). “Counterfactual explanations without opening the black box.” Harvard Journal of Law & Technology, 31(2).