Technopedia

The technologist’s encyclopedia

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) G=(V,E)G = (V, E) with a structural equation for each node:

Xi=fi(Pa(Xi),Ui)X_i = f_i(\text{Pa}(X_i), U_i)

where Pa(Xi)\text{Pa}(X_i) are the parents of XiX_i in the graph and UiU_i are exogenous (unobserved) noise variables.

U X Y confounds confounds
Details

The DAG encodes causal assumptions: an edge X→YX \to Y means XX is a direct cause of YY. The model generates a joint distribution P(X1,…,Xn)P(X_1, \ldots, X_n) 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:

Drug→Recovery,Age→Recovery,Age→Drug\text{Drug} \to \text{Recovery}, \quad \text{Age} \to \text{Recovery}, \quad \text{Age} \to \text{Drug}

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 do(X=x)\text{do}(X = x) represents an intervention: setting XX to xx by external force, breaking its incoming edges. The interventional distribution is

P(Y∣do(X=x))P(Y \mid \text{do}(X = x))
Details

The do-operator modifies the SCM: the structural equation for XX is replaced by X=xX = x (a constant), and all incoming edges to XX are removed. The resulting distribution is the interventional distribution.

Key distinction:

These are equal if and only if there is no confounding (i.e., XX is independent of the potential outcomes). In general, P(Y∣X=x)≠P(Y∣do(X=x))P(Y \mid X = x) \neq P(Y \mid \text{do}(X = x)).

Example. In the drug trial SCM, P(Recovery∣Drug=1)P(\text{Recovery} \mid \text{Drug} = 1) is confounded by Age (older patients are more likely to receive the drug and less likely to recover). But P(Recovery∣do(Drug=1))P(\text{Recovery} \mid \text{do}(\text{Drug} = 1)) 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:

