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.
- Answer the prediction question to open the laboratory.
- Work through the six datasets and read the number against the picture.
- Drag the highlighted point and watch what one observation can do.
- 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.
The laboratory
Six fictional datasets on the same axes. One point in each is ringed and can be dragged with the second control, and the units of y can be changed with the third.
Key terms
- Pearson's r
- How closely the points lie to a straight line, on a scale from −1 to 1.
- Shared variance (r²)
- The square of r. At r = 0.5 the shared variance is a quarter, not a half.
- Monotonic
- Consistently rising or falling without being straight. A rank-based coefficient such as Spearman's is defined for this; Pearson's r is defined in terms of straightness.
- Influence
- How far one observation can move the statistic. It depends on where the point sits, not only on how extreme it looks.
One number, six pictures
Read the number and the picture together, every time. Several of these datasets produce a number that would be badly misleading on its own.
The scatterplot
| Quantity | Value |
|---|
What this number is telling you
The same dataset with the ringed point removed
| Quantity | With the point | Without it |
|---|
Challenge — the eyeball test
Three fictional scatterplots. Estimate Pearson's r for each one on the slider beneath it, then check all three at once. People are reliably bad at this in one particular direction, and finding out which is the point.
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.
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.