Mediation and Moderation with the PROCESS Macro (SPSS and R) Step by Step

Mediation and moderation are two of the most used (and most confused) analyses in psychology, education and health theses. Both go beyond "X is related to Y", but they answer different questions, and mixing them up is a common reason for committee corrections. This guide clarifies the distinction and shows how to analyze both correctly with the PROCESS macro, the current standard in both SPSS and R.

Mediation and moderation are not the same thing

Mediation asks "why" or "how": a variable X affects a mediator M, which in turn affects Y (X to M to Y). The mediator is the mechanism. For example, social support (X) reduces depression (Y) because it increases self-efficacy (M).

Moderation asks "when" or "for whom": the effect of X on Y changes depending on the level of a third variable W. For example, an intervention (X) reduces anxiety (Y) more in women than in men (W moderates the effect). Statistically, a moderation is an X-by-W interaction term. Confusing the two is the number-one conceptual error: if your question is about the mechanism, it is mediation; if it is about the condition, it is moderation.

Forget Baron and Kenny: the current approach

For decades, mediation was analyzed with the Baron and Kenny four-step procedure and the Sobel test. Both are now superseded: they have low power and assume that the indirect effect is normally distributed, which is almost never the case. The current standard is to estimate the indirect effect directly (the product of the paths, ab) and calculate its confidence interval via bootstrapping (resampling, typically 5,000 iterations). If the bootstrap interval does not include zero, the mediation is significant. This approach, popularized by Preacher and Hayes, is what reviewers expect.

PROCESS step by step

Hayes's PROCESS macro implements all of this in SPSS and R with the same logic. The workflow is:

  1. Install PROCESS (in SPSS it loads as a custom dialog or a macro; in R it is the processR package or its equivalent in lavaan).
  2. Choose the model number that matches your design: model 4 is simple mediation, model 1 is simple moderation, and models 7, 8 or 14 are moderated mediation (combining both).
  3. Specify your X, your Y, the mediator (M) or the moderator (W), and any covariates.
  4. Enable bootstrap confidence intervals (percentile by default, 5,000 samples).

PROCESS returns the paths (a, b, c'), the indirect effect with its bootstrap interval, and in moderated mediation models the index of moderated mediation, which tells you whether the indirect effect changes across levels of the moderator.

How to interpret the results

In mediation: look at the indirect effect (ab) and its bootstrap interval. If it does not contain zero, mediation is supported. The direct effect (c') tells you whether any X-to-Y relationship remains after accounting for the mediator: if c' is still significant, the mediation is partial; if not, it is complete. In moderation: look at the interaction term and, if significant, examine the conditional effects (the effect of X on Y at specific values of W, what PROCESS calls "simple slopes").

A note on causality

Mediation and moderation are causal models, but with cross-sectional data (measured at a single time point) you cannot demonstrate causality no matter how many bootstrap samples you use. A significant indirect effect with cross-sectional data is consistent with your hypothesis, not proof that X causes M which causes Y. Be honest about this in your Discussion: it is one of the first things a good reviewer checks.

Common errors

Confusing mediation with moderation; continuing to use the Baron-Kenny steps or the Sobel test; interpreting an indirect effect as proof of causality with cross-sectional data; running out of power (bootstrapping needs a reasonable sample; calculate the sample size a priori); and not reporting the bootstrap interval. For the write-up format, the guide on how to report mediation in APA 7 covers which numbers go where, and the article on mediation and moderation mechanisms goes deeper into the conceptual model. The overall analysis workflow is in how to analyze thesis data step by step.

Does your thesis include a mediation or moderation model?

I am a PhD in Psychology and I run your mediation, moderation and moderated mediation models with PROCESS or lavaan, with the indirect effect, bootstrap intervals and APA write-up ready for your committee or reviewer. Free initial diagnosis.

See the statistical consulting →

Keep reading

All blog articles