Simpson's Paradox

A relationship seen inside each subgroup reverses when the groups are pooled. The coloured lines slope upward within each group, but the red pooled line slopes downward.

Group A Group B Group C+ pooled fit group-means fit
Average within-group effect
Pooled association
Group-means association
Paradox visible
Model and methodology

Model

Seeded synthetic groups have adjustable means, spread, noise and a common within-group slope. Ordinary least-squares lines are fitted within groups, to the pooled sample and to the group means.

Assumptions and limitations

Pooled and within-group associations answer different questions. A reversal alone does not identify the causal effect or determine which variables should be adjusted for. The indicator here specifically detects a positive average within-group slope with a negative pooled slope; other reversals can be explored in the plot.

References

E. H. Simpson (1951), The Interpretation of Interaction in Contingency Tables. This is a continuous regression illustration of the aggregation effect. Implementation.