Lesson 17 of 20

Put it all in one pot — Simpson's paradox

the sign flips

Put it all in one pot — Simpson's paradox
Same people, same numbers. Split apart it is green; pooled together it is red. Both calculations are correct.

Testing each cancer type separately is a nuisance, and few of them come out significant. Would it not be far more powerful to put all 4,691 patients together?

Let us try.

z = +3.75, p = 0.00018. A strong result. And the opposite direction to lesson 14.
Python Runs in your browser

Split by cancer type in lesson 14, z was mostly negative — more infiltration, longer life. Pool everything and it comes out positive.

Both calculations are correct. Which should you believe?

Pooled, +3.75; within cancer types, −3.97. A textbook Simpson's paradox.
Python Runs in your browser
Press the two modes and compare, then find the reason in the plot below.
Loading…

The reason is in the widget's scatter plot. Put one dot per cancer type, with its median infiltration rate on x and its five-year survival on y —

  • Breast and prostate — low infiltration (1.3%, 1.5%) and very good prognosis (over 80% at five years).
  • Stomach, rectum and cervix — high infiltration (9–12%) and correspondingly worse prognosis.

So pool everything and gather "the high-infiltration side", and that group fills up with patients from cancer types that had a bad prognosis to begin with. What we measured was not the effect of infiltration but the difference between cancer types.

pooled z = +3.75 · stratified z = −3.97
A relationship at the level of cancer types overturned the conclusion at the level of patients — a cousin of the ecological fallacy.
Python Runs in your browser
🤔 Check yourself
When the pooled and stratified tests disagree in sign, which is clinically useful?
🤔 Check yourself
What is the root cause of the Simpson's paradox here?