Causal inference §
Causal inference is the task of determining the effect of an intervention or treatment on an outcome. Unlike associational inference (estimation, regression), it asks: what would happen if we did something? It targets interventional and counterfactual quantities that are not identifiable from observational data alone without additional assumptions. It is central to clinical trials, policy evaluation, and machine learning.
This page is organized around Pearl’s ladder of causation (see The ladder of causation): rung 1 handles association (what observing tells us), rung 2 handles intervention (what doing causes), rung 3 handles counterfactuals (what would have happened otherwise). Each section below climbs one rung or provides the tools to climb.
Authoritative sources
Structural causal models §
A structural causal model (SCM) is a directed acyclic graph (DAG) with a structural equation for each node:
where are the parents of in the graph and are exogenous (unobserved) noise variables.
Details
The DAG encodes causal assumptions: an edge means is a direct cause of . The model generates a joint distribution that is Markov with respect to the graph: each variable is independent of its non-descendants given its parents.
Example. A simple SCM for a drug trial:
Here, Age is a confounder: it affects both the treatment assignment and the outcome. The associational effect of Drug on Recovery is confounded by Age.
The SCM framework makes explicit the distinction between associational quantities (read off the observed distribution) and interventional quantities (require modifying the model). This is the key insight that separates causal inference from Estimation and Hypothesis testing.
The do-operator §
The do-operator represents an intervention: setting to by external force, breaking its incoming edges. The interventional distribution is
Details
The do-operator modifies the SCM: the structural equation for is replaced by (a constant), and all incoming edges to are removed. The resulting distribution is the interventional distribution.
Key distinction:
- (associational): the distribution of among units that happen to have .
- (interventional): the distribution of if we force .
These are equal if and only if there is no confounding (i.e., is independent of the potential outcomes). In general, .
Example. In the drug trial SCM, is confounded by Age (older patients are more likely to receive the drug and less likely to recover). But gives the true causal effect, free of confounding.
The ladder of causation §
Pearl and Mackenzie organize all causal reasoning into three rungs, each answering a question that the previous rung cannot:
| Rung | Activity | Typical question | Typical quantity |
|---|---|---|---|
| 1. Association | Seeing | What does observing X tell me about Y? | P(Y | X = x) |
| 2. Intervention | Doing | What happens to Y if I make X = x? | P(Y | do(X = x)) |
| 3. Counterfactuals | Imagining | What would have happened had X been different? | P(Yx' | X = x, Y = y) |
Each rung strictly subsumes the ones below it: a model rich enough for counterfactuals answers interventional and associational questions, but an associational model alone cannot answer interventional questions. The sections of this page climb the ladder: structural causal models and the do-operator set up the language; identifiability and do-calculus, potential outcomes, and instrumental variables all work at rung 2; counterfactuals work at rung 3. Note that rung 1 is the domain of ordinary statistics — see Estimation and Conditional probability.
Details
The ladder explains why causal inference needs extra assumptions: the observed distribution is a rung-1 object, and the map from rung-1 objects to rung-2 or rung-3 objects is not unique without causal assumptions. Two different SCMs can induce the same observational distribution but different interventional distributions; only the causal structure (the arrows) breaks the tie. This is why identifying from data requires either an experiment (which intervenes directly) or untestable structural assumptions (which the graphical criteria below encode).
Example. Observing that barometer readings predict rain (rung 1) does not tell you whether twisting the dial will cause rain (rung 2). The DAG and explains both: the association is real, but there is no causal path from the barometer to the rain.
Identifiability and do-calculus §
An interventional quantity is identifiable if it can be expressed as a function of the observed (associational) distribution . Pearl’s do-calculus provides three rules for transforming interventional queries into associational ones. Write for the graph obtained from by deleting all arrows pointing into , for deleting all arrows pointing out of , and for both. The rules, for disjoint sets :
- Insertion/deletion of observations: if and are d-separated by in (arrows into removed).
- Action/observation exchange: if and are d-separated by in (arrows into removed and arrows out of removed).
- Insertion/deletion of actions: if and are d-separated by in (arrows into removed, and arrows into removed except those into nodes that are ancestors of in ).
Rule 1 says an observation can be dropped when it carries no extra information; rule 2 says an intervention can be replaced by a mere observation when the intervention is irrelevant; rule 3 says an intervention can be dropped when it is redundant. The calculus is complete (Huang & Valtorta 2006; Shpitser & Pearl 2006): every identifiable interventional quantity can be derived with these three rules.
The back-door criterion §
The most used graphical criterion is the back-door criterion: a set satisfies the back-door criterion relative to if it blocks all back-door paths from to (paths ending with an arrow into ) and contains no descendant of . Then
This is the adjustment formula: it says that conditioning on the right set of covariates (confounders) removes confounding bias.
The front-door criterion §
When unobserved confounders block every admissible adjustment set, the front-door criterion can still identify the effect. If there is a mediator such that (i) is the only path from to (no unblocked back-door path from to ), (ii) all back-door paths from to are blocked by , and (iii) all paths are blocked by , then the causal effect is identifiable via the front-door formula:
Details
Why the front-door works. The effect of on is identifiable by the back-door criterion with (condition (i) rules out confounding of –). The effect of on is identifiable by adjusting for (condition (ii)). Condition (iii) ensures the effect of on is fully transmitted through , so the two identifiable pieces compose into the front-door formula. The derivation is a short chain of do-calculus rules — this is exactly what the calculus is for.
Example. Smoking (), tar deposits in the lungs (), and cancer (), with an unobserved confounder (e.g., a genetic predisposition) affecting both smoking and cancer. No set of observed variables blocks the back-door path . But tar deposits mediate the effect, and the front-door formula recovers the effect of smoking on cancer from observational data alone.
The back-door and front-door criteria are the two workhorse graphical identification results; the do-calculus is the general machine that generates them (and many others, such as instrumental-variable-type identifications).
Potential outcomes framework §
The potential outcomes (Rubin) framework represents causality at the level of individual units. For a binary treatment and outcome , each unit has two potential outcomes:
The individual causal effect is , but only one of the two is ever observed (the fundamental problem of causal inference). The average treatment effect (ATE) is
Details
The two main frameworks for causal inference are:
| Framework | Key objects | Identifiability condition |
|---|---|---|
| Structural (Pearl) | DAG + structural equations | do-calculus / back-door / front-door |
| Potential outcomes (Rubin) | Yi(0), Yi(1) per unit | Unconfoundedness / ignorability |
In the potential outcomes framework, the key assumption is unconfoundedness (also called ignorability or selection on observables):
i.e., potential outcomes are independent of treatment assignment. Unconfoundedness with no covariates corresponds exactly to the back-door criterion with the empty set (no confounders). Its conditional version, for observed covariates , corresponds exactly to the back-door criterion with adjustment set .
The two frameworks are mathematically equivalent: any SCM induces a set of potential outcomes, and any set of potential outcomes satisfying consistency and unconfoundedness can be represented by an SCM.
Connection to the do-operator. In the potential outcomes framework, and . The ATE is the difference of interventional means.
SUTVA §
Both frameworks rest on the Stable Unit Treatment Value Assumption (SUTVA), which has two components:
- No interference: the potential outcome of unit does not depend on the treatment assigned to any other unit . Formally, is a function of unit ’s own treatment alone. This fails with spillover effects, e.g., vaccination (herd immunity), or when units compete for a shared resource.
- Consistency: the observed outcome for a unit under treatment equals the potential outcome for that treatment: whenever . This requires the treatment to be well-defined — “the drug” must mean one thing, not a family of doses and regimens.
Under SUTVA, the observed data are simply the potential outcomes with one of the two masked per unit, which is what makes the identification results above applicable.
Details
as functions of the full assignment vector .
Example. In a vaccine trial, if vaccinated individuals reduce transmission, unvaccinated individuals in the same villages are partially protected too. Estimating the direct effect requires care (e.g., cluster randomization); the total effect includes these spillovers and violates the plain SUTVA setup.
Why consistency matters. Consistency links the observational data to the potential-outcome notation: without it, “treated” in the data may not correspond to any single well-defined intervention, and cannot be connected to . This is a practical concern when treatments are heterogeneous (e.g., “smoking” covers many intensities).
Instrumental variables §
An instrumental variable for the effect of on satisfies:
- Relevance: is associated with (i.e., for some ).
- Exclusion: affects only through (no direct effect).
- Independence: is independent of unobserved confounders of and .
Details
When a valid instrument exists, the causal effect can be estimated by the Wald estimator (ratio of two differences):
Example. In a drug trial, suppose a doctor’s prescribing habit (a binary variable) affects whether a patient receives the drug, but the habit itself does not affect recovery except through the drug. The doctor’s habit is an instrument. The Wald estimator gives the causal effect of the drug on recovery, even though unobserved patient severity confounds the drug–recovery association.
The IV structure ( with no edge and no confounding on ) is a distinct graphical pattern from the front-door criterion ( with an unconfounded mediator). Both are identifiable via the do-calculus, but they correspond to different graphical configurations and different identifying formulas. Note that the Wald estimator identifies the local average treatment effect (LATE): the effect for the compliers whose treatment was actually changed by the instrument, not for the whole population.
Counterfactuals §
A counterfactual asks: what would have happened to this specific unit under a different intervention? Formally, for a unit with observed , the counterfactual is
This is the top rung of the ladder of causation: it combines observation (the evidence ) with intervention (setting to ).
Details
Counterfactuals are the most specific level of causal reasoning. They require the full SCM, not just the graph: two SCMs with the same graph can induce different counterfactuals.
Example. A patient took a drug () and recovered (). The counterfactual question is: would this patient have recovered without the drug ()? The answer requires the structural equations and the unit’s exogenous variables.
Counterfactuals are computed from the SCM by abduction–action–prediction:
- Abduction: use the evidence to infer the posterior over the exogenous variables for this unit.
- Action: modify the SCM, replacing the equation for by .
- Prediction: propagate the inferred through the modified equations to obtain .
The resulting quantity mixes levels: it conditions on observations (rung 1) but answers a counterfactual question (rung 3). This is why it cannot in general be written as a function of alone — the structural equations, not just the graph, are needed.
Practical estimation methods §
When the identifying assumptions hold, several methods estimate causal effects from observational data. Each is the applied counterpart of one theoretical identification result:
| Method | Theoretical counterpart | Key identifying assumption | Estimator |
|---|---|---|---|
| Propensity score methods | Back-door criterion / conditional unconfoundedness | (Y(0), Y(1)) ⊥⊥ X | Z, SUTVA | Weight or match on e(Z) = P(X = 1 | Z = z) |
| Difference-in-differences | Potential outcomes with time-varying treatment | Parallel trends | Double difference of means over time and group |
| Regression discontinuity | Local randomization at a cutoff | Continuity of potential-outcome functions at the cutoff | Discontinuity of E[Y | X] at the cutoff |
| Instrumental variables | IV graph (Z → X → Y, no Z → Y) | Relevance, exclusion, independence | Wald estimator / 2SLS |
- Propensity score methods: estimate the propensity score and use it to balance the sample (matching, weighting, or subclassification). The score is a balancing score: given it, treatment is independent of the covariates, so adjusting for the one-dimensional suffices to adjust for the whole .
- Difference-in-differences: with a treated and a control group observed before and after treatment, the estimator is
valid when, absent treatment, both groups would have followed parallel trends.
- Regression discontinuity: when treatment is assigned by a threshold rule on a running variable , units near the cutoff are comparable, and
identifies the local effect at the cutoff: manipulation of near aside, assignment is as if randomized in a narrow window.
Details
Why the propensity score suffices. By Rosenbaum and Rubin (1983), is a balancing score: . Hence, under conditional unconfoundedness , adjusting for the scalar removes all confounding — this is the back-door adjustment with the score replacing the full covariate vector. In practice one estimates (e.g., by logistic regression) and either matches treated to control units with similar scores, or weights units by (treated) and (controls) to build a pseudo-population with no confounding.
Why parallel trends is a causal assumption. The DiD estimator cancels the pre/post trend common to both groups. It is identified only if the counterfactual trend of the treated group equals the observed trend of the control group — an untestable claim about rung 2 of the ladder, not a statistical association. It is the time-varying analogue of unconfoundedness: time-invariant unobserved confounders are allowed, but their effect must evolve identically in both groups.
Why RD is “local randomization”. Units cannot precisely manipulate the running variable at the cutoff, so just above and just below the populations are comparable in expectation: the discontinuity in at is the causal effect at the cutoff (a local average treatment effect). The price is external validity: the estimate says nothing about units far from .
Each method also requires SUTVA (see SUTVA) and correct functional-form assumptions; violations of any of these produce biased estimates even when the underlying identification argument is valid.
Causal discovery §
Throughout this page, the DAG is assumed known (from domain knowledge). Causal discovery is the subfield that instead tries to learn the structure of from observational data. In general, the observational distribution only identifies up to its Markov equivalence class (the set of DAGs entailing the same conditional independencies), so additional assumptions are needed: e.g., the PC and GES algorithms work under faithfulness (all conditional independencies in the distribution come from the graph), while LiNGAM identifies the full DAG by assuming linear relations with non-Gaussian noise. Discovery is an active research area; the practical workflow is usually to use discovery to generate candidate graphs, then to validate and refine them with domain knowledge before applying the identification results above.
Causal inference and machine learning §
Modern machine learning enters causal inference on both ends: as a flexible estimator for the nuisance functions that identification results leave free (the propensity score , the outcome regressions ), and as a consumer of causal reasoning (predictive models trained on observational data answer rung-1 questions and break under interventions or distribution shift).
Details
Key causal ML methods:
- Double/debiased machine learning (DML): use any ML method to fit the nuisance functions and , then average the residuals:
Cross-fitting (fitting the nuisances on one fold, evaluating on another) plus the Neyman orthogonality of the score make the estimator root-n consistent even when the nuisances are learned at slower rates. This is the potential-outcomes/back-door machinery with ML plug-ins.
- Causal forests (Wager & Athey): random forests modified so that estimates of the conditional average treatment effect are asymptotically normal and honest (estimation and splitting use separate samples).
- Meta-learners for heterogeneous effects with binary treatment: the S-learner fits one model and reads off as the difference of predictions at and ; the T-learner fits separate models per arm and takes their difference; the X-learner imputes each unit’s missing potential outcome, models the imputed effects per arm, and combines them weighted by the propensity score — often best when one arm is much larger than the other.
All of these assume an identification result already holds (typically conditional unconfoundedness given , i.e., the back-door criterion); the machine learning only makes the estimation flexible, not the identification.
Example problem §
Problem. In a city, ice cream sales () and drowning deaths () are positively correlated. A third variable, temperature (), causes both: , . (a) Is the associational correlation between and a causal effect? (b) Using the back-door criterion, show that conditioning on identifies the causal effect of on . (c) What is the causal effect if the structural equations are and (with independent of )?
Solution
(a) No. The correlation between and is spurious: both are caused by . There is no causal path from to in the graph , . The causal effect of on is zero.
(b) The back-door paths from to are: . The set blocks this path (it is a common cause, not a descendant of ). By the back-door criterion:
Since (no direct edge ), this simplifies to integrated over , which does not depend on . Hence the causal effect is zero.
(c) From the structural equations, does not contain . Setting (do-operator) changes the equation for but not for . Therefore regardless of . The causal effect is , confirming part (a).
Quiz
Question 1. In the graph with an additional edge , is a valid instrument for the effect of on ? Which assumption fails?
Question 2. A study measures the effect of a minimum-wage increase by comparing employment just above and just below the wage threshold. Which estimation method is this, and what is its key identifying assumption?
Question 3. At which rung of the ladder of causation is the quantity ? Why can it not be computed from the observational distribution alone, even with the DAG known?
How to solve
Question 1. No. The exclusion restriction fails: has a direct edge to , so affects through paths other than . The Wald estimator would then mix the direct effect of into the estimated effect of . In the IV graph, must affect only through .
Question 2. Regression discontinuity. Treatment is assigned by a threshold rule on a running variable (wage level relative to the threshold). The key assumption is continuity of the potential-outcome functions at the cutoff — equivalently, that units just above and below the threshold are comparable (local randomization), so the discontinuity in at the cutoff identifies the local causal effect.
Question 3. Rung 3 (counterfactuals). It conditions on observed evidence () and asks about a different intervention (). The observational distribution is a rung-1 object: many different SCMs — with the same DAG and the same but different structural equations — induce different values of . Computing it requires the full structural equations (via abduction–action–prediction), not just the graph.
Causal inference is the task of determining the effect of an intervention or treatment on an outcome. Unlike associational inference (estimation, regression), it asks: what would happen if we did something? It targets interventional and counterfactual quantities that are not identifiable from observational data alone without additional assumptions. It is central to clinical trials, policy evaluation, and machine learning.
Authoritative sources
Structural causal models §
A structural causal model (SCM) is a directed acyclic graph (DAG) with a structural equation for each node:
where are the parents of in the graph and are exogenous (unobserved) noise variables.
Details
The DAG encodes causal assumptions: an edge means is a direct cause of . The model generates a joint distribution that is Markov with respect to the graph: each variable is independent of its non-descendants given its parents.
Example. A simple SCM for a drug trial:
Here, Age is a confounder: it affects both the treatment assignment and the outcome. The associational effect of Drug on Recovery is confounded by Age.
The SCM framework makes explicit the distinction between associational quantities (read off the observed distribution) and interventional quantities (require modifying the model). This is the key insight that separates causal inference from Estimation and Hypothesis testing.
The do-operator §
The do-operator represents an intervention: setting to by external force, breaking its incoming edges. The interventional distribution is
Details
The do-operator modifies the SCM: the structural equation for is replaced by (a constant), and all incoming edges to are removed. The resulting distribution is the interventional distribution.
Key distinction:
- (associational): the distribution of among units that happen to have .
- (interventional): the distribution of if we force .
These are equal if and only if there is no confounding (i.e., is independent of the potential outcomes). In general, .
Example. In the drug trial SCM, is confounded by Age (older patients are more likely to receive the drug and less likely to recover). But gives the true causal effect, free of confounding.
Identifiability and do-calculus §
An interventional quantity is identifiable if it can be expressed as a function of the observed (associational) distribution . Pearl’s do-calculus provides three rules for transforming interventional queries into associational ones:
- Insertion/deletion of observation: if is independent of in the graph with all incoming edges to removed, then .
- Action/observation exchange: if is independent of in the graph with incoming edges to removed and set to a constant, then .
- Insertion/deletion of action: if is independent of in the graph with all incoming edges to both and removed, then .
The key graphical criterion is the back-door criterion: a set satisfies the back-door criterion relative to if it blocks all back-door paths from to and contains no descendants of . Then
Details
The do-calculus is a complete decision procedure: if an interventional quantity is identifiable, the do-calculus can derive its expression in terms of observed quantities.
- Front-door criterion: if there is a confounded path but a mediator such that is unconfounded, then the causal effect is identifiable via the front-door formula:
The back-door criterion is the most commonly used: it says that conditioning on the right set of covariates (confounders) removes confounding bias.
Potential outcomes framework §
The potential outcomes (Rubin) framework represents causality at the level of individual units. For a binary treatment and outcome , each unit has two potential outcomes:
The individual causal effect is , but only one of the two is ever observed (the fundamental problem of causal inference). The average treatment effect (ATE) is
Details
The two main frameworks for causal inference are:
| Framework | Key objects | Identifiability condition |
|---|---|---|
| Structural (Pearl) | DAG + structural equations | do-calculus / back-door / front-door |
| Potential outcomes (Rubin) | Yi(0), Yi(1) per unit | Unconfoundedness / ignorability |
In the potential outcomes framework, the key assumption is unconfoundedness (also called ignorability or selection on observables):
i.e., potential outcomes are independent of treatment assignment. This is equivalent to the back-door criterion in the SCM framework when the DAG has a single confounder.
The two frameworks are mathematically equivalent: any SCM induces a set of potential outcomes, and any set of potential outcomes satisfying consistency and unconfoundedness can be represented by an SCM.
Connection to the do-operator. In the potential outcomes framework, and . The ATE is the difference of interventional means.
Instrumental variables §
An instrumental variable for the effect of on satisfies:
- Relevance: is associated with (i.e., for some ).
- Exclusion: affects only through (no direct effect).
- Independence: is independent of unobserved confounders of and .
Details
When a valid instrument exists, the causal effect can be estimated by the Wald estimator (ratio of two differences):
Example. In a drug trial, suppose a doctor’s prescribing habit (a binary variable) affects whether a patient receives the drug, but the habit itself does not affect recovery except through the drug. The doctor’s habit is an instrument. The Wald estimator gives the causal effect of the drug on recovery, even though unobserved patient severity confounds the drug–recovery association.
The IV structure ( with no edge and no confounding on ) is a distinct graphical pattern from the front-door criterion ( with an unconfounded mediator). Both are identifiable via the do-calculus, but they correspond to different graphical configurations and different identifying formulas.
Counterfactuals §
A counterfactual asks: what would have happened to this specific unit under a different intervention? Formally, for a unit with observed , the counterfactual is
Details
Counterfactuals are the most specific level of causal reasoning (Pearl’s “ladder of causation”: association → intervention → counterfactual). They require the full SCM, not just the graph.
Example. A patient took a drug () and recovered (). The counterfactual question is: would this patient have recovered without the drug ()? The answer requires the structural equations and the unit’s exogenous variables.
Counterfactuals are identifiable from the SCM: can be computed by “abduction–action–prediction” (infer the exogenous variables from the evidence, apply the intervention, predict the outcome).
Practical estimation methods §
When the identifying assumptions hold, several methods estimate causal effects from observational data:
- Propensity score matching: estimate (the propensity score), match treated and control units with similar scores, and compare outcomes.
- Difference-in-differences: compare the change in outcomes over time between a treated group and a control group, assuming parallel trends.
- Regression discontinuity: exploit a known threshold (cutoff) that determines treatment assignment; compare outcomes just above and below the cutoff.
Details
These methods are the applied counterparts of the theoretical frameworks above:
- Propensity score matching operationalizes the back-door criterion: the propensity score is a balancing score that, when conditioned on, makes treatment independent of the covariates.
- Difference-in-differences is a special case of the potential outcomes framework with a time-varying treatment: the “parallel trends” assumption is a dynamic version of unconfoundedness.
- Regression discontinuity exploits a local randomization: near the cutoff, treatment assignment is approximately random, so the local average treatment effect is identified without further assumptions.
Each method requires its own set of assumptions (no interference, SUTVA, correct functional form, etc.) that go beyond the basic causal model.
Example problem §
Problem. In a city, ice cream sales () and drowning deaths () are positively correlated. A third variable, temperature (), causes both: , . (a) Is the associational correlation between and a causal effect? (b) Using the back-door criterion, show that conditioning on identifies the causal effect of on . (c) What is the causal effect if the structural equations are and (with independent of )?
Solution
(a) No. The correlation between and is spurious: both are caused by . There is no causal path from to in the graph , . The causal effect of on is zero.
(b) The back-door paths from to are: . The set blocks this path (it is a common cause, not a descendant of ). By the back-door criterion:
Since (no direct edge ), this simplifies to integrated over , which does not depend on . Hence the causal effect is zero.
(c) From the structural equations, does not contain . Setting (do-operator) changes the equation for but not for . Therefore regardless of . The causal effect is , confirming part (a).