Skip to main content
v2026.11,610 entries · CC-BY 4.0

Direct comparison

Mediator vs Moderator: Which Test Do You Need?

Mediator or moderator? A mediator explains how X affects Y; a moderator sets when and for whom. Different test, different reporting, different assumptions.

Ask about Mediator vs Moderator: Which Test Do You Need?

Answers are drawn from this comparison and the rest of the CASRAI corpus, with a link to every source.

Answers are AI-generated from CASRAI’s own published pages and can be wrong, so check the linked sources before relying on one; your question is logged without personal data — never sold, never used to train a third-party model — to show us what CASRAI is missing, so please do not type personal or confidential details. How we use this

How do Mediator (M), Moderator (W) compare side by side?

The table below compares Mediator (M), Moderator (W) across 14 procurement-relevant dimensions, from question it answers through software route.

Side-by-side comparison

DimensionMediator (M)Moderator (W)
Question it answersHow and why does X affect Y? What is the mechanism that carries the effect?When, for whom, and under what conditions does X affect Y? Where is the effect strong, weak, absent, or reversed?
Position in the causal chainOn the path. X causes M and M causes Y: X to M to Y. Remove M and the effect has no route to travel.Off the path. X does not cause W. W changes the size or the sign of the X-to-Y effect without transmitting it.
The one-question testWould changing X change this variable? If yes, it is a mediator.Is this variable fixed before X occurs, or unchangeable by X (sex, culture, genotype, baseline severity, assigned condition)? Then it is a moderator. The data cannot settle this; it follows from what the variable is.
Measurement timingMust be measured after X and before Y. Measuring X, M, and Y at one time point does not establish that ordering, it assumes it.Measured at or before baseline. Nothing about W needs to sit between X and Y in time.
The model you fitTwo equations. M = i1 + aX, and Y = i2 + (c-prime)X + bM. The indirect effect is the product ab; the direct effect is c-prime; the total effect c = ab + c-prime.One equation with a product term. Y = b0 + b1(X) + b2(W) + b3(XW). The moderation effect is b3, and it is the only coefficient in that model that tests moderation.
The inferential testA bootstrap confidence interval on ab, conventionally 5,000 or more resamples, percentile or bias-corrected. The verdict is "the interval excludes zero", not a p-value attached to ab.A t-test on b3 in the full model, then simple slopes at chosen values of W, or a Johnson-Neyman region of significance when W is continuous and no natural cut points exist.
Must X predict Y first?No. That was step 1 of the Baron and Kenny (1986) causal-steps method and it is obsolete. A real indirect effect can sit inside a null total effect whenever ab and c-prime carry opposite signs.Not applicable. b1 is the conditional effect of X at W = 0, not a gate. A null b1 says nothing about whether b3 is real, and a significant b1 is not evidence of moderation.
The assumption that actually threatens itNo unmeasured confounding of the M-to-Y path, usually called sequential ignorability. It is untestable from the data at hand, and it is not solved by randomising X.Correct functional form and reliable measurement. Unreliability in X or W attenuates the product term more sharply than either main effect, so a genuine interaction can disappear into measurement noise.
What randomising X buys youIt removes confounding of X-to-M and X-to-Y. It leaves M-to-Y confounded, because nobody is randomised to a level of the mediator. Mediation inside an RCT is still an observational claim about the second half of the chain.It removes confounding of the X-to-Y effect at every level of W. This is why moderation analysis inside an RCT rests on far firmer causal ground than mediation analysis in the same trial.
Statistical powerBootstrapping the indirect effect is the highest-power option among the common tests. Fritz and MacKinnon (2007) report N = 71 for 80% power with medium a and medium b using the bias-corrected bootstrap.Usually poor in observational field data. The product term is fitted to the variance left after both main effects, so a design that comfortably detects a main effect can be badly underpowered for the interaction.
Centring the predictorsIrrelevant to identification. a, b, and c-prime are unchanged by centring.Changes what b1 and b2 mean, not whether b3 is significant. Centring leaves b3, its standard error, its t value, and the model R-squared exactly as they were. It is not a remedy for collinearity.
The mistake that gets publishedDeclaring "full mediation" because c-prime is not significant. A non-significant direct effect is absence of evidence, and it is precisely what an underpowered study produces.Claiming moderation from separate subgroup analyses, as in "significant in women, not in men", without ever fitting the product term. A difference in significance is not a significant difference.
What to reporta, b, c-prime, and c with standard errors; ab with its bootstrap CI, the resample count, and the interval type; and an explicit statement of the no-unmeasured-M-to-Y-confounding assumption in the limitations.b3 with its SE, t, and CI; the R-squared change from adding the product term; simple slopes with SEs and p values at defined levels of W; and a plot of the interaction, because the numbers alone hide the shape.
Software routePROCESS model 4 for a simple mediation; lavaan or another SEM package when the mediator is latent; or lm() plus a hand-written bootstrap of ab.PROCESS model 1; lm(y ~ x * w) in R; emmeans or interactions for simple slopes and the Johnson-Neyman region.

Common questions

Common questions about Mediator (M) vs Moderator (W)

How do I tell whether my third variable is a mediator or a moderator?

+

