Tutorials › Regression Analysis (Undergraduate) › Simpson’s Paradox in Grouped Data

Multiple Regression as Adjustment · Tutorial 110 of 991

Simpson's Paradox in Grouped Data

Learn to recognize a reversal between pooled and within-group associations, explain it using group composition, and avoid interpreting the pooled pattern without context.

Beginner 10 min read

What You'll Learn

  • Define Simpson’s paradox for a pooled association and its within-group patterns
  • Calculate pooled means and within-group differences from grouped data
  • Explain a reversal using the group proportions at each predictor level
  • Decompose a pooled difference into within-group and composition components
  • Recognize why a reversal does not establish a causal explanation
  • Distinguish an actual reversal from a pooled pattern that keeps the same direction

When the Overall Pattern Reverses

An overall comparison can tell a different story from comparisons made separately within relevant groups. For example, an outcome may be higher at one predictor level in each group, yet lower at that predictor level after all groups are pooled. This is not an arithmetic contradiction. The pooled comparison combines observations using the group proportions present at each predictor level, and those proportions may differ sharply.

This pattern is called Simpson’s paradox. It is important in regression analysis because an overall association and an association adjusted for a group variable need not have the same direction. The reversal is a feature of how the data are distributed across groups; by itself, it does not show that one comparison is correct or that either comparison describes a causal effect.

Definition: Simpson’s paradox occurs when an association in pooled data differs in direction from the associations observed within each of several groups. In the classic reversal, the pooled association points in one direction while every within-group association points in the opposite direction. The word “paradox” describes the apparent conflict; the results are compatible because the pooled and within-group comparisons use different group compositions.

To make the comparison precise, let \(X\) be a binary predictor with values 0 and 1, let \(Y\) be a quantitative outcome, and let \(G\) identify a group. For a group \(g\), the within-group difference is \(\bar{y}_{1g}-\bar{y}_{0g}\), where \(\bar{y}_{1g}\) and \(\bar{y}_{0g}\) are the sample mean outcomes at \(X=1\) and \(X=0\) in that group. The pooled difference is \(\bar{y}_{1}-\bar{y}_{0}\), calculated without separating the groups.

When \(X\) is coded 0 and 1, the slope from a least-squares regression of \(Y\) on \(X\), with an intercept, equals the difference in the two sample means: \(\hat{\beta}_1=\bar{y}_{1}-\bar{y}_{0}\). The fitted value at \(X=0\) is the mean for observations with \(X=0\), and the fitted value at \(X=1\) is the mean for observations with \(X=1\); their difference is the slope. Thus, in this setting, comparing pooled means is also comparing the direction of the unadjusted regression slope.

A Worked Reversal in Pooled Means

Worked Example: A Score Comparison by Preparation Group

Hypothetical data. A class records a 0-to-40 practice score for students using either the usual study plan (\(X=0\)) or an optional study plan (\(X=1\)). Students are also classified by prior preparation. The table gives the number of students and their mean scores in each group.

Prior preparationStudy planNumber of studentsMean score (points)
LowerUsual (\(X=0\))1010
LowerOptional (\(X=1\))9012
HigherUsual (\(X=0\))9030
HigherOptional (\(X=1\))1032

Compare within the lower-preparation group. The optional-plan mean is 12 points and the usual-plan mean is 10 points, so the difference is \(12-10=2\) points.

Compare within the higher-preparation group. The corresponding difference is \(32-30=2\) points. The optional-plan mean is higher by 2 points in both groups.

Pool the groups at \(X=0\). There are 10 lower-preparation students with a mean of 10 and 90 higher-preparation students with a mean of 30. The pooled mean is the weighted mean:

$$ \bar{y}_{0} =\frac{10(10)+90(30)}{10+90} =\frac{100+2700}{100} =28\text{ points}. $$

Pool the groups at \(X=1\). There are 90 lower-preparation students with a mean of 12 and 10 higher-preparation students with a mean of 32:

$$ \bar{y}_{1} =\frac{90(12)+10(32)}{90+10} =\frac{1080+320}{100} =14\text{ points}. $$

The pooled difference is \(14-28=-14\) points. Therefore, the pooled data show a lower mean score for the optional plan, even though the optional-plan mean is 2 points higher within each preparation group. There is no contradiction: most usual-plan students are in the higher-preparation group, while most optional-plan students are in the lower-preparation group.

Why the Group Proportions Matter

A pooled mean is a weighted average of the group means. The weights are the proportions of observations from each group at that predictor level. If those weights differ between \(X=0\) and \(X=1\), the two pooled means mix group outcomes differently. As a result, the pooled difference includes both changes within groups and changes in group composition.

The following identity makes that statement exact. Write \(w_{xg}\) for the proportion of observations at predictor level \(x\) that belong to group \(g\). The weights at each level add to 1, and the pooled mean at that level is \(\bar{y}_x=\sum_g w_{xg}\bar{y}_{xg}\). Provided each group is observed at both predictor levels, add and subtract \(\sum_g w_{1g}\bar{y}_{0g}\) from the pooled difference:

$$ \begin{aligned} \bar{y}_1-\bar{y}_0 &=\sum_g w_{1g}\bar{y}_{1g}-\sum_g w_{0g}\bar{y}_{0g}\\ &=\sum_g w_{1g}(\bar{y}_{1g}-\bar{y}_{0g}) +\sum_g(w_{1g}-w_{0g})\bar{y}_{0g}. \end{aligned} $$

The first sum is a weighted average of the within-group differences, using the group proportions at \(X=1\) as weights. The second sum is a composition term: it reflects how the group proportions change between \(X=0\) and \(X=1\), combined with the groups’ mean outcomes at \(X=0\). Either term can influence the pooled result. Even if every within-group difference is positive, a sufficiently negative composition term can make the pooled difference negative.

