Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 37 ยท Causality and Confounding

Simpson's Paradox

See why a trend can reverse when data are split into groups, how Simpson's paradox arises from confounding, and why the causal story decides whether to pool or stratify.

Simpson's paradox happens when a trend that appears in several groups reverses, or disappears, when the groups are combined. It looks like a mathematical trick, but it is a symptom of confounding, and it shows that the data alone cannot tell you whether to look at the overall or the group-level numbers.

A treatment that wins everywhere and loses overall

Imagine two treatments for kidney stones. Doctors give the more invasive Treatment A mostly to large, hard stones and the gentler Treatment B mostly to small stones.

Stone size Treatment A Treatment B
Small 93% (81 of 87) 87% (234 of 270)
Large 73% (192 of 263) 69% (55 of 80)
All 78% (273 of 350) 83% (289 of 350)

A wins in both rows, but B wins in the total row. The numbers are consistent; the explanation is that A handled many more hard cases.

Python Reproduce the reversal

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Success depends strongly on stone size (the confounder), and treatment choice depends on stone size too.

flowchart LR
  S["stone size"] --> T["treatment"]
  S --> R["recovery"]
  T --> R

Size drives both the choice of treatment and the chance of recovery.

Why it happens: unequal weights

Each overall rate is a weighted average of group rates, with weights equal to the share of cases in each group. A has most of its weight on the hard group, where rates are low. B has most weight on the easy group, where rates are high. Different weights can reverse the ordering.

Python Weights drive the paradox

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Once both treatments are evaluated on the same case mix (standardization, see stratification and standardization) the paradox disappears and A is better.

Which number is right?

Here is the crucial point: the same table can need different answers depending on the causal story.

  • If the group variable is a confounder (stone size, determined before treatment, influences the choice), use the group-level comparison.
  • If the group variable is caused by the treatment (a mediator, such as "blood pressure after the drug"), splitting by it can remove part of the effect and the overall number is the right one.

The data are identical in both cases. Only the arrows differ, which is why statistics courses alone cannot settle the question and why we need causal graphs.

Python Same numbers, different causal story

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Spotting it in practice

  • Whenever a headline number conflicts with a breakdown, look for a variable that changes both group sizes and outcomes.
  • Ask whether the splitting variable comes before or after the treatment in time.
  • Be suspicious of trend reversals when comparing teams, hospitals, schools or time periods with different mixes.

Simpson's paradox is not a paradox about arithmetic. It is a reminder that "controlling for" a variable is a causal decision, not a free improvement.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Simpson's paradox is best described as:

    Group-level and overall comparisons can point in opposite directions.
  2. 2. In the kidney stone example the reversal arises because:

    Size is a confounder; A treated more of the hard cases.
  3. 3. When should you prefer the overall comparison over the stratified one?

    Conditioning on a post-treatment variable can block part of the effect you want.
  4. 4. What resolves the paradox in a data-only way?

    The same table supports different conclusions under different causal stories.

Summary

  • Simpson's paradox is a trend reversal between group-level and pooled data.
  • It arises when a third variable affects both group sizes and outcomes (confounding).
  • Standardizing to a common case mix removes the artifact.
  • Whether to stratify depends on the causal graph, not on the numbers.

Next: Selection and Collider Bias