Mediation vs Moderation: How to Test and Report Each (With Examples)

If you have ever mixed up mediation and moderation, you are in good company. Even experienced researchers pause over these two. They sound similar, they both involve a third variable, and they both show up in almost every thesis that goes beyond a simple cause-and-effect question. But they answer completely different questions, and confusing them is one of the fastest ways to lose marks in a viva.

In this guide, you will learn what each one means in plain English, how to test each one step by step, and how to report the results in APA style — with a worked example for each.

Mediation vs Moderation at a Glance

Here is the shortest version of the difference:

  • Mediation answers “how” or “why.” It explains the mechanism through which one variable affects another. X affects M, and M affects Y.
  • Moderation answers “when” or “for whom.” It describes the conditions under which an effect is stronger, weaker, or even reversed. The moderator changes the strength or direction of the X to Y relationship.

Think of it this way. Suppose revision time improves exam scores. A mediator would be understanding of the material: revising builds understanding, and understanding raises the score. A moderator would be sleep quality: revising helps a lot when you are well rested, and barely helps at all when you are exhausted. Same variables, totally different roles.

What Is Mediation?

Mediation describes a chain. An independent variable (X) influences a mediator (M), which in turn influences the dependent variable (Y). The effect of X on Y travels, at least partly, through M.

Researchers describe this chain with three paths:

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

The indirect effect is path a multiplied by path b. It tells you how much of X’s influence on Y flows through the mediator. The total effect (path c) is the overall effect of X on Y before the mediator is taken into account.

If the indirect effect is significant but the direct effect is no longer significant once the mediator is included, researchers often call this full mediation. If both the indirect effect and the direct effect remain significant, it is partial mediation — the mediator explains part, but not all, of the story.

How to Test Mediation: Step by Step

The classic framework comes from Baron and Kenny (1986), but modern practice adds one crucial improvement: testing the indirect effect directly with bootstrapping. Here is the full sequence.

Step 1: Test the total effect (X to Y)

Regress Y on X. This establishes that there is an overall relationship worth explaining. Note that modern researchers no longer treat this step as a strict requirement (see the FAQ below), but it is still a sensible starting point.

Step 2: Test path a (X to M)

Regress the mediator M on X. If X does not predict M, there is no chain to speak of, and mediation is unlikely.

Step 3: Test path b and the direct effect together

Regress Y on both X and M at the same time. The coefficient for M is path b. The coefficient for X in this model is the direct effect (path c-prime). If path b is significant, the mediator predicts the outcome even after accounting for X.

Step 4: Test the indirect effect with bootstrapping

This is the step that matters most today. Multiply path a by path b, then use bootstrapping — resampling your data thousands of times — to build a confidence interval for that product. If the confidence interval does not include zero, the indirect effect is significant. The older Sobel test is still mentioned in textbooks, but bootstrapping is preferred because the indirect effect is rarely normally distributed. In SPSS, the PROCESS macro (Model 4) does all of this in one run; in R, the mediation package does the same job.

Worked example: mediation (illustrative numbers)

Imagine a study of 200 students testing whether revision time (X) improves exam scores (Y) through understanding of the material (M). The numbers below are made up for teaching purposes, but the pattern is exactly what you would look for in real output:

  • Path a: revision time predicts understanding, b = 0.45, p < .001.
  • Path b: understanding predicts exam score controlling for revision time, b = 0.60, p < .001.
  • Indirect effect: 0.45 x 0.60 = 0.27, with a bootstrapped 95% confidence interval of [0.14, 0.42]. Because the interval does not include zero, the indirect effect is significant.
  • Direct effect: once understanding is in the model, revision time’s direct coefficient drops to b = 0.18, p = .12 (not significant).

Conclusion: understanding fully mediates the relationship. Revision helps exam scores mainly because it builds understanding, not through some other route.

What Is Moderation?

Moderation describes a boundary condition. A moderator (W) changes the strength or direction of the relationship between X and Y. The effect of X on Y is not one fixed number — it depends on the level of W.

Unlike a mediator, a moderator does not sit in a chain between X and Y. It stands beside the relationship and turns its volume up or down. In our example, sleep quality does not cause revision time or exam scores in a chain; instead, it changes how much revision time pays off.

How to Test Moderation: Step by Step

Step 1: Centre your predictors

Subtract the mean from X and from the moderator W (or standardise them). Centring reduces multicollinearity between the predictors and their interaction term, and it makes the coefficients much easier to interpret: the coefficient for X then means the effect of X at the average level of the moderator.

Step 2: Create the interaction term

Multiply the centred X by the centred moderator to create a new variable, X x W. This term is the statistical heart of moderation analysis.

Step 3: Run the regression

Regress Y on X, W, and the interaction term X x W, all in the same model. If the interaction term is significant, moderation is present: the effect of X on Y genuinely differs across levels of W.

Step 4: Probe the interaction with simple slopes

A significant interaction only tells you that the effect varies; it does not tell you how. So examine the effect of X on Y at low, average, and high values of the moderator (usually one standard deviation below the mean, the mean, and one standard deviation above it). Plotting these simple slopes makes the pattern immediately visible — and examiners love a clean interaction plot.

Worked example: moderation (illustrative numbers)

