Skip to content

When correlations mislead: restricted ranges and hidden groups

The same relationship can look weak, strong or reversed depending on who is in your sample. Learn the two traps that do this most often.

Applied ~11 min9 steps

What runs in CodeSplash

You will be able to

  • Predict how restricting the range of a variable changes r
  • Recognize Simpson's paradox in a table or a scatterplot
  • Decide when to stratify and when to adjust

Read first

01

Why a test can look useless

Read

A company hires only applicants who score high on an aptitude test. Later, among those hired, test scores barely correlate with job performance. Is the test useless?

Not necessarily. Range restrictionRange restrictionSelecting a narrow slice of a variable shrinks its correlation, though the underlying relationship hasn't changed. shrinks correlations: when everyone in the sample has a similar score, there's little variation left for the score to explain.

02

Predict, then restrict

Explore

Predict first

Start with a correlation near r=0.7r = 0.7 across everybody, then keep only the top quarter of xx. What happens to r?

It stays about the sameIt fallsIt rises
Reveal

It falls, often by a lot. Try it below: drag the selection window and watch r change while the relationship itself stays the same.

CExplorable · Range restriction

Why does a test seem useless among the people it was used to select?

What is the correlation among those selected?

0.25
How sure?
0.60
0.75
400

Everyone: r = 0.62. Highlighted (300 points): r = 0.50. Corrected estimate for the full range: 0.61.

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

The reverse also happens. Picking only the extremes, the very best and the very worst, inflates r.

03

Hidden groups

Read

The second trap comes from combining groups. In iris, sepal length and sepal width correlate at r = −0.118 across all 150 flowers: slightly negative.

Within each species, though, longer sepals are also wider. Species differ in both measurements, and pooling them hides the pattern. When combining groups reverses a relationship, that's Simpson's paradoxSimpson's paradoxA trend seen in the pooled data disappears or reverses inside the groups, because group size is tied to the outcome..

04

See the reversal

Explore

EExplorable · Simpson's paradox: Berkeley admissions

Can a comparison reverse when you split the data into groups?

Overall, men were admitted more often. Within departments, who is usually admitted more often?

How sure?

View

45%Men30%Women

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

Berkeley's 1973 admissions data is the classic case. Overall, men's odds of admission were 1.84 times women's. Department by department, the gap mostly vanished or reversed, because women applied more often to departments that rejected most applicants.

05

Stratify or adjust?

Read

When you suspect a third variable, you have two tools:

  • Stratify: look at the relationship inside each group. It's transparent, but needs enough rows per group.
  • Adjust: a partial correlation or a regression pools what the groups share. In iris, sepal and petal length correlate at 0.872 overall and 0.756 within species.

For tables, the Cochran–Mantel–Haenszel test pools 2×2 tables across strata.

06

Which answer is right?

Reflect

Simpson's paradox has no statistical fix on its own: the pooled and within-group numbers are both correct descriptions. Which one answers your question depends on why the groups differ.

If department choice happens before the admissions decision, the within-department comparison speaks to how each department decides. Think of a recent comparison of yours. What could be lurking behind it?

07

Check your understanding

Checkpoint

Check yourself

Among students admitted to a selective college, admission-test scores barely predict first-year grades. Which is the best explanation to check first?

Show the answer

Answer: b

Selection on a variable reduces its spread, and so its correlation with other variables. The correlation among all applicants could be much larger.

Check yourself

Treatment A beats B in younger patients and in older patients, but B beats A overall. How can that be?

Show the answer

Answer: b

This is Simpson's paradox. Pooling mixes the treatment comparison with the imbalance in age.

Check yourself

Does collecting ten times as many rows fix confounding?

Show the answer

Answer: b

More rows shrink random error, not systematic bias. The interval gets narrower around the wrong value.

08

Check your own data

In the app

Pick a correlation you've reported, then add a plausible grouping column as a covariate and compare the raw and partial values on the card.

09

Recap

Recap
  • Restricting the range of a variable shrinks correlations; selecting extremes inflates them.
  • Combining groups can hide or reverse a relationship.
  • Stratify to see it and adjust to summarize it, but decide which number answers your question from how the data came to be.

Concepts in this lesson