Simpson's paradox
When a trend reverses after the data is split into groups.
A metric can improve overall while getting worse in every segment, because the mix of users changed. It is a common trap after launches and pricing changes. Checking key segments before drawing conclusions avoids it.
Why it matters for a product engineer
A total can move one way while every group inside it moves the other way, because the mix of groups changed. After a launch, a campaign or a pricing change, the mix of users almost always changes. A product engineer who checks key segments before reading the total avoids celebrating a change that made things worse for everyone, or blaming one that helped.
How to do it
- Split every important result by the main segments: new and returning users, platform, country, plan.
- Compare the mix of segments between the two groups or periods.
- If the mix changed, compare within each segment, and weight the segments in the same way.
- In an experiment, do not change the traffic split while it runs. Optimizely advises pausing and starting a new experiment instead.
- Treat a win in one segment as a new hypothesis to test, not as a decision to ship.
Common mistakes
- Changing a test’s split from 99/1 to 50/50 halfway through.
- Comparing this month with last month after the user mix changed.
- Searching many segments until one shows a win.
- Reporting only the total.
Example
Early in the Covid-19 pandemic, Italy’s case fatality rate was 4.4%, almost twice China’s 2.3%. Researchers compared a large Chinese study from 17 February 2020 with Italian data from 9 March. In every age group, Italy’s rate was lower or the same. The difference came from the mix of cases: in Italy, 18.4% of cases were people aged 80 or over, compared with 3.2% in China.
Covid-19 case fatality rates, Italy and China, early 2020
| Italy, 9 Mar | China, 17 Feb | |
|---|---|---|
| Ages 60 to 69 | 2.5% | 3.6% |
| Ages 70 to 79 | 6.4% | 8.0% |
| Ages 80 and over | 13.2% | 14.8% |
| All ages | 4.4% | 2.3% |
| Cases aged 80 and over | 18.4% | 3.2% |
Lower in every age group, higher in total. Italy's cases were much older, and the total hides that.
Reportedvon Kügelgen, Gresele and Schölkopf, 2020, from Chinese CDC and Italian ISS data
Sources: Simpson's paradox in Covid-19 case fatality rates: a mediation analysis of age-related causal effects (von Kügelgen, Gresele and Schölkopf) ↗ · Simpson's paradox: discover possibilities with your segments, not shipping decisions (Optimizely docs) ↗
Resources
1- docsStart here
Simpson's paradox: discover possibilities with your segments, not shipping decisions ↗
Optimizely docs · 4 minWhy a result that reverses across segments, or a win in one segment, should lead to a new test rather than a shipping decision.
Tools
1- ToolFree
Evan's Awesome A/B Tools
Free calculators for sample size, significance of results and sequential tests.