How to Run Mediation Analysis and Report the Indirect Effect: A Beginner's Guide with APA 7 Example

To run mediation analysis, you test whether X affects Y through a middle variable M by estimating the indirect effect (path a × path b) and checking that its bootstrapped 95% confidence interval excludes zero. You report it as, for example, "indirect effect = −0.17, 95% CI [−0.28, −0.08]." Many students learn the older four-step Baron and Kenny method and then get reviewer comments asking for a bootstrapped indirect effect. This guide shows the modern approach, step by step.

Key Takeaways

  • Mediation analysis tests whether an independent variable (X) influences an outcome (Y) through a mediator (M).
  • The indirect effect equals path a (X → M) multiplied by path b (M → Y, controlling for X).
  • Bootstrapped confidence intervals, typically based on 5,000 resamples, are the current standard for testing the indirect effect.
  • An indirect effect is significant when its 95% confidence interval does not contain zero.
  • APA 7 reporting should include the a, b, c, and c′ paths and the indirect effect with its confidence interval.

What Is Mediation Analysis and When Would You Use It?

Mediation analysis explains how or why one variable affects another by testing whether the effect passes through an intermediate variable. Use it when your research question has the form "X leads to Y because X changes M."

Here is an example. A mindfulness program (X) reduces anxiety (Y). The theory proposes that it works by reducing rumination (M). Mediation analysis tests that mechanism directly.

Mediation is often confused with moderation. Moderation asks when or for whom an effect is stronger. Mediation asks how the effect happens. If you are unsure which one you need, see our guide on moderation vs mediation.

What Are the Paths in a Mediation Model?

A simple mediation model has four paths. Each one is estimated with regression.

  • Path a: the effect of X on M.
  • Path b: the effect of M on Y, controlling for X.
  • Path c (total effect): the effect of X on Y, ignoring M.
  • Path c′ (direct effect): the effect of X on Y, controlling for M.

The indirect effect is a × b, and it always satisfies c = c′ + ab. If c′ shrinks toward zero while ab is significant, part of X's influence travels through M.

Which Method Should I Use to Test the Indirect Effect?

You will see three approaches in published papers. Only one is current best practice.

Method How it works Strength Weakness
Baron & Kenny (1986) Four sequential regression steps Intuitive Never tests ab directly; requires significant c
Sobel test z-test of ab Gives a p value Assumes ab is normally distributed, which is rarely true; low power
Bootstrapping Resamples data thousands of times to build a CI for ab No normality assumption; higher power Results vary slightly between runs

Bootstrapping is the recommended method because the sampling distribution of ab is usually skewed, so normal-theory tests like Sobel are unreliable. Andrew Hayes' PROCESS macro (Model 4) popularised this approach for SPSS users. R users typically rely on lavaan or the mediation package, and both jamovi (via the medmod module) and JASP offer point-and-click mediation.

How Do You Run Mediation Analysis Step by Step?

  1. Check assumptions. The X → M and M → Y relationships should be roughly linear, and residuals should be approximately normal. Mediation also assumes a causal order, so your design or theory must justify X → M → Y.
  2. Estimate path a. Regress M on X.
  3. Estimate paths b and c′. Regress Y on both X and M.
  4. Estimate path c. Regress Y on X alone. This path is optional for inference but useful for reporting.
  5. Bootstrap the indirect effect. Resample 5,000 times and compute the 95% percentile CI for ab.
  6. Interpret. If the CI excludes zero, the indirect effect is significant.

Doing this in SPSS means installing PROCESS and parsing pages of output. A full SPSS licence also costs roughly $99 per month on subscription. StatRyx runs the regressions and bootstrapping in one step and returns the paths with an APA-formatted paragraph.

Worked Example: Mindfulness, Rumination, and Anxiety

