Research methods guide

Mediator vs Moderator: The Difference, with Diagrams

A mediator explains how or why an independent variable affects an outcome: X changes the mediator, and the mediator changes Y. A moderator changes when or for whom the effect holds: it strengthens, weakens or reverses the X → Y relationship, and X does not cause it.

Last updated

What is the difference between a mediator and a moderator?

Both are third variables in a relationship between an independent variable (X) and a dependent variable (Y), but they answer different questions. A mediator sits in the middle of the causal chain and answers how or why X affects Y. A moderator sits outside the chain and answers when, for whom or under what conditions X affects Y. A short way to remember it: a mediator is in the middle; a moderator modifies.

Mediator (M)Moderator (W)
Question it answersHow or why does X affect Y?When, or for whom, does X affect Y?
Is it caused by X?Yes: X → M → YNo: it is usually measured before X or is a fixed trait
Where it goes in the diagramOn the path, between X and YAbove or below, with an arrow pointing at the X → Y path
What the hypothesis says"X affects Y through M""The effect of X on Y is stronger when W is high"
How it is usually testedIndirect effect (a × b) with a bootstrap confidence intervalInteraction term (X × W) in a regression
ExampleSocial support → self-efficacy → academic performanceWorkload → burnout, weaker when supervisor support is high

The distinction goes back to Baron and Kenny (1986), who argued that the two are often confused and need different designs and analyses.

What is a mediator variable? Example and diagram

A mediator variable is the mechanism that carries the effect of X to Y. X changes the mediator, and the mediator in turn changes Y. If the whole effect runs through the mediator, the mediation is called full; if X still affects Y directly as well, it is partial.

Example: students with more social support feel more capable (self-efficacy), and students who feel more capable perform better. Self-efficacy is the reason social support matters, so it is the mediator.

Simple mediation model: social support leads to self-efficacy (H2), self-efficacy leads to academic performance (H3), and social support also leads directly to academic performance (H1)

Description used: Mediation model. Social support (independent variable) predicts academic performance (dependent variable) (H1). Self-efficacy mediates the relationship: social support predicts self-efficacy (H2), and self-efficacy predicts academic performance (H3).

Open this example in the generator

In statistics texts the three arrows have letters: X → M is path a, M → Y is path b, and the direct X → Y path is c′. The indirect effect is a × b. In Hayes' PROCESS macro this is Model 4.

What is a moderator variable? Example and diagram

A moderator variable changes the strength or direction of the relationship between X and Y. It does not sit between them; it describes the conditions under which the relationship is stronger, weaker or reversed. Moderators are often traits or contexts that exist before X: age, gender, culture, team size, prior experience. A moderator can be categorical (gender, country, treatment group) or continuous (age, years of experience, team size), and Baron and Kenny (1986) recommend that it be unrelated to X.

Example: a heavier workload raises burnout, but less so for employees whose supervisors support them. Supervisor support does not explain why workload causes burnout; it changes how much it does. It is the moderator.

Simple moderation model: workload leads to burnout (H1), and supervisor support has an arrow pointing at the middle of that path (H2)

Description used: Moderation model. Workload (independent variable) predicts burnout (dependent variable) (H1). Supervisor support moderates the relationship between workload and burnout (H2).

Open this example in the generator

The moderator's arrow points at the middle of the X → Y arrow, not at Y, because the hypothesis is about the relationship. Statistically, moderation is an interaction: you test the X × W term in a regression. In PROCESS this is Model 1.

How to tell whether your variable is a mediator or a moderator

Ask these three questions about the third variable in your study:

  1. Can X change it? If the independent variable plausibly causes the third variable, it can be a mediator. If X cannot change it (age cannot be changed by workload), it is a candidate moderator.
  2. When is it measured? A mediator has to come after X and before Y in time. A moderator is usually measured before X or at the same time, often as a stable trait.
  3. What does your hypothesis say? "Through", "because of" and "explains" describe mediation. "Depends on", "stronger when", "only for" and "buffers" describe moderation.

The same construct can play either role in different studies. Self-efficacy is a mediator if training raises it and it then raises performance; it is a moderator if you ask whether training works better for students who already have high self-efficacy. Decide from your theory, then draw it in the matching position.

