Course outline

Causal Graphs: Confounders, Mediators, Colliders

By the end of this lesson, you should be able to: draw a causal graph for a product question, recognise the three basic structures, decide which variables to control for and which to leave alone, and spot when filtering your data creates bias.

What a causal graph is

A causal graph, or DAG (directed acyclic graph), is a drawing of what you believe causes what. Each box is a variable. Each arrow means "this directly affects that". "Acyclic" means no loops: you can't follow arrows back to where you started.

The graph matters because it answers a practical question: which variables should you control for? Controlling for the right ones removes bias. Controlling for the wrong ones adds it. And every graph, however complicated, is built from three simple structures.

Structure 1: the confounder

A confounder causes both the treatment and the outcome.

Loading diagram…
A fork. Online activity drives both who sees the ad and who buys.

In Facebook's advertising study, users who were active online during a campaign were more likely to see the ad, and also more likely to buy. Activity opens a second path between ads and purchases that has nothing to do with the ad working. That's why comparing users who saw the ad with users who didn't overstated the effect by more than four times (lesson 2).

Rule: control for confounders. Comparing users with similar activity closes the extra path.