Simpson's paradox: how I got deceived by statistics
July 2022
Vivek Pandey
Outline
A real life incident
A real life incident
| Default algo(D) | New algo(N) | ||
| impressions | clicks | impressions | clicks |
Client 1 | i1 | c1 | i4 | c4 |
Client 2 | i2 | c2 | i5 | c5 |
Client 3 | i3 | c3 | i6 | c6 |
My observations:
i1, i2... = number of impressions, i.e. number of ads shown
c1 c2... = number of clicks
c1/i1, c2/i2 etc are known as click through rate
A real life incident
| Default algo(D) | New algo(N) | ||
| impressions | clicks | impressions | clicks |
Client 1 | i1 | c1 | i4 | c4 |
Client 2 | i2 | c2 | i5 | c5 |
Client 3 | i3 | c3 | i6 | c6 |
My observations:
But then:
(c1 + c2 + c3) / (i1 + i2 + i3) > (c4 + c5 + c6) / (i4 + i5 + i6)
i1, i2... = number of impressions, i.e. number of ads shown
c1 c2... = number of clicks
c1/i1, c2/i2 etc are known as click through rate
So which algo is better?
Argument 1:
New algo is better because it is better on each individual client
Argument 2:
Default algo is better because overall, it is better on the aggregate
A question on Cricket
| Sachin Tendulkar | Rahul Dravid | ||||
| runs | innings | batting average | runs | innings | batting average |
2001-2005 | 1200 | 48 | 25 | 10400 | 411 | 25.3 |
2006-2010 | 18300 | 582 | 31.4 | 4500 | 140 | 32.1 |
Total | 19500 | 630 | 31.0 | 14900 | 551 | 27.0 |
*These are made up numbers, not real cricket stats
Which treatment is better?
The reason: confounding variable
Size of the stone is "confounding variable"
Large stones in general have lower success rate.
Treatment A has been done more often on large stones
The reason: confounding variable
Size of the stone is "confounding variable"
Large stones in general have lower success rate.
Treatment A has been done more often on large stones
Correct way to evaluate:
If we apply treatment A to all stones, success rate = [0.93 * (87 + 270) + 0.73 * (263 + 80)] / (87 + 270 + 263 + 80)
If we apply treatment B to all stones, success rate = [0.87 * (87 + 270) + 0.69 * (263 + 80)] / (87 + 270 + 263 + 80)
Q&A
Cricket and medicine examples are copied from wikipedia article.