Mediation analysis is a causal inference method that decomposes the total effect of a treatment on an outcome into a direct effect and an indirect effect operating through a specific mediator. It answers not just if a disruption causes a delay, but how—for example, quantifying whether a port closure reduces throughput directly or indirectly by first depleting chassis availability.
Glossary
Mediation Analysis

What is Mediation Analysis?
A statistical method used to identify and quantify the mechanism through which an independent variable influences a dependent variable via an intermediate mediator variable.
The technique relies on estimating two key pathways: the effect of the treatment on the mediator (path a) and the effect of the mediator on the outcome (path b). The indirect effect is the product of these coefficients, while the direct effect captures residual influence. In supply chains, this distinguishes whether a supplier failure propagates via inventory depletion versus a direct contractual penalty.
Core Characteristics
Mediation analysis dissects the total effect of a disruption (treatment) on a supply chain outcome into a direct path and an indirect path that flows through an intermediate variable (mediator). This decomposition is critical for identifying the precise operational lever to pull during a crisis.
Direct vs. Indirect Effects
The core function of mediation analysis is to partition the Average Treatment Effect (ATE) into two distinct components:
- Natural Direct Effect (NDE): The effect of a disruption (e.g., port closure) on an outcome (e.g., stockout) that does not operate through the mediator.
- Natural Indirect Effect (NIE): The effect of the disruption on the outcome that operates specifically through the mediator (e.g., carrier capacity). This decomposition reveals whether a disruption causes failure directly or by choking a specific resource.
The Mediator Variable
A mediator is a variable that sits on the causal pathway between the treatment and the outcome, transmitting the effect. In supply chains, mediators are often operational bottlenecks:
- Inventory Buffers: A demand spike (treatment) causes a stockout (outcome) by depleting safety stock (mediator).
- Supplier Lead Time: A raw material shortage (treatment) delays production (outcome) by extending procurement cycles (mediator).
- Transportation Hubs: A regional weather event (treatment) causes late deliveries (outcome) by congesting a specific cross-dock (mediator). Identifying the mediator pinpoints where intervention will be most effective.
Counterfactual Framework
Modern mediation analysis relies on the counterfactual framework to define causal pathways without ambiguity. It answers two nested hypotheticals:
- What would the outcome be if we changed the treatment, but kept the mediator at the value it would naturally take under the control condition?
- What would the outcome be if we fixed the treatment, but changed the mediator to the value it would take under the treatment condition? This framework, formalized by Imai, Keele, and Tingley, allows for the estimation of causal mediation effects even in the presence of treatment-mediator interactions.
Sequential Ignorability Assumption
To identify causal mediation effects, a strong assumption called sequential ignorability must hold. This requires:
- No unmeasured treatment-outcome confounding: The treatment assignment is independent of potential outcomes given observed covariates.
- No unmeasured mediator-outcome confounding: The mediator is independent of potential outcomes given the treatment and observed covariates.
- No confounders of the mediator-outcome relationship are affected by the treatment. In complex supply chains, this is a high bar, often requiring sensitivity analysis to assess robustness to hidden confounders.
Product of Coefficients Method
A classical approach to mediation, often used in Structural Equation Modeling (SEM) and linear systems:
- Estimate the effect of the treatment on the mediator (path
a). - Estimate the effect of the mediator on the outcome, controlling for the treatment (path
b). - The indirect effect is calculated as the product
a × b. - The direct effect is the remaining effect of the treatment on the outcome (path
c'). While intuitive, this method assumes linearity and no interaction, making it less suitable for the non-linear dynamics of global logistics.
Mediation in High-Dimensional Settings
In modern supply chains with thousands of potential mediators (e.g., every node in a logistics graph), high-dimensional mediation analysis is required. Techniques include:
- Regularization: Applying LASSO or elastic net to select a sparse set of true mediators from a high-dimensional candidate set.
- Latent Variable Mediation: Modeling the mediator as an unobserved latent construct inferred from multiple noisy indicators, such as a composite 'supplier stress index' derived from financial, news, and weather data.
- Causal Mediation Forests: Non-parametric machine learning methods that estimate heterogeneous indirect effects across different sub-populations or product categories.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Explore the mechanics of mediation analysis, a statistical method for dissecting how an independent variable transmits its effect to a dependent variable through an intermediate mechanism.
Mediation analysis is a statistical method used to decompose the total effect of a treatment variable (X) on an outcome variable (Y) into a direct effect and an indirect effect that operates through an intermediate mediator variable (M). The process works by estimating two key models: one that predicts the mediator from the treatment, and another that predicts the outcome from both the treatment and the mediator. The indirect effect is quantified as the product of the path coefficient from X to M (the a path) and the path coefficient from M to Y controlling for X (the b path). This a*b product represents the amount of the total effect that is transmitted through the hypothesized mechanism. Modern approaches, particularly the causal inference framework developed by Imai, Keele, and Tingley, define effects using potential outcomes notation, allowing for the estimation of the Average Causal Mediation Effect (ACME) even in the presence of treatment-mediator interactions and non-linear models.
Related Terms
Master the core components of causal analysis to understand how mediation fits into the broader toolkit for identifying root causes in supply chain disruptions.
Total Effect vs. Direct Effect
The Total Effect is the overall impact of a treatment (e.g., a supplier shutdown) on an outcome (e.g., delivery delay). Mediation analysis decomposes this into:
- Direct Effect (NDE): The impact not explained by the mediator.
- Indirect Effect (NIE): The impact that operates through the mediator (e.g., inventory depletion). Understanding this decomposition prevents analysts from over-controlling for intermediate variables.
Structural Causal Model (SCM)
A formal framework defining causal relationships using structural equations. In mediation, the SCM specifies:
- The function linking the treatment to the mediator.
- The function linking the treatment and mediator to the outcome. This allows for the mathematical derivation of direct and indirect paths, moving beyond simple regression coefficients to true causal quantities.
Counterfactual Reasoning
The process of estimating what would have happened to the outcome if the mediator had taken a different value. Mediation relies heavily on cross-world counterfactuals (e.g., Y(1, M(0))). This estimates the outcome if the treatment were present, but the mediator was fixed at the level it would have taken under the control condition, isolating the direct path.
Confounding Variable Control
Valid mediation requires controlling for treatment-outcome, treatment-mediator, and mediator-outcome confounders. A critical challenge is post-treatment confounding, where a variable caused by the treatment influences both the mediator and outcome. Standard regression adjustment fails here; specialized techniques like marginal structural models or g-estimation are required.
Baron and Kenny Method
The classic 1986 approach using a sequence of linear regressions:
- Show the treatment affects the outcome (Total Effect).
- Show the treatment affects the mediator.
- Show the mediator affects the outcome, controlling for the treatment. While historically influential, modern causal inference often replaces this with product-of-coefficients methods and bootstrapping for the indirect effect, as the Baron-Kenny steps suffer from low statistical power.
Natural vs. Controlled Effects
Controlled Direct Effect (CDE): The effect of treatment when the mediator is fixed at a specific, uniform level for the entire population. Natural Direct/Indirect Effects (NDE/NIE): Allow the mediator to vary naturally for each individual under the control condition. NDE/NIE are generally preferred for policy evaluation, but require stronger, often untestable, cross-world independence assumptions.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us