Mediator
A mediator is a variable M that is caused by some variable X and itself causes a variable Y.
Not to be confused with a moderator.
Contents
Description
Mediators are one possible failure of causal inference. An association has been identified between two variables, X and Y, but in actuality there is a mediator M between them. X causes M and M causes Y. This is called mediation.
First, consider the case where the mediator explains all causation. In this example, controlling for M explains all correlation.
> X <- rbinom(1000, 1, 0.5) > M <- rbinom(1000, 1, 0.9*(1-X) + 0.1*X) > Y <- rbinom(1000, 1, 0.9*(1-M) + 0.1*M) > cor(X,Y) [1] 0.6440206 > cor(X[Z==1], Y[Z==1]) [1] 0.02818287 > cor(X[Z==0], Y[Z==0]) [1] 0.0464756
Note that in R, the Bernoulli distribution is handled as a special case of the Binomial distribution. Note furthermore the similarities between this and confounding.
Consider now the more general case, where some but not all causation is mediated. This can be explained visually as:
The causal effects are:
direct effect of X on Y = β1
direct effect of X on M = β2
direct effect of M on Y = β3
indirect effect of X on Y = β2*β3
total effect of X on Y = β1 + (β2*β3)
See here for analysis of this system.
