Research Methods

Correlation: Linearity, Outliers and Shared Variance

Pearson's r measures how close two variables come to a straight line. It is not a measure of how related they are, and the difference is what this page is about.

Simulated — generated datasets from a documented seed

Learning objective

By the end you should be able to say what r measures and what it misses, and why a single observation can move it so far.

About 25 minutes. Nothing you do here is saved or sent anywhere.

Always plot it

Every trap on this page is invisible in the number and obvious in the picture. A strong curve gives r = 0. One point in a small sample can take r from 0.02 to 0.75. A change of units leaves r untouched while the slope moves by a factor of ten. No summary statistic can be trusted without the scatterplot it came from.

  1. Answer the prediction question to open the laboratory.
  2. Work through the six datasets and read the number against the picture.
  3. Drag the highlighted point and watch what one observation can do.
  4. Change the units of y and watch the slope move while r does not.

First, a prediction

A fictional study measures two things and finds a strong, unmistakable relationship: as x rises, y falls steeply, bottoms out around the middle of the range, and then rises again just as steeply. Plotted, it is a clean U. Every value of x predicts its y almost exactly.

What will Pearson's r be?

What this demonstrates

r measures straightness

Pearson's r is the average product of the two variables' z-scores. It answers one question: how closely do the points fall along a straight line, and in which direction? A clean curve has a perfect relationship and no consistent direction, so the products cancel and r comes out at zero. "No correlation" and "no relationship" are different findings, and only the picture distinguishes them.

r², said carefully

In this simple two-variable linear setting, r² is the proportion of the variance in y that the straight-line relationship with x accounts for, and 1 − r² is what it does not. Two cautions travel with that sentence. The word is accounted for, not caused by. And because it is a square, it falls away fast: r = 0.5 accounts for a quarter of the variance, and r = 0.3 for nine per cent.

One point, in a small sample, is enough

In the twelve-person dataset, dragging a single observation to the corner takes r from 0.02 to 0.75, because that point is now the only thing spanning the range. The same observation added to a hundred and twenty people moves the number much less. Influence is not about being extreme in y; it is about being extreme in x, where there is nothing else to hold the line down.

r and the slope are relatives, not synonyms

The regression slope is r times the ratio of the two standard deviations, so it carries units and r does not. Change y from one unit to another and the slope moves by exactly that factor while r stays where it was. That is why r can be compared across studies of different measures and a slope generally cannot — and why a large slope is not evidence of a strong relationship.

Download activity HTML

For teaching elsewhere: take this activity as one self-contained block of HTML, on the clipboard or as a file. Either way it is styled so that it will not disturb the page you put it into.