Simpson’s Paradox Visualizer illustration

Simpson’s Paradox Visualizer

Simpson’s paradox is when a trend that holds inside every subgroup flips once the groups are combined. This visualizer plots two coloured groups, each with its own upward regression line, while the pooled regression line runs downward. Drag the separation between the groups and their sizes and watch the overall slope reverse sign even though nothing about the within-group relationships changes — a lurking variable (which group a point belongs to) is driving the illusion.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Each subgroup can show a positive relationship while the combined data shows a negative one, purely from how the groups are placed.
  • The reversal comes from a confounding variable — group membership — correlated with both axes.
  • The fix is to analyse within groups, or model the confounder, rather than trusting the pooled trend.
  • Runs 100% in your browser — simulations are computed locally on your device.