Ask whether changing X would change the variable. If it would, the variable is downstream of X and is a mediator: it carries the effect. If it is fixed before X occurs or cannot be altered by it, such as sex, culture, genotype, baseline severity, or the arm a participant was assigned to, it is a moderator: it conditions the effect. This is a question about what the variables are, not about which model fits better. Two variables with identical correlation matrices can require opposite analyses.

Do I need a significant X-to-Y effect before I can test mediation?

+

No, and requiring one is the most damaging leftover from the causal-steps method. David Kenny, a co-author of the 1986 paper, has since written that the requirement to find an effect from the causal variable to the outcome was a problem, and that MacKinnon et al. (2002) showed the steps approach had low power and recommended using the indirect effect instead. A seeded simulation makes it concrete. With a = 0.50, b = 0.40, and a direct effect of -0.20, the total effect is zero by construction. In 300 simulated cases the X-to-Y regression returned b = 0.071, t = 1.44, p = 0.15, so causal steps stops at step 1 and reports no mediation, while a 5,000-resample percentile bootstrap put the indirect effect at 0.214 with a 95% CI of [0.148, 0.287].

What does a null interaction tell me about a variable I believed was a mediator?

+

Nothing, because they are different tests of different quantities. In the seeded simulation above, where M was constructed as a genuine mediator, adding the X-by-M product term returned b = -0.017, t = -0.38, p = 0.70, a clean null, while the indirect effect through that same M was 0.214 with a bootstrap CI of [0.148, 0.287]. The reverse held for a variable constructed as a true moderator: the interaction was b = 0.455, t = 9.97, p below 0.0001, while the X-to-W path was b = -0.036, p = 0.55 and the implied indirect effect was 0.0008. Running both tests and keeping whichever comes out significant is not a way to discover which role a variable plays; it is a way to capitalise on chance.

Is the Sobel test still acceptable?

+

It is defensible but it should no longer be the default. The Sobel test assumes the sampling distribution of ab is normal. Because ab is a product of two estimates, that distribution is typically skewed, especially at small N, so a symmetric interval is the wrong shape for the quantity. A bootstrap interval makes no normality assumption and is what current guidance recommends. If you report a Sobel z, report a bootstrap CI beside it, and let the interval carry the inference.

Does randomising X make my mediation analysis causal?

+

No, and this is the most common overreach in mediation reporting. Randomising X removes confounding of the X-to-M and X-to-Y paths, which is a real gain. It does nothing whatsoever to the M-to-Y path, because participants are not randomised to a level of the mediator, they arrive at their own. Any common cause of the mediator and the outcome still biases b and therefore ab. Randomisation buys you half the chain.

Is cross-sectional mediation ever adequate?

+

Rarely, and it should be labelled honestly when it is used. Measuring X, M, and Y at a single time point does not establish that M followed X and preceded Y, it assumes it, and the same covariance structure is compatible with several orderings. What you have estimated is a decomposition of covariance, not evidence of a mechanism. Report it as an association consistent with mediation, state the unmeasured-confounding assumption in the limitations rather than in a footnote, and prefer designs that measure the mediator between exposure and outcome, or that manipulate the mediator directly.

Should I mean-centre my predictors before testing an interaction?

+

Centre for interpretability, not for collinearity. Echambadi and Hess (2007) proved analytically that mean-centring leaves the interaction coefficient, its standard error, its t value, and the model R-squared unchanged, because the determinant of the cross-product matrix is identical for centred and uncentred data. In a seeded 300-case simulation the uncentred and centred product terms both returned b = 0.4547, SE = 0.0456, t = 9.97, with R-squared = 0.334588 either way. What centring does change is the meaning of the lower-order terms: b1 becomes the effect of X at the mean of W rather than at W = 0, which is usually the quantity you actually wanted to read.

How do I report a moderation once the interaction is significant?

+

The product term tells you the effect of X changes across W; it does not tell you where the effect exists. Probe it. In the seeded simulation the interaction was b = 0.455, and the simple slope of X on Y was -0.118 at one SD below the mean of W (t = -1.78, p = 0.077, not distinguishable from zero), 0.336 at the mean (t = 6.99), and 0.789 at one SD above (t = 11.93). The same predictor is inert in one part of the sample and strong in another, which is the finding, and it is invisible from b3 alone. Report the simple slopes with their standard errors and plot the interaction.

Can a variable be both a mediator and a moderator?

+

Not in the same role in the same model, but a model can contain both. Moderated mediation asks whether an indirect effect differs across levels of a moderator; the quantity to test is the index of moderated mediation with a bootstrap CI, not a comparison of whether the conditional indirect effect is separately significant in each group. Mediated moderation asks whether an interaction effect is itself transmitted through a mediator. Fit either only when the hypothesis genuinely names both roles. Adding a moderator to rescue a null indirect effect is a fishing expedition, and it is detectable as one.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Regulatory Radar

Stop finding out after the fact

$29/month, cancel anytime. Daily digest updates from our analysis, a dashboard holding the same items, and a cited assistant for everything they raise.

  • Federal Register, Federal Register+, Grants.gov, Regulations.gov, NSF News, UKRI, plus CASRAI’s own published content.
  • 44,322 indexed passages, and every answer cites the ones it drew on.