← All animations

πŸ”— Correlation vs Causation

Two things move together β€” when one goes up, so does the other. That's correlation, and it's everywhere. But "they move together" says nothing about why. The same neat pattern can come from a direct cause, from a hidden third thing driving both, or from sheer coincidence. Scroll through to feel what the correlation coefficient measures, then watch one identical correlation arise from three completely different causal stories.

1. What r feels like β€” drag the correlation

The correlation coefficient r runs from βˆ’1 to +1. At 0 the cloud is a shapeless blob β€” knowing X tells you nothing about Y. Near Β±1 the points collapse onto a line. Drag the slider and watch the cloud tighten and tilt; the line below is the real least-squares fit and the r is computed straight from the dots.

r = +0.70

The slider sets the target; the printed r is measured from the actual points, so they drift slightly apart β€” that's sampling noise, the same reason a real-world r is never exactly what the underlying process would give with infinite data.

2. Same correlation, three different causes

Here X and Y are correlated in all three cases β€” but the wiring behind the scenes is totally different. Switch between them. The killer case is the confounder: ice-cream sales and drownings rise together, yet neither causes the other β€” summer heat (Z) drives both. Press Control for Z and watch the link evaporate.

r = 0.00 Pick a structure above.

3. Why "they move together" isn't "one causes the other"

Correlation is a fact about data. Causation is a claim about what would happen if you intervened. Five traps lie between them:

The fix is the randomised controlled experiment: randomly assign X yourself. Randomisation breaks every back-door path β€” no confounder can sneak in, because nothing decides X except the coin flip. That's why "correlation β‰  causation, so run the experiment" is the gold standard of evidence.