Course outline

Causal Graphs: Confounders, Mediators, Colliders

By the end of this lesson, you should be able to: draw the three ways three variables can be wired together, say what conditioning does to each, explain why two of them are impossible to tell apart from data, and spot the filter that manufactures a correlation out of nothing.

The question and two stories about it

Alder Ads wants to know whether seeing an ad causes a purchase. Here are two accounts of the same business, both entirely plausible, told by two people who have looked at the same dashboard.

The ad works. Someone sees an ad, the ad brings them to the site, and being on the site is what produces the purchase. Ads matter, and the site visit is how they matter.

Loading diagram…
A chain. Everything the ad does, it does by way of the visit, so the visit is a mediator.

Intent does everything. Someone already wanted the product. Wanting it is why they searched, which is why the retargeting system showed them an ad, and wanting it is also why they bought. The ad was a bystander.

Loading diagram…
A fork. Intent produces both the ad and the purchase, and there is no arrow from ads to purchases at all.

These are different claims about the world, so you'd expect the data to favour one. It doesn't.

Two structures, one dataset

Simulate both, 200,000 users each, from separate random streams. Then compute every correlation an analyst has access to.

PairChainForkGap
Ads with the middle variable0.7000.7030.0027
Middle variable with purchase0.6010.6010.0000
Ads with purchase0.4210.4200.0010

The standard error of a correlation at this sample size is about 0.0018, so those gaps are sampling noise. The two structures produce the same correlation matrix, and that isn't a coincidence of the numbers I picked. A chain and a fork over three variables are observationally equivalent, always.

Try to break the tie by conditioning on the middle variable.

BeforeAfter
Chain: condition on the visit0.4210.001
Fork: condition on intent0.420-0.003

Both collapse. There's still no way to tell them apart.