Mediation effect
When to use:
We use mediation analysis when we want to check whether the influence of one independent variable (X) on an outcome variable (Y) occurs, at least in part, "through" a third variable, called the mediator (M). In other words, we are looking for an answer to the question of whether the relationship between X and Y can be partly explained by the fact that X influences M, and M in turn influences Y.
Baron and Kenny (1986)[16] defined a mediator (M) as a variable that significantly explains the relationship between an independent variable (X) and an outcome variable (Y). In mediation, the relationship between the independent variable and the dependent variable is assumed to be, at least in part, an indirect effect that exists thanks to the influence of a third variable (the mediator).
First we build a one-dimensional model, in which the mediator is not taken into account at all – it describes the "raw" relationship of X with Y with the coefficient \(\tau\). Next we build a multidimensional model, in which both X and M are used simultaneously to explain Y – in this model the relationship of X with Y is described by the coefficient \(\tau'\). If, after the mediator is added to the model, the influence of X on Y clearly decreases (that is, \(\tau'\) is noticeably smaller than \(\tau\)), this means that part of the effect of X on Y indeed passes through the mediator M.
Assumptions
- variables X, Y and M should be measured on a scale that allows the construction of linear regression models (that is, they should be quantitative),
- it is necessary to determine three regression models: the relationship of X with Y (without the mediator), the relationship of X and M with Y (with the mediator), and the relationship of X with M,
- the tests assessing the significance of the mediation effect (Sobel, Aroian, Goodman) are conservative tests and give reliable results only for large sample sizes (above 100 observations).
Definitions of measures
Comparing the one-dimensional model (\(\tau\)) with the multidimensional model that includes the mediator (\(\tau'\)), we distinguish three kinds of effects:
Total effect – the entire influence of variable X on variable Y, determined in the one-dimensional model (without taking the mediator into account) and described by the coefficient \(\tau\).
Direct effect – the part of the influence of X on Y that remains once the mediator M is included in the model. This is the coefficient \(\tau'\) – it describes the influence of X on Y that is independent of the mediation by M.
Indirect (mediation) effect – the part of the influence of X on Y that passes "through" the mediator, i.e. the difference between the total effect and the direct effect (\(\tau-\tau'\)). This quantity can also be expressed as the product of the coefficients describing the successive legs of the path X\(\to\)M\(\to\)Y (coefficient a, describing the influence of X on M, and coefficient b, describing the influence of M on Y while simultaneously taking X into account).
To assess how large a part of the relationship of X with Y is "taken over" by the mediator, the percentage mediation effect is determined, that is, the share of the indirect effect in the total effect. The higher this value, the more important the mediator becomes in explaining the relationship under study.
To check whether the indirect effect determined in this way is statistically significant (that is, whether the reduction in the influence of X on Y after including the mediator is not due to chance), the Sobel (1982)[158], Aroian (1947)[7] (popularized by Baron and Kenny[16]) and Goodman (1960)[72] tests are used.
How to set up the analysis
The mediation effect analysis window is opened via: Advanced Statistics\(\to\)Multivariate models\(\to\)Mediation effect.

Performing and interpreting the analysis
Example 1. Based on the paper by Mimar Sinan Fine (2017)[125].
The study includes 300 adults living in Istanbul. The dependent variable Y is systolic blood pressure, and the independent variable X is age. The mediating variable M is the frequency of alcohol consumption. The aim of the study is to examine the relationship between age and systolic blood pressure and to present the influence of the frequency of alcohol consumption on this relationship.
A one-dimensional model was built, in which the potential mediator was not taken into account:
\(Y=0.319 \cdot X+c\).
The size of the influence of variable X (age) on variable Y (systolic blood pressure) was tau=0.319.
A multidimensional model was built, in which the potential mediator was taken into account:
\(Y=2.271 \cdot X + 5.333\cdot M+c\).
The size of the influence of variable X (age) on variable Y (systolic blood pressure) was tau'=2.271. We also know from this model that b=5.333, with error \(SE_b\)=0.786.
The difference between the coefficients is tau-tau'=a*b=0.048. The mediation effect is (tau-tau')/tau=(0.319-0.271)/0.371=0.15047, which means that M (frequency of alcohol consumption) modifies the relationship under study, reducing the coefficient by about 15%.
A further one-dimensional model was built, examining the influence of variable X on the mediator:
\(M=0.009\cdot X+c\).
We know from this model that the coefficient a=0.009, with error \(SE_a\)=0.004. All this information is entered in the analysis window, giving the following report:

On the basis of the coefficients a and b and their standard errors, the results of the Sobel, Aroian and Goodman tests are determined.
The \(p\) values obtained indicate a statistically significant role of the mediator. We have therefore confirmed that the frequency of alcohol consumption influences the relationship between age and systolic blood pressure noticeably enough that it is worth explaining why this effect occurs.
Formulas:
We determine the size of the change through the difference between the coefficients describing the relationship of variable X with variable Y in the one-dimensional model:
\(Y=\tau\cdot X+c\)
and in the multidimensional model, that is, including the variable M:
\(Y=\tau\cdot X+b\cdot M+c\).
Difference:
Mediation effect:
As a result, when the mediator (M) is included in the regression model describing the relationship between variable X and Y, the influence of the independent variable \(\tau\) is reduced to \(\tau'\).
Tests assessing the mediation effect
Interpretation:
The Sobel (1982)[158] test, the Aroian (1947)[7] test popularized by Baron and Kenny[16], and the Goodman (1960)[72] test are tests that determine whether the reduction in the influence of the independent variable on the outcome variable, after including the mediator in the model, is a substantial reduction, and hence whether the mediation effect is statistically significant.
Hypotheses:
\(\begin{array}{cl} \mathcal{H}_0: & \tau = \tau'\\ \mathcal{H}_1: & \tau \ne \tau', \end{array}\)
Formulas:
The test statistic for the Sobel test has the form:
The test statistic for the Aroian test has the form:
The test statistic for the Goodman test has the form:
These statistics asymptotically (for large sample sizes) have the normal distribution.
The \(p\) value, determined on the basis of the test statistic, is compared with the significance level \(\alpha\):
PQStat