In the score example, the lower- and higher-preparation proportions are \(0.10\) and \(0.90\) at \(X=0\), but \(0.90\) and \(0.10\) at \(X=1\). The weighted within-group component is:

$$ 0.90(12-10)+0.10(32-30)=0.90(2)+0.10(2)=2\text{ points}. $$

The composition component, using the \(X=0\) means, is:

$$ (0.90-0.10)(10)+(0.10-0.90)(30) =0.80(10)-0.80(30) =8-24=-16\text{ points}. $$

Adding the two components gives \(2+(-16)=-14\) points, exactly the pooled difference. The positive within-group pattern is more than offset by the fact that the \(X=1\) observations are concentrated in the group with lower scores.

Worked Example: Reversal in Success Rates

Worked Example: A Hypothetical Program and Baseline Risk

Hypothetical data. Suppose a program is associated with successful completion at a higher rate within both baseline-risk groups. Among lower-risk participants, 72 of 90 without the program complete successfully, while 9 of 10 with the program do. Among higher-risk participants, 1 of 10 without the program completes successfully, while 18 of 90 with the program do.

Lower-risk group. The rates are \(72/90=0.80\), or 80%, without the program and \(9/10=0.90\), or 90%, with it. The within-group difference is \(90\%-80\%=10\) percentage points.

Higher-risk group. The rates are \(1/10=0.10\), or 10%, without the program and \(18/90=0.20\), or 20%, with it. The within-group difference is also \(20\%-10\%=10\) percentage points.

Pool the participants without the program. There are \(72+1=73\) successful completions among \(90+10=100\) participants, so the pooled rate is \(73/100=73\%\).

Pool the participants with the program. There are \(9+18=27\) successful completions among \(10+90=100\) participants, so the pooled rate is \(27/100=27\%\). The pooled difference is \(27\%-73\%=-46\) percentage points, opposite in direction to both within-group differences.

The pooled groups have different baseline-risk compositions: 90% of the participants without the program are lower-risk, while 90% of those with it are higher-risk. That difference in composition accounts for why the pooled rate cannot be read as a summary of the within-group comparisons. These hypothetical observational rates alone do not establish that the program causes a change in completion.

A Reversal Is Possible, Not Inevitable

Different group proportions can produce a reversal, but they do not guarantee one. To see the distinction, retain the two preparation groups and the four mean scores from the first example, but suppose each group contributes 50 students at each study-plan level. The group means remain 10 and 12 points for the lower-preparation group and 30 and 32 points for the higher-preparation group.

Worked Example: Balanced Group Proportions

Hypothetical data. At each study-plan level there are 50 lower-preparation and 50 higher-preparation students. The within-group differences remain \(12-10=2\) points for lower preparation and \(32-30=2\) points for higher preparation.

At \(X=0\), the pooled mean is:

$$ \bar{y}_0 =\frac{50(10)+50(30)}{100} =\frac{500+1500}{100} =20\text{ points}. $$

At \(X=1\), it is:

$$ \bar{y}_1 =\frac{50(12)+50(32)}{100} =\frac{600+1600}{100} =22\text{ points}. $$

The pooled difference is \(22-20=2\) points, in the same direction as both within-group differences. Here, the group proportions are identical at the two predictor levels, so there is no change in group composition to counteract the within-group pattern.

How to Read a Pooled Association Carefully

A reversal is a signal to inspect how the data are distributed, not a reason to discard one summary automatically. The pooled association describes the observed combined groups. The within-group associations describe comparisons among observations sharing the specified group category. These answer different descriptive questions because they use different comparisons and, in general, different weights.

In regression analysis, including a group variable as a predictor can express comparisons that hold group membership fixed, whereas a regression using only \(X\) describes the pooled relationship. The precise adjusted comparison depends on the model and data; the arithmetic examples here do not establish that every possible adjustment will produce a particular single summary. In particular, a group-specific pattern should not be assumed to be constant in size merely because its direction agrees across groups.

A group variable may be important for understanding the observed association, but a reversal alone does not establish why the predictor and group are related, whether the group is an appropriate adjustment variable, or whether any association is causal. Those conclusions require information and assumptions beyond the pooled and grouped means or rates. Describe what the data show and identify the group composition that contributes to the discrepancy.

Common Mistake

  • Wrong reasoning: “The pooled mean is lower at \(X=1\), so the outcome must also be lower at \(X=1\) within the groups.” This treats a pooled average as though it used the same group proportions as each within-group comparison.
  • Correction: Calculate the group-specific means or rates and compare the group proportions at each predictor level. The overall comparison can reverse when it combines groups in different proportions.
  • Another overreach: “Because the direction changes after grouping, the group variable must be the cause of the reversal.” A composition difference can explain the arithmetic pattern, but a descriptive reversal by itself does not establish a causal explanation.
Key takeaway: A pooled association is a weighted combination of group outcomes, and its weights can differ across predictor levels. When the group proportions vary, the pooled direction can oppose every within-group direction. Report the comparison level and examine group composition before interpreting the association.

Check Your Understanding

Use the definitions and calculations in this tutorial to answer the following questions.

  1. In your own words, define Simpson’s paradox and explain why it is not an arithmetic contradiction.
  2. In the score example, which preparation group is more common at \(X=1\), and how does that help explain the pooled difference?
  3. For two groups, suppose the within-group differences are both positive. What must be true of the composition term in the displayed decomposition for the pooled difference to be negative?
  4. Why does equal representation of both preparation groups at each predictor level prevent a composition-based reversal in the balanced example?
  5. Does a reversal between pooled and within-group success rates establish that a program causes a change in success? Explain briefly.