Mediation Analysis
Mediation Analysis
Analysis
https://github.com/davidfoxcrof
t/lsj-data/tree/master/data
• https://lsj.readthedocs.io/en/latest/
• https://youtu.be/dv5CGzD0hXM
• https://library.virginia.edu/data/articles/introduction-to-mediation-
analysis
• https://apastyle.apa.org/style-grammar-guidelines/tables-
figures/sample-tables#correlation
• https://library.virginia.edu/data/articles?page=2
Mediator definitions
• A mediator is a variable in a chain whereby an independent variable causes
the mediator which in turn causes the outcome variable (Sobel, 1990)
• A variable that occurs in a causal pathway from independent to dependent
variables. It causes variation in the dependent variable and itself is caused
to vary by the independent variable (Last, 1988).
• Mediation analysis tests a hypothetical causal chain where one
variable X affects a second variable M and, in turn, that variable
affects a third variable Y. Mediators describe the how or why of a
(typically well-established) relationship between two other variables
and are sometimes called intermediary variables since they often
describe the process through which an effect occurs. This is also
sometimes called an indirect effect.
Other names for Mediators and the Mediated Effect
• The example shows a full mediation, yet a full mediation rarely happens in practice.
• once we find these relationships, we want to see if this mediation effect is statistically
significant (different from zero or not).
• The Sobel test (Sobel, 1982) and bootstrapping (Preacher & Hayes, 2004).
Mediate () takes two model objects as input (X → M and X + M → Y) and we need
to specify which variable is an IV (treatment) and a mediator (mediator).
For bootstrapping, set boot =to at least 500.
Mediation Estimates
95% Confidence
Interval
%
Effect Label Estimate SE Lower Upper Z p
Mediation
Indire 0.356 0.081
a×b 0.197 0.516 4.382 < .001 90.00
ct 5 4
0.039 0.108 -
Direct c 0.251 0.367 0.714 10.00
6 0 0.172
c+a 0.396 0.110 100.0
Total 0.180 0.612 3.600 < .001
×b 1 0 0
By the way, we don’t have to follow all three steps as Baron and Kenny suggested. We could run two
regressions (X → M and X + M → Y) and test its significance using the two models. However, the suggested
steps help you understand how it works!
Path Estimates
95% Confidence
Interval
Label Estimate SE Lower Upper Z p
0.56 0.09 0.37 0.74 5.99 < .00
X → M a
10 35 8 4 8 1
0.63 0.09 0.44 0.83 6.41 < .00
M → Y b
55 90 1 0 8 1
-
0.03 0.10 0.25 0.36 0.71
X → Y c 0.17
96 80 1 7 4
2
• Mediation analysis is not limited to linear regression; we can use
logistic regression or polynomial regression and more.
• Also, we can add more variables and relationships, for example,
moderated mediation or mediated moderation.
• However, if your model is very complex and cannot be expressed as a
small set of regressions, you might want to consider structural
equation modeling instead.
To sum up, here’s a flowchart for mediation analysis
Bootstrapping
• Bootstrapping is a statistical method that utilizes random resampling
with replacement to estimate a population parameter.
• This technique samples from a given dataset to estimate a parameter
when it would otherwise be impossible or impractical to do so.
• Those samples are used to calculate standard errors, confidence
intervals and for hypothesis testing.
Direct Effect, Indirect Effect, And Total Effects
Forms of Mediation
Forms of Mediation
Forms of Mediation
• Complementary mediation is where the direct and indirect effects have a similar
influence regarding directionality. For instance, the direct effect may a have
positive influence, and the indirect effect has a positive influence as well.
graduate student receives and the attention that they pay to this tutorial
• 7: There should be no significant outliers, high leverage or highly influential points. Outliers,
leverage , and influential points are different terms used to represent observations in data sets that
are in some way unusual when you wish to perform a moderator analysis.
Assumptions
Polychronicity refers to the preference for dealing with multiple tasks or activities
simultaneously, as opposed to sequentially.
IV: Polychronicity
Moderator: mindful multitasking
DV: life satisfaction
outputs
Moderation Estimates
95% Confidence Interval
Estimate SE Lower Upper Z p
Poly_Ct -0.1286 0.0848 -0.2948 0.0375 -1.518 0.129
MAAS_C
0.0635 0.0784 -0.0902 0.2171 0.809 0.418
t
Poly_Ct
✻
0.2016 0.0730 0.0586 0.3446 2.763 0.006
MAAS_C
t
interpretation
1.Main Effect of Polychronicity (Poly_Ct):
1. The main effect of Polychronicity (Poly_Ct) is not statistically significant (p = 0.129). This
suggests that, on its own, Polychronicity does not significantly predict the outcome variable.
2.Main Effect of Mindfulness (MAAS_Ct):
1. The main effect of Mindfulness (MAAS_Ct) is also not statistically significant (p = 0.418). This
indicates that, on its own, Mindfulness does not significantly predict the outcome variable.
3.Interaction Effect (Poly_Ct ✻ MAAS_Ct):
1. The interaction effect between Polychronicity and Mindfulness (Poly_Ct ✻ MAAS_Ct) is
statistically significant (p = 0.006).
2. A positive coefficient (0.2016) indicates that the relationship between Polychronicity and the
outcome variable strengthens as levels of Mindfulness increase.
3. This suggests that individuals with higher levels of Mindfulness demonstrate a stronger
association between their preference for dealing with multiple tasks simultaneously
(Polychronicity) and the outcome variable compared to individuals with lower levels of
Mindfulness.
interpretation
• The moderation analysis results indicate that the interaction effect
between Polychronicity (Poly_Ct) and Mindful Attention and
Awareness Scale (MAAS_Ct) on the outcome variable is statistically
significant, B = 0.20, SE = 0.07, 95% CI [0.06, 0.34], z = 2.76, p = 0.006.
• This suggests that the relationship between Polychronicity and the
outcome variable is moderated by levels of mindfulness. Specifically,
as levels of mindfulness (MAAS_Ct) increase, the association between
Polychronicity and the outcome becomes stronger.
The simple slope estimates provided indicate how the predictor variable (Poly_Ct: Polychronicity)
predicts the dependent variable (LifeSat: Life Satisfaction) at different levels of the moderator
variable (MAAS_Ct: Mindful Attention and Awareness Scale).