Klinkenberg
University of Amsterdam
15 nov 2022
In statistics, a mediation model is one that seeks to identify and explain the mechanism or process that underlies an observed relationship between an independent variable and a dependent variable via the inclusion of a third hypothetical variable, known as a mediator variable (also a mediating variable, intermediary variable, or intervening variable).
Source: WIKIPEDIA
Does the speed of recovery after sickness improve with the use of alternative medicine or is this effect mediated by a healthy lifestyle?
Create predictor variable
Create mediator
Create outcome variable
Interactive, give it a spin.
\(a \times b = b_a \times b_b\)
\(\frac{ab}{s_{Outcome}} = \frac{b_a b_b}{s_{Outcome}}\)
\(\frac{ab}{s_{Outcome}} \times s_{Predictor} = \frac{b_a b_b}{s_{Outcome}} \times s_{Predictor}\)
\(\frac{ab}{c} = \frac{b_a b_b}{b_c}\)
\(\frac{ab}{c`} = \frac{b_a b_b}{b_{c`}}\)
\(R^2_{out,med} − (R^2_{out,pre \times med} − R^2_{out,pre})\)
m.4.out.med <- lm(speed.of.healing ~ healthy.lifestyle)
R2_out.med = cor(m.4.out.med$fitted.values, speed.of.healing)^2
R2_out.pre.med = cor(m.3.out.pre.med$fitted.values, speed.of.healing)^2
R2_out.pre = cor(m.1.out.pre$fitted.values, speed.of.healing)^2
R2_out.med - (R2_out.pre.med - R2_out.pre)
[1] 0.9161054
Scientific & Statistical Reasoning