Mediation explains how or why one variable affects another, by placing a third variable on the causal path between them; moderation explains when or for whom that effect is stronger or weaker, by letting a third variable change the size of the relationship. A mediator sits in the middle of the chain and carries the effect; a moderator sits to the side and tunes it. Getting this distinction right is what keeps your dissertation hypotheses and your analysis aligned.

Why the two roles are easy to confuse, and how to tell them apart

Both involve a third variable, which is exactly why students mix them up in the theory chapter. The cleanest test is to ask whether the third variable is part of the mechanism or a condition. If it answers how the independent variable shapes the dependent variable, it is a mediator. If it answers under what circumstances the effect holds, it is a moderator. A mediator is caused by your predictor and in turn causes your outcome; a moderator is usually unrelated to the predictor and simply interacts with it.

Hot weatherIce cream salesDrowning deathscausescausesobserved correlation(not causal)
A third variable that drives both the predictor and the outcome is a confounder, not a mediator. Diagramming the causal arrows first stops you from labelling a side influence as part of the mechanism.

How mediation is modelled in your analysis

Classic mediation decomposes a total effect into a direct effect (predictor to outcome) and an indirect effect (predictor to mediator to outcome). Modern practice estimates the indirect path with bootstrapping and reports a bias-corrected confidence interval rather than relying on the older causal-steps logic. Because mediation makes a directional claim, your design has to justify the time ordering of the variables; a mediator measured at the same moment as the outcome cannot really sit before it. Many mediation models are fitted as a series of regressions, so the same diagnostics that matter in checking linear regression assumptions apply to each equation in the model.

How moderation is modelled in your analysis

Moderation is tested with an interaction term: you multiply the predictor by the moderator and add that product to the model. A significant interaction means the slope of the predictor changes across levels of the moderator, which you then unpack with simple slopes or a Johnson-Neyman region of significance. To keep the coefficients interpretable and reduce multicollinearity, you usually centre or standardise the continuous variables before forming the product. When the outcome is binary rather than continuous, the interaction lives inside a logistic model, so the same care you take in interpreting logistic regression results applies to reading the moderated effect on the odds scale.

Choosing the right one for your hypotheses

Let the wording of your research question decide. Process and mechanism language (through, because, by way of) points to mediation; contingency language (depends on, especially when, for whom) points to moderation. Some dissertations need both at once, a moderated mediation or conditional indirect effect, where the strength of a mediated path itself varies by group. Whichever you pick, remember that a statistical association is not proof of a mechanism, which is the same caution that runs through correlation versus causation. A defensible model is grounded in theory first and estimated second, never the reverse.