What Is Mediation Analysis?
Mediation analysis tests whether the relationship between an independent variable (X) and a dependent variable (Y) is explained, fully or partially, by an intervening variable called a mediator (M). The mediator is the mechanism or process through which X influences Y. For example, a training program (X) might improve employee performance (Y), but mediation analysis asks how: does the training increase job knowledge (M), which in turn improves performance? If so, knowledge mediates the training-performance relationship. Understanding the mechanism matters because it tells you why something works, not just that it works, and "why" is what you need to replicate, improve, or scale the effect.
Why Mediation Analysis Matters
Knowing that X affects Y is useful, but knowing the pathway is actionable. If you find that customer service training improves retention, that's a finding. If you find that training improves retention because it increases first-contact resolution rate (the mediator), you now know exactly what to measure, optimize, and invest in. Mediation analysis turns correlational insights into mechanistic understanding, which is the difference between knowing what to do and knowing why it works.
How Mediation Analysis Works
The Basic Model
The classic mediation model involves three variables and three paths:
- Path a: the effect of X on the mediator M.
- Path b: the effect of M on Y, controlling for X.
- Path c' (c-prime), the direct effect of X on Y, controlling for M.
- Path c: the total effect of X on Y (without the mediator in the model).
The indirect effect, the effect transmitted through the mediator, is the product a * b. The total effect c equals the direct effect c' plus the indirect effect a * b:
c = c' + (a * b)
The Baron and Kenny Approach
The original and most widely taught approach (Baron and Kenny, 1986) involves four steps:
- Show that X significantly predicts Y (path c).
- Show that X significantly predicts M (path a).
- Show that M significantly predicts Y while controlling for X (path b).
- Show that the effect of X on Y is reduced (partial mediation) or becomes non-significant (full mediation) when M is included.
This approach is intuitive but has known limitations: it requires significant effects at each step, which can fail even when mediation exists (especially with small samples). It also doesn't directly test the significance of the indirect effect.
Modern Approaches: Bootstrapping
Contemporary practice recommends testing the indirect effect (a * b) directly using bootstrapping rather than the stepwise approach. Bootstrapping generates thousands of resamples from your data, calculates the indirect effect in each resample, and constructs a confidence interval. If the confidence interval doesn't include zero, the indirect effect is significant.
Advantages of bootstrapping:
- Doesn't assume the indirect effect is normally distributed (it usually isn't).
- Works with smaller samples than the Sobel test.
- Doesn't require a significant total effect (c) to detect mediation.
- Provides confidence intervals rather than just p-values.
Full vs. Partial Mediation
Full mediation means the entire effect of X on Y operates through the mediator. When M is controlled, the direct effect (c') becomes zero or non-significant. The mechanism completely explains the relationship.
Partial mediation means the mediator explains some but not all of the X-Y relationship. Both the indirect effect (a * b) and the direct effect (c') are significant. Some of the relationship works through the mechanism; some doesn't.
In practice, partial mediation is far more common than full mediation, because most outcomes have multiple mediators and pathways.
Multiple Mediators
Real-world processes rarely involve a single mediator. Customer satisfaction might be driven by service quality through multiple pathways, perceived competence, emotional connection, and problem resolution speed might all serve as parallel mediators. Multiple mediator models test all pathways simultaneously and compare their relative strength, revealing which mechanisms matter most.
Serial mediation involves a chain: X affects M1, which affects M2, which affects Y. Training (X) builds knowledge (M1), knowledge increases confidence (M2), confidence improves performance (Y). The indirect effect through the chain is a1 * a2 * b.
Practical Example
A brand invests in improving its mobile app (X) and wants to understand the impact on customer loyalty (Y). Hypothesized mediators:
- Perceived ease of use (M1): does the improved app increase perceived ease?
- Usage frequency (M2): does greater ease increase how often customers use the app?
- Satisfaction (M3): does increased usage improve satisfaction?
Testing these mediators reveals that ease of use and satisfaction mediate the relationship, but usage frequency doesn't contribute significantly. The implication: the app improvement works by making customers feel the brand is easier to deal with, not by increasing transactional frequency.
When to Use Mediation Analysis
- Understanding mechanisms: when you know X affects Y and need to understand the process through which it happens.
- Program evaluation: testing whether an intervention achieves its outcome through the intended mechanism.
- Customer experience modeling: identifying which intermediary experiences (ease, speed, empathy) transmit the effect of service investments to loyalty outcomes.
- Marketing effectiveness: determining whether advertising works by changing awareness, attitude, consideration, or some other intermediate construct.
- Theory testing: when your theoretical framework specifies a causal chain and you want to test whether the proposed mechanism holds.
Common Mistakes to Avoid
- Requiring a significant total effect before testing mediation: modern methods recognize that mediation can exist even when the total effect is non-significant, especially with opposing mediators (one positive, one negative) that cancel each other out.
- Using the Sobel test instead of bootstrapping: the Sobel test assumes normal distribution of the indirect effect, which is rarely true. Bootstrapping produces more accurate confidence intervals and better statistical power.
- Claiming causal mediation from cross-sectional data: mediation implies a causal chain (X causes M causes Y), but cross-sectional data can't rule out reverse causation or confounders. Longitudinal or experimental designs are needed for strong causal mediation claims.
Quali-Fi Support
Quali-Fi's survey platform lets you build the multi-item scales and sequential question structures that mediation studies require. Collect mediator and outcome data in a single survey with logic and piping, then export to R (mediation, lavaan packages), SPSS PROCESS macro, or Mplus for bootstrapped mediation testing.
Frequently Asked Questions
How large a sample do I need for mediation analysis?
Bootstrapped mediation requires at least 100-200 cases for simple models with medium effect sizes. Complex models with multiple mediators or small effects need 300-500+. Fritz and MacKinnon (2007) provide power tables for specific effect size combinations.
Can I test mediation with categorical variables?
Yes, with modifications. If the mediator or outcome is binary, use logistic regression within the mediation framework. The PROCESS macro and Mplus handle categorical variables natively. The interpretation of indirect effects changes slightly (odds ratios rather than means), but the logic is the same.
What's the difference between a mediator and a confounder?
A mediator sits on the causal path between X and Y, it's part of the mechanism. A confounder causes both X and Y, creating a spurious association. Controlling for a mediator reveals the direct effect; controlling for a confounder removes bias. Misidentifying a confounder as a mediator (or vice versa) produces misleading conclusions.
Related Topics
- Moderation Analysis
- Path Analysis
- Structural Equation Modeling
- Key Driver Analysis
- Data Visualization for Research
- Data Collection Methods
Build the surveys that power mediation research. Start your free 14-day Quali-Fi trial, no credit card required.