The Front Door Opens Through the Middle
The strangest thing about the front-door criterion is that it sounds like bad advice.
There is an unobserved confounder between treatment and outcome. No observed pre-treatment covariate blocks the back door. Then someone says:
measure something after treatment
That usually makes causal people nervous, and for good reason. Conditioning on a post-treatment variable can destroy the total effect you were trying to estimate. Mediators are not ordinary controls. They live on the path from cause to consequence.
The front door is the exceptional case where a mediator is not a nuisance. It is the only measured turnstile in the building.
The Graph That Should Not Work
The classic front-door graph has four roles:
U -> X
U -> Y
X -> M -> Y
The variable U is hidden. It affects both treatment X and outcome Y, so
the crude association between X and Y is confounded. The mediator M is
observed and sits on the directed path from X to Y.
If that were the whole story, Pearl showed that the causal effect is identifiable from observational data.1
For discrete variables, the front-door formula is
\[P(y\mid do(x)) = \sum_m P(m\mid x)Q_y(m),\]where
\[Q_y(m) = \sum_{x'} P(y\mid m,x')P(x').\]This is a compact sentence with a lot of machinery inside it.
The outer factor, \(P(m\mid x)\), learns how the treatment moves the mediator.
That part is safe because the graph promises no unblocked back-door path from
X to M.
The inner sum,
\[\sum_{x'} P(y\mid m,x')P(x'),\]learns the effect of the mediator on the outcome by adjusting for X. That is
safe because the graph promises that every back-door path from M to Y is
blocked by X.
Then the two pieces are composed.
The mediator is not being controlled away. It is being used as a measured mechanism.
The Three Promises
Pearl’s front-door criterion asks for three graphical promises.1
First, the mediator has to intercept all directed paths from X to Y. If
there is a direct arrow X -> Y that bypasses M, the formula does not know
where that effect went.
Second, there must be no unblocked back-door path from X to M. If the same
hidden force that makes treatment more likely also makes the mediator more
likely, the first stage is confounded.
Third, every back-door path from M to Y must be blocked by X. In the
classic graph, the path
M <- X <- U -> Y
is blocked when we condition on X.
These are not decorative assumptions. They are the reason the algebra works.
The ID algorithm of Shpitser and Pearl later placed front-door inside a more general identification theory for causal effects with hidden variables.2 That broader theory is useful partly because front-door is memorable enough to be overused. It is a sufficient graphical pattern, not a synonym for “we measured a mediator.”
A Tiny Front-Door Laboratory
The lab below uses an exact binary structural causal model. There is no Monte
Carlo noise in the displayed numbers. The hidden variable U affects both
treatment and outcome. Treatment affects a measured mediator. The mediator
affects the outcome.
The lab computes:
- the true interventional effect from the known structural model;
- the front-door estimand using only the observed distribution of
X,M, andY; - the naive association;
- a tempting but wrong “condition on the mediator” estimate.
Two sliders deliberately break the graph:
- Direct leak adds an
X -> Ypath around the mediator. - Mediator leak adds hidden confounding between
XandM.
The Audit tile is generated by the same JavaScript. It checks probability normalization, parameter sanitation, the default equality between the true effect and the front-door formula, visible naive confounding, ordered mediator response, failure under direct and mediator leaks, and a 45-case grid over valid and invalid settings.
Exact binary structural model, not a finite-sample estimator. The hidden variable is used only to compute the ground-truth intervention and to draw the graph; the front-door formula uses only the observed distribution of X, M, and Y.
At the default setting, the true effect is 0.3194. The front-door formula is
also 0.3194, with bias 0.0000. The naive association is 0.6123, almost
double the causal effect, because the hidden variable makes treatment and
outcome move together. The mediator responds strongly:
P(M=1 | X=1) = 0.8238 while P(M=1 | X=0) = 0.1368.
Now raise Direct leak. The front-door estimate moves away from the true
effect because the mediator no longer intercepts all directed paths from X to
Y. Reset it and raise Mediator leak. The first stage is now confounded:
the hidden variable affects both treatment and mediator, so P(M | X) is no
longer the clean effect of treatment on mediator.
The tempting mistake is to say:
if M is the mechanism, just condition on M
The lab’s “condition on M” bar shows why that is not the front door. Conditioning on a mediator asks a controlled-direct-effect kind of question. The front-door formula asks for the total effect by transporting the mediator distribution under each treatment value and separately estimating what the mediator does to the outcome.
Those are different estimands.
Why This Feels Like Cheating
Front-door identification works because the graph gives you two smaller experiments hiding inside one messy observational study.
First, X -> M is identifiable because there is no open back-door path from
X to M. Even though X is confounded with Y, its effect on M is clean.
Second, M -> Y is identifiable after adjusting for X. The mediator is
associated with the hidden variable through treatment, but conditioning on
treatment blocks the back-door route from M through X and U into Y.
Then do-calculus composes those pieces.
This is the part that makes causal graphs more than pictures. The graph is not only a description of dependence. It is a recipe language for deciding which interventional quantities can be expressed from the observed distribution. Shpitser and Pearl’s identification work generalizes this recipe: when hidden variables are represented by bidirected arcs, some effects remain identifiable, some do not, and an algorithm can decide which case you are in.2
Where the Front Door Gets Bruised
The front-door criterion is rare in clean form.
A real mediator may not carry all of the treatment effect. Treatment can affect the outcome through channels you did not measure. The mediator may share hidden causes with treatment. The mediator-outcome relationship may be confounded in a way that treatment does not block. Measurement error in the mediator can also make the two-stage formula look precise while measuring the wrong mechanism.
Hernán and Robins use the front-door criterion as an example of how causal diagrams can reveal identification where ordinary exchangeability fails, but their broader warning still applies: the graph is an assumption, not a result of algebra.3
So the research checklist is not “did we observe a mediator?”
It is closer to:
- What are all directed paths from treatment to outcome?
- Does the measured mediator intercept them?
- Could hidden causes affect both treatment and mediator?
- Does conditioning on treatment block mediator-outcome back doors?
- Are we estimating the total effect, a controlled direct effect, or a path specific effect?
- How sensitive is the answer to small direct leaks or mediator leaks?
The front door is powerful because it is narrow.
The Door Metaphor Is Almost Right
The back door says: block the path that sneaks from treatment to outcome through common causes.
The front door says something stranger:
when the back door is locked,
walk through the mechanism
but do not stop there
You enter through X -> M, then exit through the estimated effect of M on
Y. You do not simply stand inside M and call it adjustment.
That distinction is the whole trick. A mediator can identify a total effect, but only when the graph lets it serve as a measured turnstile rather than a conditioning variable.
-
Judea Pearl, “Causal diagrams for empirical research”, Biometrika 82(4), 1995. Pearl states the front-door criterion and derives the discrete formula in Theorem 2. ↩ ↩2
-
Ilya Shpitser and Judea Pearl, “Identification of Joint Interventional Distributions in Recursive Semi-Markovian Causal Models”, AAAI 2006. ↩ ↩2
-
Miguel A. Hernán and James M. Robins, Causal Inference: What If, Chapman & Hall/CRC, 2020. The authors provide the book and materials online at https://miguelhernan.org/whatifbook. ↩