RungActivityTypical questionTypical quantity
1. AssociationSeeingWhat does observing X tell me about Y?P(Y | X = x)
2. InterventionDoingWhat happens to Y if I make X = x?P(Y | do(X = x))
3. CounterfactualsImaginingWhat would have happened had X been different?P(Yx' | X = x, Y = y)
1. Association seeing: P(Y | X) 2. Intervention doing: P(Y | do(X)) 3. Counterfactuals imagining: P(Y_x' | X, Y) each rung answers questions the lower rungs cannot

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 P(V)P(V) 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 P(Y∣do(X))P(Y \mid \text{do}(X)) 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 Pressure→Barometer\text{Pressure} \to \text{Barometer} and Pressure→Rain\text{Pressure} \to \text{Rain} 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 P(Y∣do(X))P(Y \mid \text{do}(X)) is identifiable if it can be expressed as a function of the observed (associational) distribution P(V)P(V). Pearl’s do-calculus provides three rules for transforming interventional queries into associational ones. Write GXˉG_{\bar{X}} for the graph obtained from GG by deleting all arrows pointing into XX, GZ‾G_{\underline{Z}} for deleting all arrows pointing out of ZZ, and GXˉ,Z‾G_{\bar{X}, \underline{Z}} for both. The rules, for disjoint sets X,Y,Z,WX, Y, Z, W:

  1. Insertion/deletion of observations: P(y∣do(x),z,w)=P(y∣do(x),w)P(y \mid \text{do}(x), z, w) = P(y \mid \text{do}(x), w) if YY and ZZ are d-separated by X∪WX \cup W in GXˉG_{\bar{X}} (arrows into XX removed).
  2. Action/observation exchange: P(y∣do(x),do(z),w)=P(y∣do(x),z,w)P(y \mid \text{do}(x), \text{do}(z), w) = P(y \mid \text{do}(x), z, w) if YY and ZZ are d-separated by X∪WX \cup W in GXˉ,Z‾G_{\bar{X}, \underline{Z}} (arrows into XX removed and arrows out of ZZ removed).
  3. Insertion/deletion of actions: P(y∣do(x),do(z),w)=P(y∣do(x),w)P(y \mid \text{do}(x), \text{do}(z), w) = P(y \mid \text{do}(x), w) if YY and ZZ are d-separated by X∪WX \cup W in GXˉ,Z‾(Wˉ)G_{\bar{X}, \underline{Z}(\bar{W})} (arrows into XX removed, and arrows into ZZ removed except those into nodes that are ancestors of WW in GXˉG_{\bar{X}}).

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 ZZ satisfies the back-door criterion relative to (X,Y)(X, Y) if it blocks all back-door paths from XX to YY (paths ending with an arrow into XX) and contains no descendant of XX. Then

P(Y∣do(X=x))=∑zP(Y∣X=x,Z=z) P(Z=z)P(Y \mid \text{do}(X = x)) = \sum_z P(Y \mid X = x, Z = z)\, P(Z = z)

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 MM such that (i) X→M→YX \to M \to Y is the only path from XX to MM (no unblocked back-door path from XX to MM), (ii) all back-door paths from MM to YY are blocked by XX, and (iii) all X→YX \to Y paths are blocked by MM, then the causal effect is identifiable via the front-door formula:

P(Y∣do(X=x))=∑mP(M=m∣X=x)∑x′P(Y∣M=m,X=x′) P(X=x′)P(Y \mid \text{do}(X = x)) = \sum_m P(M = m \mid X = x) \sum_{x'} P(Y \mid M = m, X = x')\, P(X = x') U X M Y confounded direct path
Details

Why the front-door works. The effect of XX on MM is identifiable by the back-door criterion with Z=∅Z = \emptyset (condition (i) rules out confounding of XX–MM). The effect of MM on YY is identifiable by adjusting for XX (condition (ii)). Condition (iii) ensures the effect of XX on YY is fully transmitted through MM, 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 (XX), tar deposits in the lungs (MM), and cancer (YY), with an unobserved confounder UU (e.g., a genetic predisposition) affecting both smoking and cancer. No set of observed variables blocks the back-door path X←U→YX \leftarrow U \to Y. 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 X∈{0,1}X \in \{0, 1\} and outcome YY, each unit ii has two potential outcomes:

Yi(1)(outcome if treated),Yi(0)(outcome if untreated)Y_i(1) \quad \text{(outcome if treated)}, \qquad Y_i(0) \quad \text{(outcome if untreated)}

The individual causal effect is Yi(1)−Yi(0)Y_i(1) - Y_i(0), but only one of the two is ever observed (the fundamental problem of causal inference). The average treatment effect (ATE) is

ATE=E[Y(1)−Y(0)]=E[Y(1)]−E[Y(0)]\text{ATE} = E[Y(1) - Y(0)] = E[Y(1)] - E[Y(0)]
Details

The two main frameworks for causal inference are:

FrameworkKey objectsIdentifiability condition
Structural (Pearl)DAG + structural equationsdo-calculus / back-door / front-door
Potential outcomes (Rubin)Yi(0), Yi(1) per unitUnconfoundedness / ignorability

In the potential outcomes framework, the key assumption is unconfoundedness (also called ignorability or selection on observables):

(Y(0),Y(1))⊥ ⁣ ⁣ ⁣⊥X(Y(0), Y(1)) \perp\!\!\!\perp X

i.e., potential outcomes are independent of treatment assignment. Unconfoundedness with no covariates corresponds exactly to the back-door criterion with the empty set Z=∅Z = \emptyset (no confounders). Its conditional version, (Y(0),Y(1))⊥ ⁣ ⁣ ⁣⊥X∣Z(Y(0), Y(1)) \perp\!\!\!\perp X \mid Z for observed covariates ZZ, corresponds exactly to the back-door criterion with adjustment set ZZ.

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, E[Y∣do(X=1)]=E[Y(1)]E[Y \mid \text{do}(X = 1)] = E[Y(1)] and E[Y∣do(X=0)]=E[Y(0)]E[Y \mid \text{do}(X = 0)] = E[Y(0)]. The ATE is the difference of interventional means.

SUTVA

Both frameworks rest on the Stable Unit Treatment Value Assumption (SUTVA), which has two components:

  1. No interference: the potential outcome of unit ii does not depend on the treatment assigned to any other unit j≠ij \neq i. Formally, YiY_i is a function of unit ii’s own treatment alone. This fails with spillover effects, e.g., vaccination (herd immunity), or when units compete for a shared resource.
  2. Consistency: the observed outcome for a unit under treatment xx equals the potential outcome for that treatment: Y=Yi(x)Y = Y_i(x) whenever Xi=xX_i = x. 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 x\mathbf{x}.

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 E[Y∣X=1]E[Y \mid X = 1] cannot be connected to E[Y(1)]E[Y(1)]. This is a practical concern when treatments are heterogeneous (e.g., “smoking” covers many intensities).

Instrumental variables

An instrumental variable ZZ for the effect of XX on YY satisfies:

  1. Relevance: ZZ is associated with XX (i.e., P(X∣Z=z1)≠P(X∣Z=z2)P(X \mid Z = z_1) \neq P(X \mid Z = z_2) for some z1≠z2z_1 \neq z_2).
  2. Exclusion: ZZ affects YY only through XX (no direct effect).
  3. Independence: ZZ is independent of unobserved confounders of XX and YY.
Z U X Y No Z → Y edge (exclusion restriction)
Details

When a valid instrument exists, the causal effect can be estimated by the Wald estimator (ratio of two differences):

Causal effect=Cov(Z,Y)Cov(Z,X)=E[Y∣Z=1]−E[Y∣Z=0]E[X∣Z=1]−E[X∣Z=0]\text{Causal effect} = \frac{\text{Cov}(Z, Y)}{\text{Cov}(Z, X)} = \frac{E[Y \mid Z = 1] - E[Y \mid Z = 0]}{E[X \mid Z = 1] - E[X \mid Z = 0]}

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 (Z→X→YZ \to X \to Y with no Z→YZ \to Y edge and no confounding on ZZ) is a distinct graphical pattern from the front-door criterion (X→M→YX \to M \to Y 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 (X=x,Y=y)(X = x, Y = y), the counterfactual is

Yx′(the outcome this unit would have had if X=x′ instead)Y_{x'} \quad \text{(the outcome this unit would have had if } X = x' \text{ instead)}

This is the top rung of the ladder of causation: it combines observation (the evidence X=x,Y=yX = x, Y = y) with intervention (setting XX to x′x').

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 (X=1X = 1) and recovered (Y=1Y = 1). The counterfactual question is: would this patient have recovered without the drug (Yx=0=?Y_{x=0} = ?)? The answer requires the structural equations and the unit’s exogenous variables.

Counterfactuals are computed from the SCM by abduction–action–prediction:

  1. Abduction: use the evidence (X=x,Y=y)(X = x, Y = y) to infer the posterior over the exogenous variables UU for this unit.
  2. Action: modify the SCM, replacing the equation for XX by X=x′X = x'.
  3. Prediction: propagate the inferred UU through the modified equations to obtain Yx′Y_{x'}.

The resulting quantity P(Yx′∣X=x,Y=y)P(Y_{x'} \mid X = x, Y = y) 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 P(V)P(V) 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:

MethodTheoretical counterpartKey identifying assumptionEstimator
Propensity score methodsBack-door criterion / conditional unconfoundedness(Y(0), Y(1)) ⊥⊥ X | Z, SUTVAWeight or match on e(Z) = P(X = 1 | Z = z)
Difference-in-differencesPotential outcomes with time-varying treatmentParallel trendsDouble difference of means over time and group
Regression discontinuityLocal randomization at a cutoffContinuity of potential-outcome functions at the cutoffDiscontinuity of E[Y | X] at the cutoff
Instrumental variablesIV graph (Z → X → Y, no Z → Y)Relevance, exclusion, independenceWald estimator / 2SLS
τ^DiD=(Yˉtreated, after−Yˉtreated, before)−(Yˉcontrol, after−Yˉcontrol, before)\hat{\tau}_{\text{DiD}} = \big(\bar{Y}_{\text{treated, after}} - \bar{Y}_{\text{treated, before}}\big) - \big(\bar{Y}_{\text{control, after}} - \bar{Y}_{\text{control, before}}\big)

valid when, absent treatment, both groups would have followed parallel trends.

τRD=lim⁡s↓cE[Y∣S=s]−lim⁡s↑cE[Y∣S=s]\tau_{\text{RD}} = \lim_{s \downarrow c} E[Y \mid S = s] - \lim_{s \uparrow c} E[Y \mid S = s]

identifies the local effect at the cutoff: manipulation of SS near cc aside, assignment is as if randomized in a narrow window.

Details

Why the propensity score suffices. By Rosenbaum and Rubin (1983), e(Z)e(Z) is a balancing score: X⊥ ⁣ ⁣ ⁣⊥Z∣e(Z)X \perp\!\!\!\perp Z \mid e(Z). Hence, under conditional unconfoundedness (Y(0),Y(1))⊥ ⁣ ⁣ ⁣⊥X∣Z(Y(0), Y(1)) \perp\!\!\!\perp X \mid Z, adjusting for the scalar e(Z)e(Z) removes all confounding — this is the back-door adjustment with the score replacing the full covariate vector. In practice one estimates e(Z)e(Z) (e.g., by logistic regression) and either matches treated to control units with similar scores, or weights units by 1/e(Z)1/e(Z) (treated) and 1/(1−e(Z))1/(1 - e(Z)) (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 cc the populations are comparable in expectation: the discontinuity in E[Y∣S=s]E[Y \mid S = s] at cc 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 cc.

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 GG is assumed known (from domain knowledge). Causal discovery is the subfield that instead tries to learn the structure of GG from observational data. In general, the observational distribution only identifies GG 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 e(Z)e(Z), the outcome regressions E[Y∣X,Z]E[Y \mid X, Z]), 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:

τ^DML=∑i(Yi−m(Zi))(Xi−e(Zi))∑i(Xi−e(Zi))2\hat{\tau}_{\text{DML}} = \frac{\sum_i \big(Y_i - m(Z_i)\big)\big(X_i - e(Z_i)\big)}{\sum_i \big(X_i - e(Z_i)\big)^2}

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.

All of these assume an identification result already holds (typically conditional unconfoundedness given ZZ, 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 (XX) and drowning deaths (YY) are positively correlated. A third variable, temperature (TT), causes both: T→XT \to X, T→YT \to Y. (a) Is the associational correlation between XX and YY a causal effect? (b) Using the back-door criterion, show that conditioning on TT identifies the causal effect of XX on YY. (c) What is the causal effect if the structural equations are X=T+UXX = T + U_X and Y=0.5 T+UYY = 0.5\,T + U_Y (with UX,UYU_X, U_Y independent of TT)?

Solution

(a) No. The correlation between XX and YY is spurious: both are caused by TT. There is no causal path from XX to YY in the graph T→XT \to X, T→YT \to Y. The causal effect of XX on YY is zero.

(b) The back-door paths from XX to YY are: X←T→YX \leftarrow T \to Y. The set Z={T}Z = \{T\} blocks this path (it is a common cause, not a descendant of XX). By the back-door criterion:

P(Y∣do(X=x))=∑tP(Y∣X=x,T=t) P(T=t)P(Y \mid \text{do}(X = x)) = \sum_t P(Y \mid X = x, T = t)\, P(T = t)

Since Y⊥ ⁣ ⁣ ⁣⊥X∣TY \perp\!\!\!\perp X \mid T (no direct edge X→YX \to Y), this simplifies to P(Y∣T=t)P(Y \mid T = t) integrated over TT, which does not depend on xx. Hence the causal effect is zero.

(c) From the structural equations, Y=0.5 T+UYY = 0.5\,T + U_Y does not contain XX. Setting X=xX = x (do-operator) changes the equation for XX but not for YY. Therefore E[Y∣do(X=x)]=E[0.5 T+UY]=0.5 E[T]E[Y \mid \text{do}(X = x)] = E[0.5\,T + U_Y] = 0.5\,E[T] regardless of xx. The causal effect is 0.5 E[T]−0.5 E[T]=00.5\,E[T] - 0.5\,E[T] = 0, confirming part (a).

Quiz

Question 1. In the graph Z→X→YZ \to X \to Y with an additional edge Z→YZ \to Y, is ZZ a valid instrument for the effect of XX on YY? 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 P(Yx′∣X=x,Y=y)P(Y_{x'} \mid X = x, Y = y)? 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: ZZ has a direct edge to YY, so ZZ affects YY through paths other than XX. The Wald estimator would then mix the direct effect of ZZ into the estimated effect of XX. In the IV graph, ZZ must affect YY only through XX.

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 E[Y∣S=s]E[Y \mid S = s] at the cutoff identifies the local causal effect.

Question 3. Rung 3 (counterfactuals). It conditions on observed evidence (X=x,Y=yX = x, Y = y) and asks about a different intervention (x′x'). The observational distribution P(V)P(V) is a rung-1 object: many different SCMs — with the same DAG and the same P(V)P(V) but different structural equations — induce different values of P(Yx′∣X=x,Y=y)P(Y_{x'} \mid X = x, Y = y). 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) G=(V,E)G = (V, E) with a structural equation for each node:

Xi=fi(Pa(Xi),Ui)X_i = f_i(\text{Pa}(X_i), U_i)

where Pa(Xi)\text{Pa}(X_i) are the parents of XiX_i in the graph and UiU_i are exogenous (unobserved) noise variables.

U X Y confounds confounds
Details

The DAG encodes causal assumptions: an edge X→YX \to Y means XX is a direct cause of YY. The model generates a joint distribution P(X1,…,Xn)P(X_1, \ldots, X_n) 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:

Drug→Recovery,Age→Recovery,Age→Drug\text{Drug} \to \text{Recovery}, \quad \text{Age} \to \text{Recovery}, \quad \text{Age} \to \text{Drug}

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 do(X=x)\text{do}(X = x) represents an intervention: setting XX to xx by external force, breaking its incoming edges. The interventional distribution is

P(Y∣do(X=x))P(Y \mid \text{do}(X = x))
Details

The do-operator modifies the SCM: the structural equation for XX is replaced by X=xX = x (a constant), and all incoming edges to XX are removed. The resulting distribution is the interventional distribution.

Key distinction:

These are equal if and only if there is no confounding (i.e., XX is independent of the potential outcomes). In general, P(Y∣X=x)≠P(Y∣do(X=x))P(Y \mid X = x) \neq P(Y \mid \text{do}(X = x)).

Example. In the drug trial SCM, P(Recovery∣Drug=1)P(\text{Recovery} \mid \text{Drug} = 1) is confounded by Age (older patients are more likely to receive the drug and less likely to recover). But P(Recovery∣do(Drug=1))P(\text{Recovery} \mid \text{do}(\text{Drug} = 1)) gives the true causal effect, free of confounding.

Identifiability and do-calculus

An interventional quantity P(Y∣do(X))P(Y \mid \text{do}(X)) is identifiable if it can be expressed as a function of the observed (associational) distribution P(V)P(V). Pearl’s do-calculus provides three rules for transforming interventional queries into associational ones:

  1. Insertion/deletion of observation: if ZZ is independent of XX in the graph with all incoming edges to XX removed, then P(y∣do(x),z)=P(y∣do(x))P(y \mid \text{do}(x), z) = P(y \mid \text{do}(x)).
  2. Action/observation exchange: if ZZ is independent of XX in the graph with incoming edges to XX removed and ZZ set to a constant, then P(y∣do(x),z)=P(y∣x,do(z′))P(y \mid \text{do}(x), z) = P(y \mid x, \text{do}(z')).
  3. Insertion/deletion of action: if ZZ is independent of XX in the graph with all incoming edges to both XX and ZZ removed, then P(y∣do(x),do(z))=P(y∣do(z))P(y \mid \text{do}(x), \text{do}(z)) = P(y \mid \text{do}(z)).

The key graphical criterion is the back-door criterion: a set ZZ satisfies the back-door criterion relative to (X,Y)(X, Y) if it blocks all back-door paths from XX to YY and contains no descendants of XX. Then

P(Y∣do(X=x))=∑zP(Y∣X=x,Z=z) P(Z=z)P(Y \mid \text{do}(X = x)) = \sum_z P(Y \mid X = x, Z = z)\, P(Z = z)
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.

P(Y∣do(X=x))=∑mP(M=m∣X=x)∑x′P(Y∣M=m,X=x′) P(X=x′)P(Y \mid \text{do}(X = x)) = \sum_m P(M = m \mid X = x) \sum_{x'} P(Y \mid M = m, X = x')\, P(X = x') U X M Y confounded direct path

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 X∈{0,1}X \in \{0, 1\} and outcome YY, each unit ii has two potential outcomes:

Yi(1)(outcome if treated),Yi(0)(outcome if untreated)Y_i(1) \quad \text{(outcome if treated)}, \qquad Y_i(0) \quad \text{(outcome if untreated)}

The individual causal effect is Yi(1)−Yi(0)Y_i(1) - Y_i(0), but only one of the two is ever observed (the fundamental problem of causal inference). The average treatment effect (ATE) is

ATE=E[Y(1)−Y(0)]=E[Y(1)]−E[Y(0)]\text{ATE} = E[Y(1) - Y(0)] = E[Y(1)] - E[Y(0)]
Details

The two main frameworks for causal inference are:

FrameworkKey objectsIdentifiability condition
Structural (Pearl)DAG + structural equationsdo-calculus / back-door / front-door
Potential outcomes (Rubin)Yi(0), Yi(1) per unitUnconfoundedness / ignorability

In the potential outcomes framework, the key assumption is unconfoundedness (also called ignorability or selection on observables):

(Y(0),Y(1))⊥ ⁣ ⁣ ⁣⊥X(Y(0), Y(1)) \perp\!\!\!\perp X

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, E[Y∣do(X=1)]=E[Y(1)]E[Y \mid \text{do}(X = 1)] = E[Y(1)] and E[Y∣do(X=0)]=E[Y(0)]E[Y \mid \text{do}(X = 0)] = E[Y(0)]. The ATE is the difference of interventional means.

Instrumental variables

An instrumental variable ZZ for the effect of XX on YY satisfies:

  1. Relevance: ZZ is associated with XX (i.e., P(X∣Z=z1)≠P(X∣Z=z2)P(X \mid Z = z_1) \neq P(X \mid Z = z_2) for some z1≠z2z_1 \neq z_2).
  2. Exclusion: ZZ affects YY only through XX (no direct effect).
  3. Independence: ZZ is independent of unobserved confounders of XX and YY.
Z U X Y No Z → Y edge (exclusion restriction)
Details

When a valid instrument exists, the causal effect can be estimated by the Wald estimator (ratio of two differences):

Causal effect=Cov(Z,Y)Cov(Z,X)=E[Y∣Z=1]−E[Y∣Z=0]E[X∣Z=1]−E[X∣Z=0]\text{Causal effect} = \frac{\text{Cov}(Z, Y)}{\text{Cov}(Z, X)} = \frac{E[Y \mid Z = 1] - E[Y \mid Z = 0]}{E[X \mid Z = 1] - E[X \mid Z = 0]}

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 (Z→X→YZ \to X \to Y with no Z→YZ \to Y edge and no confounding on ZZ) is a distinct graphical pattern from the front-door criterion (X→M→YX \to M \to Y 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 (X=x,Y=y)(X = x, Y = y), the counterfactual is

Yx′(the outcome this unit would have had if X=x′ instead)Y_{x'} \quad \text{(the outcome this unit would have had if } X = x' \text{ instead)}
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 (X=1X = 1) and recovered (Y=1Y = 1). The counterfactual question is: would this patient have recovered without the drug (Yx=0=?Y_{x=0} = ?)? The answer requires the structural equations and the unit’s exogenous variables.

Counterfactuals are identifiable from the SCM: P(Yx′∣X=x,Y=y)P(Y_{x'} \mid X = x, Y = y) 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:

Details

These methods are the applied counterparts of the theoretical frameworks above:

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 (XX) and drowning deaths (YY) are positively correlated. A third variable, temperature (TT), causes both: T→XT \to X, T→YT \to Y. (a) Is the associational correlation between XX and YY a causal effect? (b) Using the back-door criterion, show that conditioning on TT identifies the causal effect of XX on YY. (c) What is the causal effect if the structural equations are X=T+UXX = T + U_X and Y=0.5 T+UYY = 0.5\,T + U_Y (with UX,UYU_X, U_Y independent of TT)?

Solution

(a) No. The correlation between XX and YY is spurious: both are caused by TT. There is no causal path from XX to YY in the graph T→XT \to X, T→YT \to Y. The causal effect of XX on YY is zero.

(b) The back-door paths from XX to YY are: X←T→YX \leftarrow T \to Y. The set Z={T}Z = \{T\} blocks this path (it is a common cause, not a descendant of XX). By the back-door criterion:

P(Y∣do(X=x))=∑tP(Y∣X=x,T=t) P(T=t)P(Y \mid \text{do}(X = x)) = \sum_t P(Y \mid X = x, T = t)\, P(T = t)

Since Y⊥ ⁣ ⁣ ⁣⊥X∣TY \perp\!\!\!\perp X \mid T (no direct edge X→YX \to Y), this simplifies to P(Y∣T=t)P(Y \mid T = t) integrated over TT, which does not depend on xx. Hence the causal effect is zero.

(c) From the structural equations, Y=0.5 T+UYY = 0.5\,T + U_Y does not contain XX. Setting X=xX = x (do-operator) changes the equation for XX but not for YY. Therefore E[Y∣do(X=x)]=E[0.5 T+UY]=0.5 E[T]E[Y \mid \text{do}(X = x)] = E[0.5\,T + U_Y] = 0.5\,E[T] regardless of xx. The causal effect is 0.5 E[T]−0.5 E[T]=00.5\,E[T] - 0.5\,E[T] = 0, confirming part (a).