Correlation
One number, r, for how tightly two things move together in a straight line.
Do these two things move together?
Start with a picture. A scatterplot puts one variable on the horizontal axis and another on the vertical axis, then drops a dot for every pair of measurements: a person's height and weight, hours studied and quiz score, a car's age and its resale price.
Once you see the cloud of dots, your eye is already asking two questions. First, is there a direction — as one variable goes up, does the other tend to go up too, or down? Second, how tight is the pattern — do the dots sit almost on a line, or are they scattered into a shapeless blob? Correlation is just a way to answer both questions with a single number.
Reading the number
Think of r on a sliding scale:
- r = +1: a perfect uphill line — every point sits exactly on a rising straight line.
- r near +0.7: a clear uphill trend, but with scatter around it.
- r near 0: no straight-line tendency; knowing x tells you almost nothing about y.
- r near -0.7: a clear downhill trend with scatter.
- r = -1: a perfect downhill line.
Two things worth fixing in your mind right away: strength is about the magnitude \( |r| \), not the sign, so r = -0.9 is a stronger relationship than r = +0.5. And r is a pure number — it has no units, so it does not matter whether height is in centimeters or inches.
The two traps
Correlation is powerful precisely because it is one tidy number — and that tidiness hides two traps.
Trap 1: r only sees straight lines. Consider points that form a perfect, symmetric U-shape (a parabola). There is an obvious, strong pattern — yet r comes out near 0, because there is no net uphill or downhill straight-line trend: the rising half and the falling half cancel. A small r means no linear relationship, not no relationship at all. Always look at the scatterplot, not just the number.
Trap 2: correlation is not causation. A strong r tells you two things move together; it says nothing about why. Ice-cream sales and swimming-pool accidents rise and fall together across the year, but neither causes the other — a lurking third variable, hot weather, drives both. Correlation can hint at a relationship worth investigating, but on its own it cannot establish that one variable causes the other.
- Means: \( \bar{x} = (1+2+3+4+5)/5 = 3 \) and \( \bar{y} = (2+4+5+4+5)/5 = 4 \).
- x-deviations \( (x_i-\bar{x}) \): -2, -1, 0, 1, 2. y-deviations \( (y_i-\bar{y}) \): -2, 0, 1, 0, 1.
- Sum of products \( \sum (x_i-\bar{x})(y_i-\bar{y}) = 4 + 0 + 0 + 0 + 2 = 6 \).
- Spreads: \( \sum (x_i-\bar{x})^2 = 10 \) and \( \sum (y_i-\bar{y})^2 = 6 \).
- Put it together: \( r = 6 / \sqrt{10 \times 6} = 6/\sqrt{60} \approx 0.77 \).
Check your understanding
- A scatterplot shows the direction and tightness of the relationship between two variables; correlation r captures both in one number.
- r lives between -1 and +1: the sign is the direction, and the distance from 0 (the magnitude |r|) is the strength.
- r near ±1 means the points nearly form a straight line; r near 0 means little or no straight-line trend.
- r has no units, is symmetric in x and y, and is unchanged by rescaling a variable.
- r measures only LINEAR association — a strong curve like a parabola can give r near 0 — so always plot the data.
- Correlation is not causation: a strong r can come from a lurking variable or coincidence.