Quick check. (1) A researcher proposes that stress raises rumination, and rumination raises insomnia. Rumination is a ___. (2) A researcher proposes that exercise lowers anxiety more for older adults than for younger adults. Age is a ___. (3) A researcher proposes that coaching improves sales because it increases product knowledge. Product knowledge is a ___. Answers: mediator, moderator, mediator.

Mediator vs moderator vs confounder

A confounder is a third variable that affects both X and Y, so the two look related even when X does not cause Y. A mediator is caused by X and carries its effect to Y; a moderator changes how strongly X and Y are related; a confounder has to be controlled, because otherwise the X–Y association may not be causal. In a conceptual framework, a confounder is drawn as a control variable (a dashed line, or listed under the figure), not on the X → Y path.

Parallel mediation: two or more mediators

A study can test several mechanisms at once. In a parallel mediation model each mediator has its own path from X and its own path to Y, and the mediators do not affect each other. (When one mediator leads to the next, the model is serial mediation instead.)

Parallel mediation model: perceived organizational support leads to job satisfaction (H2) and organizational commitment (H3), both lead to turnover intention (H4, H5), and perceived organizational support also leads directly to turnover intention (H1)

Description used: Parallel mediation model. Perceived organizational support (independent variable) predicts turnover intention (dependent variable) (H1). Job satisfaction and organizational commitment are two parallel mediators: perceived organizational support predicts job satisfaction (H2) and organizational commitment (H3); job satisfaction predicts turnover intention (H4); organizational commitment predicts turnover intention (H5).

Open this example in the generator

Preacher and Hayes (2008) describe how to test and compare the specific indirect effect through each mediator. In PROCESS, parallel mediators also use Model 4.

Moderated mediation: when a moderator changes the indirect effect

Mediation and moderation can be combined. In moderated mediation, a moderator changes one of the paths in a mediation model, so the indirect effect is stronger for some people than for others. The example below moderates the first stage (X → M): transformational leadership builds psychological safety, but perhaps less in large teams.

Moderated mediation model: transformational leadership leads to psychological safety (H2), psychological safety leads to employee voice (H3), transformational leadership leads directly to employee voice (H1), and team size points at the leadership to psychological safety path (H4)

Description used: Moderated mediation model. Transformational leadership (independent variable) predicts employee voice (dependent variable) (H1). Psychological safety mediates the relationship: transformational leadership predicts psychological safety (H2), and psychological safety predicts employee voice (H3). Team size moderates the relationship between transformational leadership and psychological safety (H4).

Open this example in the generator

This is PROCESS Model 7. If the moderator acts on the second stage (M → Y) instead, it is Model 14; the drawing changes only in where the moderator's arrow points.

How to draw a mediation or moderation model in your thesis

Conceptual models in theses and papers follow a few conventions, and examiners notice when they are missing:

  • Independent variables on the left, dependent variable on the right, mediators between them.
  • A moderator's arrow points at the path it changes, not at a box.
  • Each arrow carries its hypothesis number (H1, H2, …) so the figure and the hypothesis list can be read together.
  • Control variables, if shown, are drawn with dashed lines or listed under the figure.
  • The caption names the model, for example "Figure 2. Conceptual model: the mediating role of self-efficacy", and cites the theory it is adapted from.

To draw yours, describe it in the conceptual framework generator the way the descriptions on this page are written: name each variable's role (independent, dependent, mediator, moderator, control) and put the hypothesis number after each relationship. The generator lays out the boxes and arrows following these conventions. For more full models by field, see the conceptual framework examples; for models based on a published theory, see the theoretical framework examples.

How these diagrams were made, and what to check

The four diagrams on this page came out of the conceptual framework generator from the description printed under each. A text model read the description into variables, roles and paths; code then laid out the boxes and arrows and set the labels in type, so the words appear as written. The figures were not edited by hand; the images are only cropped to the figure.

Before you use one, check the model's reading: it decides which variable is which and where each arrow goes, so compare every arrow with your hypotheses. Descriptions in Chinese, Japanese or Korean, and uploaded sketches, are drawn by an image model instead of the code layout, so proofread every label in those. See accuracy and limits for more.

