Day 54. The Front-Door Criterion
When the confounder of treatment and outcome is unobserved, a fully mediating, unconfounded mechanism can still identify the effect. Estimate how the treatment moves the mediator, then how the mediator moves the outcome, and chain the two.
- ●State the three front-door conditions and check them in a DAG.
- ●Derive and apply the front-door adjustment formula.
- ●Compute front-door estimates with binary tables and as a product of regression coefficients.
- ●Judge the plausibility of the front-door assumptions in applied settings.
Theory
When back-door fails
Suppose with unobserved. No back-door set exists. But if affects only through a mediator that is not itself confounded with , we can still identify the effect:
Classic example: smoking , tar deposits , lung cancer , unobserved genotype .
The criterion
A set satisfies the front-door criterion relative to if
- intercepts all directed paths from to ;
- there is no unblocked back-door path from to ;
- all back-door paths from to are blocked by .
The formula
If satisfies the criterion and ,
The logic in two steps
- Effect of on . By condition 2, .
- Effect of on . By condition 3, is a back-door set for : .
- Chain them. By condition 1, affects only via : .
The linear case
With and , correlated with : estimate by regressing on , and by regressing on and . The effect is .
Plausibility
The conditions are strong: no direct effect of on outside , and no unobserved common cause of and . They hold most credibly when is a mechanical step: signing up versus attending, being offered versus receiving, prescribed versus dispensed.
Part 1 · Warm-up
Exercise 1 · Check the conditions
For each graph, does satisfy the front-door criterion for ? (a) , , . (b) Add . (c) Instead add . (d) Instead add , with unobserved.
Show solution
Step 1. (a) intercepts ; back-door paths from to : , blocked at the collider ; back-door from to : , blocked by . Satisfied.
Step 2. (b) is a directed path not through : condition 1 fails.
Step 3. (c) is an open back-door path from to : condition 2 fails.
Step 4. (d) is a back-door path from to not blocked by : condition 3 fails.
Exercise 2 · Linear front door
Regressing on gives 0.5; regressing on and gives 2.0 on . The front-door conditions hold. What is the effect of a one-unit increase in ?
Show solution
Step 1. Effect of on : 0.5. Effect of on : 2.0.
Answer: .
Exercise 3 · The first step
Why is in graph (a) of Exercise 1?
Show solution
Step 1. The only back-door path from to is .
Step 2. It has a collider at , so it is blocked by the empty set.
Answer: satisfies the back-door criterion for , so conditioning equals intervening.
Exercise 4 · A small front-door computation
. , . : : 0.6; : 0.4; : 0.5; : 0.3. Compute by the front-door formula.
Show solution
Step 1. Inner sums: : ; : .
Step 2. Outer sum with : .
Answer: 0.50.
Exercise 5 · Why average over ?
In the second step, why do we average over instead of using at the treatment value ?
Show solution
Step 1. We need the effect of on in the whole population, .
Step 2. is used only as a back-door adjustment variable for (it blocks ), so it must be averaged over its marginal distribution, as in any back-door formula.
Answer: using alone would describe the -mix of people with , which is confounded.
Part 2 · Proofs
Exercise 6 · Step 1 in general
Prove under condition 2.
Show solution
Step 1. Condition 2 says blocks every back-door path from to , and contains no descendants of .
Step 2. So satisfies the back-door criterion for , and the adjustment formula reduces to .
Exercise 7 · Step 2 in general
Prove under the front-door conditions.
Show solution
Step 1. Condition 3: blocks all back-door paths from to .
Step 2. is not a descendant of : lies on the directed paths from , and acyclicity forbids .
Step 3. So satisfies the back-door criterion for and the adjustment formula gives the result.
Exercise 8 · Chaining the steps
Using the SCM , , , prove .
Show solution
Step 1. Truncated factorisation for : .
Step 2. Sum over and : .
Step 3. Truncated factorisation for : ; summing over gives .
Step 4. By Exercise 6, . Substitute both into Step 2. Combined with Exercise 7, this proves the front-door formula.
Exercise 9 · The linear product
With , , (all disturbances independent), prove the population coefficient on in the regression of on is , so .
Show solution
Step 1. .
Step 2. with independent of ; so given , carries no information about : , a linear function of only.
Step 3. So : the coefficient on is .
Step 4. The regression of on recovers because is independent of .
Exercise 10 · A direct effect breaks it
Add a direct effect, . What does converge to, and what is the true total effect?
Show solution
Step 1. The argument of Exercise 9 still gives coefficient on (the term is a function of ).
Step 2. So .
Step 3. True total effect: .
Answer: the front-door estimate misses the direct effect entirely; condition 1 is essential.
Part 3 · Applied
Exercise 11 · Smoking, tar and cancer
Observational data: smokers; and heavy tar deposits; cancer rates : : 0.44; : 0.34; : 0.26; : 0.16. Compute the naive risk difference and the front-door effect.
Show solution
Step 1. Naive: and ; difference 0.26.
Step 2. Effect of tar, averaging over smoking: ; .
Step 3. .
Step 4. .
Answer: causal risk difference 0.08, versus a naive 0.26. (These numbers come from an SCM with a genotype that raises both smoking and cancer; the code checks that 0.08 is the true effect.)
Exercise 12 · Signing up versus showing up
A job-training programme records who signed up (), who attended () and later earnings (). Motivation is unobserved. Discuss each front-door condition for the effect of signing up.
Show solution
Step 1. Condition 1: signing up should affect earnings only through attending. Plausible, unless signing up itself changes behaviour (e.g. it triggers other services or job-search requirements).
Step 2. Condition 2: no unblocked confounding between signing up and attending. Questionable: motivated people both sign up and attend.
Step 3. Condition 3: given sign-up status, attendance is unconfounded with earnings. Questionable for the same reason.
Answer: among sign-ups, attendance is nearly mechanical (most attend), which makes conditions 2–3 more credible; studies of this design find estimates close to experimental benchmarks for some groups and not others. Plausibility must be argued, not assumed.
Exercise 13 · Mobile money and savings
A mobile-money app (, adopted or not) can raise household savings only through account usage (deposits per month). Adoption and savings share unobserved financial literacy. Regressions: usage on adoption gives 0.6 deposits; savings on usage and adoption gives $50 per deposit on usage. Estimate the effect of adoption on savings.
Show solution
Step 1. Effect of adoption on usage: .
Step 2. Effect of usage on savings, adjusting for adoption: .
Answer: dollars per household. The naive regression of savings on adoption would also pick up literacy.
Exercise 14 · What if the app has a direct effect?
Suppose the app also raises savings by $10 directly (through reminders that work even without deposits). What does the front-door estimate from Exercise 13 converge to, and what is the true effect?
Show solution
Step 1. By Exercise 10, .
Step 2. True total effect: .
Answer: the front-door estimate understates the effect by $10 (25%). In the simulation below, the front-door estimate is about 30 and the truth 40.
Exercise 15 · Nurse staffing and mortality
A hospital network asks whether higher nurse staffing () lowers in-hospital mortality (). Wards with sicker patients get more nurses, and severity is poorly measured. The analyst proposes using monitoring frequency (, vital-sign checks per day) as a front-door variable. List what must be true and one likely failure for each condition.
Show solution
Step 1. Condition 1: staffing affects mortality only through monitoring. Likely failure: nurses also deliver medication on time and prevent falls; those channels bypass .
Step 2. Condition 2: nothing unmeasured affects both staffing and monitoring. Likely failure: severity raises staffing and monitoring protocols directly.
Step 3. Condition 3: given staffing, monitoring is unconfounded with mortality. Likely failure: sicker patients are monitored more and die more.
Answer: monitoring fails all three; the front door is not credible here. A better design might use staffing shocks (nurse absences, Phase 5 instruments).
Verify in Python
import itertools
import numpy as np
# Exercise 11: the SCM behind the table (U = genotype, unobserved)
pU = .5; pX = {1: .8, 0: .2}; pM = {1: .9, 0: .1}; pY = {(0, 0): .1, (1, 0): .2, (0, 1): .4, (1, 1): .5} # key (m, u)
truth = {x: sum((pM[x] if m else 1 - pM[x]) * sum((pU if u else 1 - pU) * pY[m, u] for u in (0, 1)) for m in (0, 1)) for x in (0, 1)}
J = {(u, x, m): (pU if u else 1 - pU) * (pX[u] if x else 1 - pX[u]) * (pM[x] if m else 1 - pM[x])
for u, x, m in itertools.product((0, 1), repeat=3)}
Px = {x: sum(v for k, v in J.items() if k[1] == x) for x in (0, 1)}
Pm_x = {(m, x): sum(v for k, v in J.items() if k[1] == x and k[2] == m) / Px[x] for m in (0, 1) for x in (0, 1)}
Py_mx = {(m, x): sum(v * pY[m, k[0]] for k, v in J.items() if k[1] == x and k[2] == m) / (Px[x] * Pm_x[m, x]) for m in (0, 1) for x in (0, 1)}
print("observed P(Y=1|M,X):", {k: round(v, 3) for k, v in Py_mx.items()})
naive = {x: sum(Pm_x[m, x] * Py_mx[m, x] for m in (0, 1)) for x in (0, 1)}
front = {x: sum(Pm_x[m, x] * sum(Py_mx[m, xp] * Px[xp] for xp in (0, 1)) for m in (0, 1)) for x in (0, 1)}
print(f"naive {naive[1] - naive[0]:.3f} front-door {front[1] - front[0]:.3f} truth {truth[1] - truth[0]:.3f}")
# Exercises 13-14: linear front door with and without a direct effect
rng = np.random.default_rng(54); n = 500_000
L = rng.normal(size=n) # financial literacy (unobserved)
X = (L + rng.normal(size=n) > 0).astype(float)
M = 0.6 * X + rng.normal(size=n)
for d in (0, 10):
Y = 50 * M + d * X + 40 * L + rng.normal(0, 20, n)
a = np.polyfit(X, M, 1)[0]
b = np.linalg.lstsq(np.column_stack([np.ones(n), M, X]), Y, rcond=None)[0][1]
naive = Y[X == 1].mean() - Y[X == 0].mean()
print(f"direct effect {d}: naive {naive:.1f}, front-door {a * b:.1f}, truth {30 + d}")
Key takeaways
- The front door identifies an effect despite unobserved treatment–outcome confounding, if a mediator captures the whole effect, is unconfounded with the treatment, and is unconfounded with the outcome given the treatment.
- Formula: ; in linear models, the product of two regression coefficients.
- Its assumptions are strong; they are most credible when the mediator is a mechanical step of the treatment.
Simulation Lab: The Front Door
Open full screen →Smoking, tar and cancer with a hidden genotype: the front-door formula recovers the effect until its assumptions are broken.
Smoking (X), tar (M), cancer (Y) and an unobserved genotype (U). All probabilities are exact. The front-door formula uses only X, M and Y; it matches the truth as long as there is no direct X → Y arrow and U does not affect M. Turn those on to watch it fail.