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.

If you've landed here with your PROCESS output already in hand and all that's left is turning it into an APA 7 table with the indirect effect, the paths and their bootstrap intervals, the APA 7 mediation table generator builds it straight from those numbers.

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.

Before you submit: the PROCESS output pasted in whole, or a moderated mediation with no index of moderated mediation and no bootstrap interval, is exactly where a reviewer stops on the first read, along with bigger issues you can no longer see because you have lived inside the manuscript for months. If yours is already written, run it through the Q1 Reviewer: a free Reviewer 2 style pre-review that tells you what they will pick on, before it comes back as a desk-rejection.

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 →

Frequently asked questions

Do I need the PROCESS macro or can I use standard SPSS for mediation?

PROCESS (Hayes, 2022) is recommended because it computes bootstrapped confidence intervals for indirect effects, which is the current methodological standard. Standard SPSS does not natively produce bootstrapped indirect effect intervals. You can install PROCESS as a free add-on to SPSS, or use the lavaan package in R as an alternative.

Is the Baron and Kenny method for mediation still accepted?

No. The Baron and Kenny (1986) causal-steps approach is methodologically obsolete. It requires the total effect to be significant before testing for mediation (which is unnecessary) and has low statistical power. The current standard is bootstrapped confidence intervals for the indirect effect (a x b), implemented in PROCESS or lavaan.

How many bootstrap samples should I use for mediation analysis?

A minimum of 5,000 bootstrap samples is standard for published research; 10,000 is increasingly common and produces more stable confidence interval estimates. Report the number of bootstrap samples in your methods section when reporting indirect effects.

What is moderated mediation and how do I test it?

Moderated mediation tests whether the indirect effect of X on Y through M depends on the level of a moderator W. In PROCESS, this corresponds to models 7, 8, 14, or 58 depending on where the moderator acts. Report the index of moderated mediation and its bootstrap confidence interval.

Keep reading

All blog articles