Course contentsShow
← Data Science
Lesson 1471 of 2,14536. Causal Inference BasicsFree lesson

Mediators and Colliders

Learn to distinguish mediators (variables on causal paths) from colliders (variables caused by two others) and their distinct roles.

Mediators and Colliders

What you'll learn: How to distinguish between mediators and colliders in causal graphs, two fundamentally different variable types with opposite roles in causal inference.

Understanding Mediators

A mediator sits on the causal path between treatment and outcome. It's a mechanism through which the treatment exerts its effect.

Think of it like this: Exercise → Weight Loss → Lower Blood Pressure. Weight loss is a mediator—exercise causes weight loss, which in turn causes lower blood pressure. The effect flows through the mediator.

In a DAG:

X → M → Y

Where X is treatment, M is the mediator, and Y is the outcome. Controlling for a mediator blocks part of the causal effect you're trying to measure—usually something you want to avoid if you're estimating total treatment effects.

Understanding Colliders

A collider is caused by two or more variables pointing into it. It's where causal arrows collide.

Analogy: Talent → NBA Selection ← Height. Both talent and height cause selection into the NBA. Among NBA players only, you might observe a negative correlation between talent and height (shorter players need exceptional talent to compensate)—even though talent and height aren't causally related in the general population!

In a DAG:

X → C ← Y

Here C is a collider. Critical insight: Controlling for a collider opens a spurious path between X and Y, creating bias where none existed. This is the opposite of what you do with confounders.

The Key Difference

  • Mediators: On the path (X → M → Y). Controlling blocks causal flow.
  • Colliders: Where paths meet (X → C ← Y). Controlling creates false associations.

Key Takeaway: Mediators transmit causal effects and should often be left uncontrolled; colliders block spurious paths naturally but create bias when controlled—recognize them in your DAG to avoid conditioning mistakes.