What is this about?
Does self-regulation ability (X) improve exam performance (Y) because students study more (M)?
Mediation analysis splits the total effect of X on Y into an
indirect path via M (X→M→Y) and a
direct path (X→Y holding M constant). Total effect = direct + indirect. The tool generates a sample from true effects that you choose and estimates the paths by regression — you know the truth, the analysis does not.
How to proceed
1. Choose a scenario (A–D) — A: no mediation, B: full mediation (everything runs through M, c′ ≈ 0), C: partial mediation (indirect
and direct effect), D:
suppression (a and b have opposite signs). With the sliders you set a, b, c′, the noise and n yourself.
2. Look at the path diagram and equations — X→M→Y as a
DAG, with the estimated paths a, b and c′ and the total effect c. It follows from c = c′ + a·b.
3. Read the three regression models — model 1 explains M by X (path a), model 2 explains Y by X and M (paths c′ and b), model 3 explains Y by X alone and estimates the total effect c directly. Each with population value, estimate, standard error and
confidence interval.
4. Test the indirect effect a·b — with the Sobel or Aroian test (fast, but with a distributional assumption) or with a
bootstrap confidence interval (no assumption, hence usually the better choice; computed on button click).
What to watch for
The product a·b is not normally distributed: the
Sobel test is therefore often too conservative at small n. The bootstrap interval makes no distributional assumption and has better
power in simulations.
Mediation describes patterns but does not prove causality: a finding a·b ≠ 0 can also arise when a third variable influences both M and Y. For causal statements, the
confounders between X and Y
and between M and Y must be controlled — the latter is the harder condition.
Mediator, confounder or suppressor? Mathematically the three are the same equations. Which role M plays is decided by causal theory, not by the data.
Things to try
Compare scenario B (full) with C (partial): how does c′ shift? Then switch to D (suppression) and notice that the total effect c comes out smaller than the direct effect c′. Reduce n, compute the bootstrap interval with the button and compare it with the Sobel result — at small n the two differ noticeably.
What's next?
Moderation Analysis answers a different, related question — not WHY, but
WHEN/FOR WHOM an effect is stronger or weaker. The two are easily confused, even though
they are different models.