Causal Calculus
Mediation Analysis
A drug lowers blood pressure - but through which mechanism: directly or via kidney function? Employment discrimination: through qualifications (lawful) or directly through gender (unlawful)? Mediation analysis splits the causal effect into direct and indirect components, which is critical for policy, law, and interpreting ML models.
- Medicine: does a drug act directly on the target organ or through a biomarker?
- Labor law: de jure vs. de facto discrimination through intermediate variables
- Sociology: direct and indirect effects of education on wages through occupation type
- Neuroscience: which neural pathways mediate the cognitive effect of a stimulus?
- Explainable AI: direct and indirect contribution of a feature to a prediction
Цели урока
- Decompose the causal effect into NDE (direct) and NIE (indirect) using the mediation formula
- Apply Pearl's mediation formula to nonlinear models with interactions
- Assess sensitivity to unmeasured confounders via the $\rho$ parameter
Предварительные знания
- Counterfactual analysis and potential outcomes
- Do-calculus and the backdoor criterion
- Linear regression and residuals
NDE and NIE: the mediation formula
For $X \to M \to Y$ and $X \to Y$, the total effect $\tau = NDE + NIE$. Natural direct effect $NDE = E[Y(x, M(x_0)) - Y(x_0, M(x_0))]$: change in $Y$ when $X$ changes with $M$ held at its $x_0$-level. Natural indirect effect $NIE = E[Y(x, M(x)) - Y(x, M(x_0))]$: change in $Y$ through the change in $M$ alone.
Sensitivity to unmeasured mediator confounders
The parameter $\rho$ is the correlation of residuals $\varepsilon_M$ and $\varepsilon_Y$ (unmeasured mediator confounder). At $\rho=0$ there is no confounding. Sensitivity analysis: how does NIE change as $\rho$ varies? A result stable for $|\rho| < 0.3$ is acceptable in most applied settings.
The classical Baron-Kenny (1986) approach requires linearity, no interactions, and no mediator confounding. Pearl's mediation formula removes the linearity requirement, but mediator confounding still requires special methods (IV or RCT for $M$).
Direct and Indirect Effects: NDE and NIE
The FDA has required mediation analysis for drug approval since 2022 , separating the direct effect of a treatment from its indirect effect through biological pathways. Natural Direct Effect (NDE) and Natural Indirect Effect (NIE) formalize this question in the language of counterfactuals.
NDE + NIE = TE holds only when there is no X×M interaction. With interaction the decomposition becomes more complex: TE = CDE + PAI + PIE (VanderWeele's four-way decomposition).
What does the Natural Indirect Effect (NIE) measure?
NIE = E[Y(1,M(1)) - Y(1,M(0))]: we hold treatment at X=1 but shift the mediator from M(0) to M(1). This isolates the X→M→Y pathway's contribution to the total effect.
The Mediation Formula and Identification
When there are no unmeasured confounders for X-M, X-Y, or M-Y, Pearl's mediation formula expresses NDE and NIE through the observational distribution. With randomized X, observing M and adjusting for baseline covariates suffices.
Under linear models NIE = a×b (product of coefficients) and NDE = c' (direct coefficient). For nonlinear models or binary outcomes, counterfactual formulas or bootstrap are required.
What is sequential ignorability in mediation analysis?
Sequential ignorability: (1) Y(x,m) ⊥ X | Z , no hidden X-Y confounder; (2) Y(x,m) ⊥ M | X, Z , no hidden M-Y confounder. Both are needed to identify NDE and NIE.
Sensitivity Analysis for Mediation
Sequential ignorability is untestable from data , just like no unmeasured confounding for ATE. The sensitivity analysis of Imai et al. (2010) quantifies how correlated the residuals of the mediator and outcome equations must be to nullify the NIE.
Standard reporting: state NIE alongside the critical ρ* and a plot of NIE(ρ). If |ρ*| < 0.2 the indirect effect conclusion is fragile and requires additional justification or an instrumental variable for M.
What does a small critical value |ρ*| indicate in mediation sensitivity analysis?
Critical ρ* is the minimum residual correlation that drives NIE to zero. A small |ρ*| means a modest hidden confounder can destroy the indirect effect. For a robust conclusion, |ρ*| > 0.3-0.4 is recommended.
Linear mediation: the Baron-Kenny formula
With $Y = \alpha X + \beta M + \varepsilon_Y$ and $M = \gamma X + \varepsilon_M$: NDE $= \alpha$, NIE $= \beta\gamma$, total effect $= \alpha + \beta\gamma$. Proportion mediated: $\frac{\beta\gamma}{\alpha + \beta\gamma}$. Exact under linearity; nonlinear models need the general mediation formula.
Итоги
- Total effect $= NDE + NIE$: direct path $X \to Y$ plus indirect $X \to M \to Y$
- Pearl's mediation formula identifies NDE/NIE under no-unmeasured-mediator-confounding assumption
- Sensitivity analysis via $\rho$ shows how robust conclusions are to assumption violations
Connections to other topics
Mediation analysis is central to algorithmic fairness: it separates permissible and impermissible pathways through which a feature affects a decision. The PC algorithm for causal discovery can detect mediation structure from observational data.
- Related topics — extends
Вопросы для размышления
- When do NDE and NIE not sum to the total effect? Under what condition is the decomposition exact?
- How do you identify NIE when there is an unmeasured confounder between $M$ and $Y$?
- In a gender pay gap study: how would you distinguish the lawful 'qualifications' pathway from the direct effect of gender?