Iris
Combined slope: +0.00
Group A slope: -0.00
Group B slope: -0.00
Group C slope: -0.00
Group A (Mild)
Group B (Moderate)
Group C (Severe)
The overall trend is positive, but every group's trend is negative — that is the paradox.
Group Separation 1.0
Within-Group Slope -0.60
Noise 0.30

What Is Simpson's Paradox?

Simpson's paradox occurs when a trend that appears in several groups of data reverses or disappears when the groups are combined. It is not a logical contradiction — it is a genuine phenomenon that arises from the structure of the data and the presence of a confounding variable.

The Classic Example

Consider a new medical treatment tested across three severity groups: mild, moderate, and severe. Within each group, the treatment has a negative effect on recovery time (worse outcomes). But severe patients are more likely to receive the treatment (because doctors preferentially prescribe it for serious cases), and severe patients also have higher baseline recovery times.

When you ignore severity and just look at treatment vs. outcome, the treatment group appears to do better — because it is enriched with mild cases from departments that prescribe it broadly. The confounding variable (severity) creates a spurious positive trend in the aggregate.

Why It Matters

Simpson's paradox shows up everywhere: in medical trials, university admissions (the famous Berkeley gender bias case of 1973), baseball batting averages, and policy decisions. It demonstrates why controlling for confounders is essential in statistical analysis and why raw aggregate statistics can be dangerously misleading.

The Math

Formally, the paradox arises when the marginal association between X and Y has a different sign than the conditional association given Z. If the groups defined by Z have different sizes and different means, pooling can reverse the trend. It is a reminder that correlation and conditional correlation can point in opposite directions.

This Visualization

The scatter plot shows data points from three groups (color-coded by severity). Toggle between "Combined" (one regression line through all data) and "By Group" (separate regression lines per group). Adjust the group separation, within-group slope, and noise to see how the paradox strengthens or weakens. The paradox is strongest when the groups are well-separated and the within-group slope opposes the between-group trend.