Group A
Group B
Group C and beyond
pooled fit, ignoring group
fit to group averages
Average fitted effect inside groups
Estimated separately in each coloured group, then averaged.
Pooled fitted association
Estimated after ignoring group membership.
Group-means association
Estimated using only the labelled group averages.
Paradox visible?
Yes when the within-group slopes are positive but the pooled slope is negative.
What to look for. The coloured lines estimate the relationship between X and Y inside each group. The thick red line estimates the relationship after all groups are pooled. Simpson's paradox appears when the coloured lines slope upward, but the red pooled line slopes downward. The dashed grey line shows the association among group averages, which is the source of the reversal in this setup.