A researcher randomises 120 adults to mindfulness training or a waitlist (X: 1 = training, 0 = waitlist). Rumination (M) and anxiety (Y) are measured afterwards. The unstandardised results are:

  • Path a: b = −0.45, SE = 0.12, p < .001. Training reduced rumination.
  • Path b: b = 0.38, SE = 0.09, p < .001. Higher rumination predicted higher anxiety, controlling for condition.
  • Total effect c: b = −0.31, p = .009.
  • Direct effect c′: b = −0.14, p = .210.
  • Indirect effect ab: −0.45 × 0.38 = −0.17, 95% bootstrap CI [−0.28, −0.08], based on 5,000 resamples.

What the numbers mean. The indirect effect is −0.17, and its CI excludes zero, so mindfulness reduced anxiety through reduced rumination. The check holds: −0.14 + (−0.17) ≈ −0.31. The direct effect is no longer significant once rumination is included. Rather than calling this "full mediation," modern guidance reports the size of the indirect effect, because the full-versus-partial distinction depends heavily on sample size.

How Do You Report the Indirect Effect in APA 7?

Report all paths with unstandardised coefficients, then the indirect effect with its bootstrapped 95% CI and the number of resamples. Here is a template:

A simple mediation analysis was conducted using ordinary least squares regression with 5,000 bootstrap resamples. Mindfulness training was associated with lower rumination, b = −0.45, SE = 0.12, p < .001, and rumination was associated with higher anxiety controlling for condition, b = 0.38, SE = 0.09, p < .001. The total effect of training on anxiety was significant, b = −0.31, p = .009, but the direct effect was not, b = −0.14, p = .210. The indirect effect through rumination was significant, ab = −0.17, 95% CI [−0.28, −0.08].

Italicise b, SE, and p. Drop the leading zero on p. Include a path diagram as a figure if your journal allows one. StatRyx generates this paragraph automatically from your data, which saves the usual hour of copying coefficients out of PROCESS output.

What Mistakes Should You Avoid?

  • Claiming causation from cross-sectional data. Mediation implies a causal sequence. With correlational data, describe your result as "consistent with" mediation.
  • Requiring a significant total effect. An indirect effect can exist even when c is not significant, for example when opposing pathways cancel each other out.
  • Reporting only a p value for ab. Reviewers expect the bootstrapped CI.
  • Forgetting to state the number of resamples and the CI type (percentile or bias-corrected).

Stop calculating this by hand — run it free in StatRyx → Try StatRyx

Frequently Asked Questions

What sample size do I need for mediation analysis?

Simulation work by Fritz and MacKinnon (2007) suggests that bootstrapped mediation needs roughly 70 to 150 participants to detect medium a and b paths with 80% power. Small effects can require several hundred participants. Run a power analysis for the indirect effect before collecting data.

Is the Sobel test still acceptable?

The Sobel test is generally considered outdated. It assumes the indirect effect is normally distributed, which is rarely the case, and this makes it underpowered. Most reviewers now expect bootstrapped confidence intervals instead.

How do I know if the indirect effect is significant?

The indirect effect is significant at the .05 level when its 95% bootstrap confidence interval does not include zero. For example, [−0.28, −0.08] is significant, while [−0.20, 0.03] is not.

Can I use standardised coefficients when reporting mediation?

Yes, but report unstandardised coefficients as the primary results, because they keep the original units. You can add a completely standardised indirect effect as an effect size, and state clearly which one you are reporting.

What is the easiest way to run mediation without SPSS?

JASP and jamovi offer free point-and-click mediation, and R gives full control through lavaan. StatRyx is an AI-powered statistical analysis tool that replaces manual SPSS workflows with automated, APA 7-formatted reporting. It runs bootstrapped mediation and writes up the indirect effect for you.

Stop calculating this by hand. Upload your dataset and StatRyx's AI runs the correct test and returns copy-paste-ready APA 7 output in seconds — no SPSS license, no syntax.

Run your data through StatRyx free →
← All posts