Tae Hyun Kim (Lowell)

Mediator

3 min read #causal-inference#scm#mediation#dag

Definition

A mediator is an intermediate variable lying on the causal pathway through which a treatment (X) affects an outcome (Y). In the structure X → M → Y, M is the mediator.

DAG representation:

  Treatment (X) → Mediator (M) → Outcome (Y)

Key characteristics:

  • Part or all of X’s effect is transmitted to Y through M
  • Controlling for M blocks the genuine causal effect

Total, Direct, and Indirect Effects

        X → M → Y     (Indirect effect: through M)
        X ----→ Y     (Direct effect: not through M)

Total Effect (TE)

TE=E[Ydo(X=1)]E[Ydo(X=0)]TE = E[Y|do(X=1)] - E[Y|do(X=0)]

  • The total effect of X on Y
  • Direct + Indirect effect

Direct Effect (DE)

DE=E[Ydo(X=1,M=m)]E[Ydo(X=0,M=m)]DE = E[Y|do(X=1, M=m)] - E[Y|do(X=0, M=m)]

  • The X → Y effect when M is held fixed
  • The pathway that does not pass through M

Indirect Effect (IE)

IE=TEDEIE = TE - DE

  • The X → Y effect through M
  • “Mediated effect”

Why NOT Control for Mediators?

Problem 1: Underestimation of Total Effect

When you control for M:

  • The indirect effect (X → M → Y) is blocked
  • The total effect is underestimated
Original: X ---(direct)--> Y
          X ---(via M)---> Y   ← this part disappears

Problem 2: Endogenous Selection Bias

When the mediator is connected to a confounder:

      U (unmeasured)
     ↙        ↘
    M          Y

    X

When you control for M:

  • A spurious association is created between X and U (M becomes a collider)
  • Bias is introduced

Example: Education → Adult Intelligence → Income

                    Childhood Intelligence
                        ↙        ↘
Education → Adult Intelligence → Income
     ↘_________________________↗
  • Without control: the total effect of Education on Income
  • With control for Adult Intelligence:
    1. The indirect effect is blocked (underestimation)
    2. Childhood Intelligence plays the role of U → bias

When to Control for Mediator?

Goal: Estimate Total Effect

→ Do NOT control for mediator

Goal: Estimate Direct Effect Only

→ Control for mediator (caution required)

However:

  • Estimating the direct effect requires additional assumptions
  • Bias is possible if M is not randomized
  • Even in an experimental study, M must be randomized to be valid

Mediation Analysis

Traditional mediation (Baron & Kenny, 1986):

  • Has many limitations
  • Difficult to interpret causally

Modern causal mediation (Imai et al., 2010; Pearl):

  • Sequential ignorability assumption
  • Stricter identification conditions

Mediator vs. Confounder vs. Collider

Variable TypeDAG StructureEffect of Control
ConfounderX ← Z → YRemoves spurious association ✓
ColliderX → C ← YCreates spurious association ✗
MediatorX → M → YBlocks the causal effect ✗

Commonality (Collider & Mediator): both are post-treatment variables

Identifying Mediators

Temporal Criterion

  • Occurs after the treatment and before the outcome
  • Is affected by the treatment

Causal Pathway

  • X → M: X affects M
  • M → Y: M affects Y
  • M lies on the X→Y pathway

Example Mediators

TreatmentMediatorOutcome
EducationSkills/KnowledgeIncome
TherapyCoping mechanismsDepression
DrugBiological pathwayHealth outcome
ExerciseFitness levelWeight loss

Partial vs. Full Mediation

Full Mediation

X → M → Y   (only through M)
  • All of X’s effect goes through M
  • Direct effect = 0

Partial Mediation

X → M → Y
X ---→ Y   (also direct effect)
  • Part of X’s effect goes through M
  • Direct effect ≠ 0

Post-treatment Variable Rule

Rule of Thumb:

Do not control for variables that occur after the treatment

Reasons:

  1. Mediator: blocks the causal effect
  2. Collider: creates spurious association
  3. Descendant of collider: indirect collider bias

Exceptions:

  • When estimating the direct effect is the explicit goal
  • When using appropriate causal mediation analysis
  • DAG - visualizing causal structure
  • Confounder - common cause (must be controlled)
  • Collider - common effect (must not be controlled)
  • CATE - treatment effect estimation
  • Causal Mediation Analysis - analyzing mediation effects

References

  • rohrerThinkingClearlyCorrelations - the dangers of controlling for mediators
  • Baron, R. M., & Kenny, D. A. (1986). The moderator-mediator variable distinction
  • Pearl, J. (2014). Interpretation and identification of causal mediation
  • Imai, K., et al. (2010). A general approach to causal mediation analysis

Local graph