Common mistakes with mediators and moderators

  • Calling a demographic variable a mediator. Gender or age cannot be changed by X, so they cannot carry its effect. They are moderators or controls.
  • Pointing the moderator at Y. That draws a second independent variable, not a moderator. The arrow goes to the middle of the X → Y path.
  • Claiming mediation from cross-sectional data without caveats. Mediation is a causal claim about a sequence. If X, M and Y were measured at the same time, say that the design supports, but does not prove, the order.
  • Requiring a significant X → Y effect before testing mediation. Baron and Kenny's first step asked for it, but later work (for example Hayes, 2022) tests the indirect effect directly, because an indirect effect can exist without a significant total effect.
  • Reading a non-significant interaction as "no moderation". Interaction effects need larger samples to detect than main effects (McClelland & Judd, 1993), so a non-significant X × W term in a small study is inconclusive, not evidence against the moderator.
  • Hypotheses and figure that do not match. Every arrow should have a hypothesis and every hypothesis an arrow, with the same numbers.

Sources

  • Baron, R. M., & Kenny, D. A. (1986). The moderator–mediator variable distinction in social psychological research: Conceptual, strategic, and statistical considerations. Journal of Personality and Social Psychology, 51(6), 1173–1182.
  • McClelland, G. H., & Judd, C. M. (1993). Statistical difficulties of detecting interactions and moderator effects. Psychological Bulletin, 114(2), 376–390.
  • Preacher, K. J., & Hayes, A. F. (2008). Asymptotic and resampling strategies for assessing and comparing indirect effects in multiple mediator models. Behavior Research Methods, 40(3), 879–891.
  • Hayes, A. F. (2022). Introduction to Mediation, Moderation, and Conditional Process Analysis: A Regression-Based Approach (3rd ed.). Guilford Press.

Mediator vs moderator: frequently asked questions

What is the main difference between a mediator and a moderator?

A mediator explains how or why X affects Y, because X changes the mediator and the mediator changes Y. A moderator changes the strength or direction of the X–Y relationship, so it tells you when or for whom the effect holds. X causes a mediator; X does not cause a moderator.

Why add a mediator or moderator to your conceptual framework?

A mediator lets your study test the mechanism behind an effect, which is what examiners mean when they ask why X affects Y. A moderator tests the boundary conditions: for whom, or in which settings, the effect holds, which tells readers how far your findings generalize. Add one only when your theory predicts it; a mediator or moderator added after seeing the data is hard to defend.

Can a variable be both a mediator and a moderator?

Not in the same path of the same model, but the same construct can play either role in different studies. Self-efficacy is a mediator when an intervention raises it and it raises performance, and a moderator when you ask whether the intervention works better for people who already have high self-efficacy.

How do I draw a moderator in a conceptual framework?

Put the moderator in its own box above or below the X → Y arrow and draw its arrow to the middle of that arrow, not to Y. Label it with its hypothesis number. The moderation diagram on this page shows the layout.

Is age a mediator or a moderator?

Age is almost always a moderator or a control variable. A mediator has to be changed by the independent variable, and nothing in a typical study changes a participant's age.

What is moderated mediation?

A model in which a moderator changes one of the paths of a mediation model, so the indirect effect differs across levels of the moderator. When the moderator acts on the X → M path it is Hayes' PROCESS Model 7; on the M → Y path it is Model 14.

Is it free to draw a mediation or moderation diagram?

Watermark-free downloads, 4K and an editable SVG are paid, because running the models costs money. Plans start at $14.90 a month, and one-time credit packs start at $19.90 for 150 credits and never renew. You can generate your first figure without an account and download a watermarked PNG; signing up adds free credits (fewer in some countries) and daily check-in credits, which expire after 30 days. If you need a free route, you can draw the same boxes and arrows by hand in PowerPoint, Word or draw.io, placing each arrow and label yourself.

Draw the model for your study

Name your variables and their roles, add your hypothesis numbers, and the boxes and arrows are laid out for you.

Featured on Findly.tools