Using the same 200 students, now test whether sleep quality (W) moderates the effect of revision time (X) on exam scores (Y). Again, these numbers are illustrative:

  • The interaction term (revision time x sleep quality) is significant, b = 0.32, p = .004. Moderation is present.
  • Simple slopes: for students with poor sleep quality, revision time barely predicts scores, b = 0.10, p = .38 (not significant). For students with good sleep quality, revision time strongly predicts scores, b = 0.58, p < .001.

Conclusion: revision pays off mainly for well-rested students. For sleep-deprived students, extra hours barely move the score. That is a finding with a very practical message — and it is completely different from the mediation story above.

Mediation vs Moderation: Comparison Table

MediationModeration
Question answeredHow or why does X affect Y?When, or for whom, does X affect Y?
Role of the third variableCarries the effect (X to M to Y)Changes the effect (X to Y differs by W)
Key statistical testIndirect effect (a x b), tested with bootstrappingInteraction term (X x W) in regression
Follow-up analysisFull vs partial mediationSimple slopes at low, mean, and high moderator values
Typical softwarePROCESS Model 4 (SPSS), mediation package (R)PROCESS Model 1 (SPSS), or manual regression with an interaction term

How to Report Mediation Results in APA Style

Report the paths, the indirect effect, and its bootstrapped confidence interval — not just p-values. Example paragraph (adapt the numbers to your own output):

“Understanding of the material mediated the relationship between revision time and exam score. Revision time predicted understanding (b = 0.45, p < .001), and understanding predicted exam score controlling for revision time (b = 0.60, p < .001). The indirect effect was significant, b = 0.27, 95% CI [0.14, 0.42], based on 5,000 bootstrap samples. The direct effect of revision time on exam score was no longer significant after accounting for the mediator (b = 0.18, p = .12), consistent with full mediation.”

How to Report Moderation Results in APA Style

Report the interaction term first, then the simple slopes that explain it. Example paragraph:

“Sleep quality moderated the relationship between revision time and exam score, as shown by a significant interaction, b = 0.32, p = .004. Simple slopes analysis showed that revision time predicted exam score for students with good sleep quality (b = 0.58, p < .001) but not for students with poor sleep quality (b = 0.10, p = .38). Revision time therefore improved scores mainly among well-rested students.”

Common Mistakes to Avoid

  • Swapping the two concepts. If your third variable explains the mechanism, it is a mediator. If it changes the strength of the effect, it is a moderator. Naming it correctly is half the battle in a viva.
  • Claiming causation from cross-sectional data. Mediation analysis on data collected at one point in time cannot prove a causal chain, however significant the indirect effect looks. Be honest about this limitation, or better, use longitudinal or experimental designs when you can.
  • Stopping at the Baron and Kenny steps. Showing that each path is significant is not enough on its own. Modern reviewers expect a direct test of the indirect effect with a bootstrapped confidence interval.
  • Forgetting to centre predictors in moderation. Without centring, the coefficients for X and W describe effects when the other variable equals zero — which may be a meaningless value (a sleep-quality score of zero, for instance).
  • Reporting a significant interaction without probing it. “The interaction was significant” tells the reader almost nothing. Always follow up with simple slopes and, ideally, a plot.
  • Assuming a non-significant total effect rules out mediation. An indirect effect can exist even when the total effect is not significant — for example, when two indirect paths cancel each other out. Test the indirect effect directly.

Frequently Asked Questions

Can a variable be both a mediator and a moderator?

Not in the same model for the same relationship, because the two roles are logically different — one carries an effect, the other conditions it. But a variable can mediate one relationship and moderate another, and researchers sometimes test moderated mediation, where the indirect effect itself differs across levels of a moderator.

Do I need a significant total effect before testing mediation?

Not under modern practice. The Baron and Kenny framework originally required it, but current guidance is that a significant indirect effect is the key evidence. If the total effect is not significant, check whether competing indirect paths might be cancelling each other out.

What software do I need?

For most thesis work, SPSS with the free PROCESS macro covers both analyses (Model 4 for mediation, Model 1 for moderation). R users can use the mediation package for mediation and ordinary regression with an interaction term for moderation. Either route is fully acceptable to examiners.

How large a sample do I need?

There is no single magic number, because it depends on the size of the effects you are looking for. As a general rule, mediation and moderation analyses need larger samples than simple correlations, because indirect effects and interaction terms are harder to detect. Bootstrapping helps with smaller samples, but it is no substitute for adequate power — run a power analysis before collecting data, and treat any indirect effect from a very small sample with caution.

Which one should I use in my thesis?

Let your research question decide. If you are asking “why does this intervention work?” you probably need mediation. If you are asking “does this intervention work better for some people than others?” you probably need moderation. Many strong theses test both, but each needs its own hypothesis, analysis, and interpretation.

The Bottom Line

Mediation explains the mechanism; moderation explains the conditions. One asks how, the other asks when. Test mediation by examining the indirect effect with bootstrapping, test moderation by testing an interaction term and probing its simple slopes, and report both with the numbers your reader needs to judge the result — coefficients, confidence intervals, and p-values. Get these two right, and you will handle one of the most common viva questions with confidence.

Leave a Comment