← All animations

๐Ÿ”€ Simpson's Paradox

A trend can hold inside every subgroup of your data and yet reverse the moment you pool the groups together. Treatment A beats Treatment B for the sick and for the healthy โ€” but loses overall. Two clusters of points each slope upward, while the combined cloud slopes down. The numbers never lie; they just answer a different question depending on how you slice them. Scroll through to watch a trend flip before your eyes.

1. The reversal โ€” group trends vs the pooled trend

Two groups of points. Group A and Group B each show a clear upward trend (more x, more y). But drag the confounder slider to push the groups apart โ€” Group B starts both further right and lower โ€” and the pooled line through all the points tips downward. Same dots, opposite story. Toggle between the two views to feel the flip.

Group slopes: + Pooled slope: โ€”

2. The counts version โ€” winning every round, losing the match

The classic table (think Berkeley admissions, or two medical treatments). Treatment A has the higher success rate in the easy cases and in the hard cases. Yet Treatment B wins on the pooled rate โ€” purely because the two treatments were tried on very different mixes of easy and hard cases. Drag the slider to change that mix and watch the pooled winner flip while the per-subgroup winner never changes.

Subgroups: A wins both Pooled: B wins

3. Why it happens โ€” and which answer to trust

Simpson's paradox needs two ingredients working together: a lurking confounder โ€” a hidden variable that influences the outcome โ€” and unequal group sizes, so that confounder is spread lopsidedly across the things you're comparing.

In Scene 1 the confounder is which group a point belongs to. Group B sits further along x but starts lower. Pool the points and the line mostly tracks where the groups are, not what happens within each โ€” so it slides downhill even though both groups climb.

In Scene 2 the confounder is case difficulty. Treatment A was given mostly to hard cases (low success for everyone), Treatment B mostly to easy ones. The pooled rate is a weighted average, and the weights โ€” not the treatments โ€” decide the winner.

The fix is to condition on the right variable: compare like with like. If group membership or case difficulty actually drives the outcome, the within-group comparison is the honest one and the pooled number is misleading. (Sometimes the reverse is true โ€” if the "confounder" is really a consequence of the treatment, you should not split on it. Causation, not arithmetic, decides.)

The lesson isn't that statistics deceive โ€” it's that correlation depends on aggregation. Before trusting a single headline rate, ask: what got averaged together, and was it fair to average it at all?