Simpson’s paradox is what happens when a trend that shows up in every subgroup reverses once you combine the groups. It looks impossible, and it is a regular cause of wrong conclusions from averages, dashboards and A/B tests.
A famous real example
A widely taught example comes from a study comparing two treatments for kidney stones. The table shows the share of cases that were successful, with the counts behind each figure.
| Group | Treatment A | Treatment B |
|---|---|---|
| Small stones | 93% (81 of 87) | 87% (234 of 270) |
| Large stones | 73% (192 of 263) | 69% (55 of 80) |
| All cases combined | 78% (273 of 350) | 83% (289 of 350) |
Treatment A did better for small stones and better for large stones, yet Treatment B looks better overall. Both statements are true, and the arithmetic is correct.
Why it happens
The groups are not the same size, and they were not assigned the same way. Treatment A was used far more often on the large stones, which are harder cases with lower success rates for any treatment, while Treatment B was used mostly on the easy small stones. The overall figure for A is dragged down by its tougher mix of cases. The stone size is a confounder: it affects both which treatment a patient got and how likely success was.
The same trap in business data
- A conversion rate rises for both mobile and desktop visitors after a redesign, yet the overall rate falls, because the traffic mix shifted toward mobile, which converts less.
- A support team resolves a higher share of easy tickets and of hard tickets than last quarter, yet the overall resolution rate drops, because more hard tickets arrived.
- Two marketing channels are compared on total conversions, while one of them mostly targets an audience that was already likely to buy.
Which number is right?
There is no purely mathematical answer. Whether you should trust the subgroup figures or the combined one depends on the story behind the data. If the subgroup variable, such as stone size, influences both the choice and the outcome, the subgroup comparison is the fair one. But if the variable is something the treatment itself changes, splitting by it can mislead. The decision needs knowledge of how the data came about, which is the point made in correlation vs causation.
How to protect yourself
- Look inside the averages. Break key metrics down by the obvious segments before concluding anything. In SQL that is a grouped query, as described in GROUP BY and HAVING.
- Check the mix. Compare how many cases fall in each segment across the groups you are comparing.
- Randomize when you can. Random assignment makes the groups comparable on average, which is why A/B testing avoids this trap, as long as the split is truly random and balanced.
- Compare like with like over time. Cohort views, as in cohort analysis in SQL, stop a change in the audience mix from masquerading as a change in behavior.
Relevance to machine learning
A model trained on pooled data can learn a relationship that holds overall and reverses inside key segments, or the other way around. Checking performance by segment, not only in total, catches this, and it is part of the discipline needed for rare classes in imbalanced datasets.
A quick checklist
- Did you break the metric down by the most obvious segments?
- Did the mix of segments change between the groups you compare?
- Can you explain how cases ended up in each group?
- Is a randomized comparison possible?
- Did you decide which view to trust using the story behind the data, not only the numbers?
FAQ
What is Simpson’s paradox?
It is a situation where a trend that appears in several subgroups reverses or disappears when the groups are combined, usually because the groups differ in size or mix.
What causes Simpson’s paradox?
A confounding variable that affects both the group assignment and the outcome, combined with unequal group sizes, so the combined average hides what happens inside each group.
How do you avoid Simpson’s paradox?
Segment your data by likely confounders, compare the mix of cases across groups, and use randomized experiments when possible.

