Inferensys

Glossary

Causal Mediation Analysis

A statistical framework for decomposing a total causal effect into a direct effect and an indirect effect that operates through one or more intermediate variables (mediators).
Finance professional using AI FP&A copilot on laptop, board presentation visible on screen, home office work session.
DECOMPOSING CAUSAL MECHANISMS

What is Causal Mediation Analysis?

A statistical framework for decomposing a total causal effect into a direct effect and an indirect effect that operates through one or more intermediate variables (mediators).

Causal mediation analysis is a statistical framework that decomposes the total causal effect of an exposure on an outcome into a direct effect and an indirect effect operating through an intermediate variable, the mediator. It moves beyond testing mere association to quantify how a cause produces its effect, answering mechanistic questions about the pathways underlying an observed relationship.

The framework relies on strong identification assumptions, including no unmeasured confounding of the exposure-outcome, exposure-mediator, and mediator-outcome relationships. Modern approaches use the counterfactual framework to define natural direct effects (NDE) and natural indirect effects (NIE), often estimated via parametric models or simulation-based methods like the mediation formula.

DECOMPOSING CAUSAL EFFECTS

Core Components of the Framework

Causal mediation analysis dissects the total effect of an exposure on an outcome into a direct effect and an indirect effect operating through an intermediate mediator. This framework is essential for understanding the biological mechanisms driving disease.

01

Natural Direct Effect (NDE)

The Natural Direct Effect quantifies the effect of an exposure on an outcome that does not operate through a specified mediator. It represents the pathway where the exposure directly influences the outcome, holding the mediator constant at the level it would naturally take under a control condition. This is distinct from the Controlled Direct Effect, which sets the mediator to a fixed, uniform value for all individuals. Estimating the NDE requires strong assumptions, including no unmeasured confounding between the mediator and the outcome.

Direct Path
Exposure → Outcome
02

Natural Indirect Effect (NIE)

The Natural Indirect Effect captures the portion of the total effect that is transmitted through the mediator. It answers the question: how much would the outcome change if the exposure were fixed, but the mediator changed from the value it would take under a control condition to the value it would take under a treatment condition? This effect is the product of two paths: the effect of the exposure on the mediator (path a) and the effect of the mediator on the outcome (path b).

Indirect Path
Exposure → Mediator → Outcome
03

Counterfactual Framework

Modern mediation analysis is grounded in the potential outcomes or counterfactual framework. This involves defining hypothetical worlds to isolate effects. Key quantities include:

  • *Y(x, M(x))**: The outcome if exposure is set to x but the mediator takes the value it would naturally have under exposure x*.
  • The Total Effect (TE) is decomposed as TE = NDE + NIE. This framework, formalized by Robins, Greenland, Pearl, and VanderWeele, provides precise mathematical definitions for direct and indirect effects.
04

Key Identification Assumptions

To validly estimate causal mediation effects from observational data, four sequential ignorability assumptions must hold:

  • No unmeasured exposure-outcome confounding.
  • No unmeasured mediator-outcome confounding.
  • No unmeasured exposure-mediator confounding.
  • No mediator-outcome confounder affected by the exposure. Violations, particularly of the second assumption, are common and require sensitivity analyses to assess the robustness of findings.
05

High-Dimensional Mediation

In genomics and neuroimaging, the mediator is not a single variable but a high-dimensional vector, such as all gene transcripts or brain voxels. High-dimensional mediation analysis uses penalized regression and dimensionality reduction to handle p >> n problems. Methods like HIMA (High-dimensional Mediation Analysis) perform sure independence screening and minimax concave penalty estimation to identify significant mediators among thousands of candidates.

06

Mediation in Mendelian Randomization

Two-step Mendelian randomization applies mediation principles to genetic instruments. The total effect of a genetic variant on an outcome is decomposed into an effect through a measured risk factor (mediator) and a direct genetic effect. This is used to validate drug targets by confirming that a genetic proxy for a drug acts through the intended biomarker to affect disease, distinguishing on-target from off-target effects.

CAUSAL MEDIATION ANALYSIS

Frequently Asked Questions

Clear, technically precise answers to the most common questions about decomposing causal effects into direct and indirect pathways through intermediate variables.

Causal mediation analysis is a statistical framework that decomposes the total causal effect of an exposure on an outcome into a direct effect and an indirect effect that operates through one or more intermediate variables called mediators. The method works by estimating two key quantities: the natural direct effect (NDE) , which represents the effect of the exposure on the outcome that does not pass through the mediator, and the natural indirect effect (NIE) , which captures the effect transmitted through the mediator pathway. The total effect equals the sum of the NDE and NIE on the appropriate scale. Modern implementations rely on the counterfactual framework and the mediation formula, which integrates over the distribution of the mediator to estimate effects under hypothetical interventions. Estimation approaches include the product-of-coefficients method in linear structural equation models, simulation-based approaches like the Monte Carlo method, and weighting-based estimators that use inverse probability weights. The framework requires strong identification assumptions: no unmeasured confounding of the exposure-outcome, exposure-mediator, and mediator-outcome relationships, and no mediator-outcome confounders affected by the exposure.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.