Mediation and moderation analysis online
Mediation is supported when the bootstrap confidence interval of the indirect effect a × b excludes zero, with no need for a significant total effect first (Zhao, Lynch & Chen, 2010). Upload your survey, pick X, M, W, Y and covariates, and get PROCESS-style OLS estimates (Models 4, 6, 1, 7), percentile bootstrap intervals, interaction and Johnson–Neyman plots, and a ready-to-edit Results section you can download as Word.
- Upload an Excel or CSV file (or try the sample data)
- Choose the model and the X, M, W, Y variables
- Run 5,000 bootstrap samples and download the write-up
CODE: item1 item2 …. Keep only the items retained after Cronbach's alpha and EFA.Was this tool useful? Feedback / report a bug (by email; please do not paste real data).
Which PROCESS model do you need?
- Model 4: simple or parallel mediation. For hypotheses of the form “X affects Y through M”. You can enter two to four mediators at once when they do not affect each other, for example service quality → (satisfaction, trust) → loyalty. Estimating them together is better than running one mediator at a time (Preacher & Hayes, 2008).
- Model 6: serial mediation. When theory says M1 leads to M2, for example satisfaction → trust → loyalty. You get three indirect effects: through M1, through the chain M1 → M2, and through M2. The order of M1 and M2 must come from theory, not from the results.
- Model 1: moderation. For hypotheses such as “the effect of X on Y is stronger (or weaker) when W is high”. W can be a construct score or a binary variable such as gender.
- Model 7: first-stage moderated mediation. W moderates the X → M path, so the indirect effect X → M → Y changes with W. The conclusion rests on the index of moderated mediation (Hayes, 2015).
Fix your hypotheses before you run anything; do not try every combination of X, M and W and keep whichever is significant.
How to use it
- Upload an Excel or CSV file with one row per respondent. Name items with a construct code plus a number (CL1, CL2…); the tool scores each construct as the mean of its items. Drop the items you removed after Cronbach's alpha and EFA, and list any reverse-worded items.
- Choose the model, X, Y, the mediators, the moderator and any covariates. Covariates enter every equation, as in PROCESS by default.
- Keep 5,000 bootstrap samples and note the seed. The same data and the same seed give the same results to the last digit. The bootstrap runs in the background, so the page does not freeze.
- Download the Word file with tables, figures (PNG) and interpretation; set the section, table and figure numbers to match your chapter.
Responses with a missing value on any model variable are dropped listwise, as in PROCESS.
Reading mediation results
Judge mediation by the bootstrap confidence interval of the indirect effect a × b: if the interval excludes zero, there is an indirect effect. You do not need a significant total effect c first, nor the Baron and Kenny (1986) causal steps (Zhao, Lynch & Chen, 2010; Hayes, 2022). The tool classifies the result following Zhao et al. (2010):
- Complementary mediation: indirect and direct effects both significant, same sign (formerly “partial mediation”).
- Competitive mediation: both significant, opposite signs.
- Indirect-only mediation: indirect effect significant, direct effect not (formerly “full mediation”).
- Direct-only or no-effect non-mediation: no mediation.
The Sobel (1982) test is printed for reference only: it assumes a × b is normally distributed and is less powerful than the bootstrap. The completely standardised indirect effect (ab × SDX/SDY) helps compare sizes; when X is binary only the partially standardised version (ab/SDY) is reported.
Reading moderation results
Moderation is supported when the coefficient of the product term X × W is significant, which is equivalent to the F test of ΔR² when the product is added. Then probe the interaction in two ways:
- Simple slopes: the effect of X at low, average and high W (mean ± 1 SD following Aiken & West, 1991, or the 16th, 50th and 84th percentiles, the PROCESS 4 default). If mean − 1 SD falls outside your data, the tool warns you and you should switch to percentiles.
- Johnson–Neyman: the exact value of W at which the effect of X becomes significant, with the share of the sample in the significant region (Hayes & Matthes, 2009).
Mean-centring X and W changes neither the interaction coefficient nor the conclusion about moderation; it only makes the coefficient of X easier to read (the effect of X at average W). For Model 7, rely on the index of moderated mediation: if its interval includes zero, do not claim moderation just because the indirect effect is significant at high W but not at low W (Hayes, 2015).
Worked example: quality → satisfaction → loyalty
We used the mobile-phone customer dataset (250 customers, 1–10 scales) from our verification page. Each construct is the mean of its items: X = perceived quality (PERQ1–7), M = satisfaction (CUSA1–3), Y = loyalty (CUSL1–3), simple mediation (Hayes, Model 4). Results from Python (statsmodels), 5,000 bootstrap samples:
- Path a (X → M): 0.825, p < .001.
- Path b (M → Y, controlling for X): 0.736, p < .001.
- Direct effect c′ (X → Y, controlling for M): 0.016, p = .894.
- Total effect c: 0.623.
- Indirect effect a × b = 0.607; 95% bootstrap CI [0.411, 0.819], which excludes zero.
The indirect effect is significant and the direct effect is not, so under Zhao et al. (2010) this is indirect-only mediation (often called full mediation). Your bootstrap interval may differ by a few thousandths because resampling is random.
How to report it in APA 7
A bootstrap test with 5,000 resamples showed a significant indirect effect of perceived quality on loyalty through satisfaction, ab = 0.607, 95% CI [0.411, 0.819]. The direct effect was not significant, c′ = 0.016, p = .894, indicating indirect-only (full) mediation (Zhao et al., 2010).
In your Method section, state the number of bootstrap samples, the type of confidence interval, and that construct scores are item means. Cite Hayes (2022) for the PROCESS models, and the tool as software if your department asks for it.
Assumptions and limits
- This is regression on observed scores, not SEM. Construct scores are item means and measurement error is not separated out, so coefficients are usually smaller than in latent-variable SEM. If your examiners require latent variables, use CB-SEM or PLS-SEM.
- OLS assumptions still apply: linearity, independent residuals and constant variance. Standard errors are ordinary OLS ones, the PROCESS default.
- Cross-sectional data cannot prove causation: write “the results support the hypothesis”, not “prove”.
- Interactions need larger samples than main effects; the tool warns you below 20 responses per predictor.
FAQ
What is the difference between a mediator and a moderator?
A mediator (M) sits on the causal path: X affects M, and M affects Y. A moderator (W) is not on that path; it changes the strength or direction of the X → Y effect. In a research model diagram, a mediator is a box between two arrows, while a moderator is an arrow pointing at another arrow.
Do I need to install the PROCESS macro in SPSS?
Not to use this tool: the calculations run in your browser with the same OLS estimation as PROCESS Models 4, 6, 1 and 7. If your department requires SPSS output, you can still use the tool to check your model first, then run PROCESS with the same variables and the same number of bootstrap samples.
When can I conclude there is mediation?
When the bootstrap confidence interval of the indirect effect (a × b) excludes zero. Whether the direct effect c′ remains significant only tells you which type of mediation you have; it is not a condition for mediation (Zhao et al., 2010).
How many responses do I need to test moderation?
Interactions need larger samples than main effects. Plan ahead with the sample size calculator (moderation section) and see the cut-offs on our thresholds page (in Vietnamese).
Verification
An automated test suite compares the tool with an independent Python/numpy implementation in 10 scenarios: coefficients,
standard errors, p values, R², ΔR² and Sobel tests agree to 7–8 digits; at the Johnson–Neyman point p is exactly .05;
bootstrap intervals match exactly with the same resampling sequence and fall within Monte Carlo error with a different
random number generator. On the published mtcars dataset (Henderson & Velleman, 1981), the coefficients
of mpg = hp × wt match R's lm: 49.808, −0.120, −8.217, 0.028 (R² = .885).
References
- Aiken, L. S., & West, S. G. (1991). Multiple regression: Testing and interpreting interactions. Sage.
- 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. https://doi.org/10.1037/0022-3514.51.6.1173
- Hayes, A. F. (2015). An index and test of linear moderated mediation. Multivariate Behavioral Research, 50(1), 1–22. https://doi.org/10.1080/00273171.2014.962683
- Hayes, A. F. (2022). Introduction to mediation, moderation, and conditional process analysis: A regression-based approach (3rd ed.). Guilford Press.
- Hayes, A. F., & Matthes, J. (2009). Computational procedures for probing interactions in OLS and logistic regression: SPSS and SAS implementations. Behavior Research Methods, 41(3), 924–936. https://doi.org/10.3758/BRM.41.3.924
- Henderson, H. V., & Velleman, P. F. (1981). Building multiple regression models interactively. Biometrics, 37(2), 391–411. https://doi.org/10.2307/2530428
- 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. https://doi.org/10.3758/BRM.40.3.879
- Sobel, M. E. (1982). Asymptotic confidence intervals for indirect effects in structural equation models. Sociological Methodology, 13, 290–312. https://doi.org/10.2307/270723
- Zhao, X., Lynch, J. G., Jr., & Chen, Q. (2010). Reconsidering Baron and Kenny: Myths and truths about mediation analysis. Journal of Consumer Research, 37(2), 197–206. https://doi.org/10.1086/651257
One of the free research tools of Research Corner.