Properties of the correlation coefficient
If one scientist measures in centimeters and another in inches, or one puts a variable across and the other puts it up, do they get the same r? And can one unusual individual change it?
Where you are 3 in Correlation
Why this exists
The correlation coefficient puts one number, r, on the direction and strength of a straight-line pattern in a scatter plot. Before leaning on a number like that, you want to know what moves it. If one scientist measures birds in centimeters and another in inches, can they compare their values of r? Does it matter which variable goes across? Can one unusual individual change the verdict? The answers decide when two values of r can be compared at all, and when r should not be trusted until somebody has looked at the plot.
Definition
This star collects the properties of the correlation coefficient r of paired data (x, y): what leaves it alone, what changes it, and which values it can take.
Two words are used throughout. Changing the units of a variable multiplies every value by the same positive number (centimeters to inches divides by 2.54), and sometimes adds a constant as well (degrees Celsius to degrees Fahrenheit multiplies by 1.8 and adds 32). A summary is resistant when a few extreme values barely move it (Resistant and non resistant measures): the median is resistant, the mean is not.
Intuition
r measures how tightly the dots cluster about a straight line, judged in the cloud’s own shape. Change the units and the scales get new numbers; redraw the plot to fit its frame and every dot sits exactly where it did. Add a constant to every value and the cloud slides along an axis without changing shape. Neither can move r.
Swapping which variable goes across reflects the cloud in a diagonal. A thin band stays a thin band, so r stays. Multiplying one variable by a negative number mirrors the cloud, turning a climbing band into a falling band exactly as thin: the size of r stays and its sign flips.
What r does respond to is where each dot sits relative to the center of the cloud, and like the mean it gives an extreme dot its full weight. One dot far from the rest can decide much of what the cloud looks like to r.
Results
- No units. r is a pure number. Changing the units of either variable, or adding a constant to every value of either variable, leaves r unchanged. In symbols: replacing every x by ax + b with a > 0 does not change r, and the same holds for y.
- Sign flip. Multiplying every value of one variable by a negative number changes r to -r.
- Symmetry. Swapping the variables leaves r unchanged. The least-squares line does change, and the two slopes are reciprocals only when r = 1 or r = -1.
- Range. Always -1 \le r \le 1.
- Not resistant. One point far from the rest can raise or lower r a great deal.
Why it is true
Units and constants. Shifting and rescaling a data set showed what happens to one variable: adding a constant moves its center and leaves its spread alone, and multiplying by a positive number scales the center and the spread by the same factor. r uses each value only through how far it sits from the center, measured against the spread. Adding a constant changes neither that distance nor the spread; multiplying scales both by the same factor, which cancels. So r cannot see either change.
Sign. Multiplying by -1 turns every distance from the center in that variable round: a dot that sat above the center now sits below it by the same amount. Dots that were high on the right are now low on the right, so the band falls instead of climbing, just as thin. Any negative multiplier is -1 times a positive one, and the positive part changes nothing, so every negative multiplier flips the sign of r and leaves its size alone.
Symmetry. r treats its two variables in exactly the same way, so it cannot tell which one is across. The least-squares line is different: the line for predicting y makes the vertical misses small, the line for predicting x makes the horizontal misses small (The least squares criterion and its line). Only when every dot lies on one line are both kinds of miss zero for the same line.
Range. Why r can never pass 1 or -1 needs the way r is computed, met in Correlation from standardized values.
Not resistant. r is built from distances to the center of the cloud, like the mean and the standard deviation, and those are not resistant. A dot far away carries a large distance, so it outweighs many ordinary dots.
Worked examples
All data are made up. Every r is found with technology (a calculator’s or spreadsheet’s correlation function) and rounded to two decimals.
Birds in two systems of units
A ranger, Nadezhda, measured the wingspan and body mass of eight small birds. A colleague converted every value to inches and ounces, rounding to two decimals. In the table, cm and in are wingspans, g and oz are masses.
| Bird | cm | g | in | oz |
|---|---|---|---|---|
| 1 | 22 | 18 | 8.66 | 0.63 |
| 2 | 25 | 30 | 9.84 | 1.06 |
| 3 | 27 | 22 | 10.63 | 0.78 |
| 4 | 30 | 40 | 11.81 | 1.41 |
| 5 | 33 | 34 | 12.99 | 1.20 |
| 6 | 36 | 58 | 14.17 | 2.05 |
| 7 | 38 | 48 | 14.96 | 1.69 |
| 8 | 41 | 62 | 16.14 | 2.19 |
Find r for mass against wingspan in both systems.
SolutionThe first two columns give r = 0.92. The last two give r = 0.92 as well. The figure above shows why: each converted wingspan is the old one times \displaystyle \frac{1}{2.54}, and each converted mass the old one times \displaystyle \frac{1}{28.35}, so the whole cloud is squeezed across by one factor and up by another, and redrawn to fit its frame the picture is unchanged. Rounding to two decimals nudges each dot by a tiny amount, which is why the two agree to two decimals rather than to every digit; converted without rounding they would agree exactly. And r = 0.92 carries no unit: not grams per centimeter, not ounces per inch, just 0.92.
Sliding and flipping one variable
(a) Suppose Nadezhda’s birds had been weighed in a cloth bag of mass 5 g that was never subtracted, so the masses read 23, 35, 27, 45, 39, 63, 53, 67 g. (b) Suppose instead the record gave how many grams short of 100 g each bird is: 82, 70, 78, 60, 66, 42, 52, 38. Find r for each against wingspan.
Solution(a) Every mass is 5 more than before. On the plot the cloud slides up 5 g and nothing else changes, so r = 0.92, as technology confirms.
(b) Each new value is 100 - m, that is -1 \cdot m + 100. Adding 100 changes nothing, as in part (a). Multiplying by -1 turns the plot upside down: the heaviest bird is now the lowest dot. The band is exactly as thin but now falls, so r = -0.92. Both numbers tell the same story about the birds: a longer wingspan goes with more mass, or, in the second record, with fewer grams short of 100.
Swapping the variables
For Nadezhda’s birds in centimeters and grams, find r and the least-squares line (a) with wingspan across, for predicting mass, and (b) with mass across, for predicting wingspan. Are the two slopes reciprocals?
(a) Technology gives r = 0.92 and the line \text{predicted mass} = 2.22w - 30.91, where w is the wingspan in cm: a slope of 2.22 grams per centimeter.
(b) With mass across, r = 0.92 again: plot (b) is plot (a) reflected, and the band is just as thin. The line is \text{predicted wingspan} = 0.38m + 16.66, where m is the mass in g: a slope of 0.38 centimeters per gram.
If the two were one line rewritten, the second slope would be \displaystyle \frac{1}{2.22} \approx 0.45. It is 0.38, so they are different lines. Go there and back to see it. Line (a) predicts, for a 41 cm wingspan, a mass of 2.22(41) - 30.91 \approx 60.1 g. Line (b), given 60.1 g, predicts a wingspan of 0.38(60.1) + 16.66 \approx 39.5 cm, not 41. Each line is the best one for predicting its own response variable (Predicting with a regression line, and extrapolation), so the variable you want to predict goes up. The two lines coincide only when every dot lies on one line, that is when r = 1 or r = -1.
A far volunteer in line with the trend
Lucian ran a beach clean-up. Ten volunteers recorded the hours they worked and the kilograms of litter they collected: (3, 14), (4, 9), (4, 18), (5, 12), (6, 20), (6, 11), (7, 16), (8, 13), (8, 21), (9, 15). Then Milena, who worked all three days, reported (30, 80). Find r without her and with her, and say what the change means.
Without Milena, r = 0.30: a weak positive association. Among the ten, one person who worked 8 hours collected 13 kg, less than one who worked 4 hours and collected 18 kg.
Milena collected at much the rate the others did: the ten together gathered 149 kg in 60 hours, about 2.5 kg an hour, and she gathered 80 kg in 30 hours, about 2.7 kg an hour. So her dot lies along the rough upward trend, but far beyond everyone else. With her, r = 0.96.
One dot turned a weak association into an apparently strong one. To r, the cloud is now a small clump at the lower left and one dot far to the upper right, and those two places lie close to a line. Her hours are far out by any measure. For the eleven, the quartiles of the hours are Q_1 = 4 and Q_3 = 8, so the fence of a Box plots that show outliers sits at 8 + 1.5(8 - 4) = 14 hours, and 30 is far beyond it. The honest report gives both values and the plot: for volunteers who worked a normal shift, hours say little about litter.
A far volunteer off the trend
At a second clean-up, ten volunteers recorded (2, 9), (3, 17), (4, 18), (5, 27), (6, 28), (7, 37), (8, 39), (9, 46), (10, 49), (12, 62). Manfred worked 24 hours but spent most of them sorting the bags for recycling, and collected 30 kg. Find r without him and with him.
Without Manfred, r = 0.99: the ten lie almost on a line, at about 5 kg an hour. The least-squares line through them, \text{predicted kg} = 5.11h - 0.50, would expect about 122 kg from 24 hours. Manfred collected 30.
With him, r = 0.44. One dot far to the right and far below the trend made a nearly perfect straight-line association look weak to moderate. Ten of the eleven dots say that hours predict litter very well, and r says the opposite. Anyone reading r without the plot would be misled.
The cure is the same as in Example 4: plot before trusting r. On the plot Manfred stands out at once, and a residual plot would show him too. A fair report says: r = 0.99 for the ten who collected, with one volunteer who mostly sorted reported separately. Setting a point aside is a decision about the data, here that he did a different job, stated openly; it is never a way to get a nicer number. A point like Manfred’s, whose removal changes the fitted line a lot, is called influential, and not every outlier is (Outliers, leverage and influential points).
Boundaries
- Straight lines only. Every property here is about r, and r measures straight-line patterns. A strong curve can have r near 0 (The correlation coefficient).
- Multiply and add only. “No units” covers changes of the form ax + b. With a < 0 the sign flips. A change of another kind, such as squaring every value, generally does change r.
- Rounding. Converted values that are rounded can shift r in its later digits.
- The line is not symmetric. Swapping the variables keeps r but changes the least-squares line, unless r = \pm 1.
- Outside -1 to 1 is an error. A reported r = 1.3 means a mistake somewhere.
- Not resistant. With few points, or with one far point, r alone can mislead; read it beside the plot.
- Not a cause. However close r is to 1 or -1, it says nothing about whether one variable changes the other (Correlation is not causation: lurking and confounding variables).
Where this goes next
Because r has no units and ignores which variable is across, it can be compared between studies measured in different units. The slope of the least-squares line, which does depend on units and on direction, turns out to be r times a ratio of spreads (Slope from r and the spreads, and regression to the mean), which is why the two slopes in Example 3 differ. Far points that move r and the line are sorted into outliers, high-leverage points and influential points in Outliers, leverage and influential points, and Making and reading residual plots give a second look at whether a line suits the data at all. Why a strong r still does not show cause is the subject of Correlation is not causation: lurking and confounding variables and Observational studies and experiments.
Exercises
All data are made up. Use technology for each r and round to two decimals.
Units, shifts and sign
- On six days a pool recorded the high temperature in ^\circC and the number of visitors: (18, 120), (21, 150), (24, 210), (26, 190), (29, 260), (31, 300). (a) Find r. (b) In ^\circF the temperatures are 64.4, 69.8, 75.2, 78.8, 84.2, 87.8. Without technology, give r for visitors against temperature in ^\circF, then check.
- Nadezhda’s wingspans (Example 1) are rewritten in meters. What is r for mass against wingspan?
- Nadezhda finds her ruler’s zero was 2 cm off, so every wingspan in Example 1 should be 2 cm longer. What is r after the correction?
- Six students’ 100 m times in seconds and long-jump distances in meters are (12.5, 5.1), (13.0, 4.8), (13.4, 4.9), (13.9, 4.3), (14.2, 4.4), (14.8, 3.9). (a) Find r. (b) The coach records each time as seconds under 15: 2.5, 2.0, 1.6, 1.1, 0.8, 0.2. Find r for distance against this new record, and explain the change.
- Which of these change r, and how? (a) Converting every y from kilograms to pounds. (b) Adding 10 to every x. (c) Replacing every x by -3x. (d) Replacing every y by \displaystyle \frac{y}{2} + 7.
- A summary of Example 1 reads “r = 0.92 grams per centimeter”. What is wrong with it?
Swapping the variables
- For (1, 2), (2, 5), (3, 3), (4, 6), (5, 7), (6, 6), find r and the slope of the least-squares line for predicting y from x. Then swap the variables and find r and the slope for predicting x from y. Is the second slope the reciprocal of the first?
- Repeat Exercise 7 for (1, 3), (2, 5), (3, 7), (4, 9). What is different, and why?
Far points
- Find r for (1, 4), (2, 3), (3, 5), (4, 4), (5, 6), (6, 4). Then add the point (16, 15) and find r again.
- Find r for (1, 2), (2, 4), (3, 7), (4, 8), (5, 10), (6, 12.5). Then add the point (3.5, 20) and find r again.
- Take the ten volunteers of Example 5 and, instead of Manfred, add a volunteer who worked 7 hours and collected 70 kg. Find r and compare it with the 0.44 of Example 5.
- A newsletter prints only “r = 0.96” for the eleven volunteers of Example 4, under the headline “Hours worked predicted litter closely”. What should a reader ask to see first, and what would it show?
Reasoning
- A report gives r = 1.3 for two variables. What can you conclude?
- Explain, using the picture of a scatter plot, why converting centimeters to inches cannot change r.
- Explain why multiplying one variable by -1 changes the sign of r but not its size.
- Explain why swapping the variables leaves r unchanged but changes the least-squares line.
Answers
- (a) r = 0.97. (b) r = 0.97: each ^\circF value is 1.8 times the ^\circC value plus 32, a positive multiple plus a constant, so r cannot change. Technology confirms it.
- r = 0.92. Dividing every wingspan by 100 is a change of units.
- r = 0.92. Adding 2 to every wingspan slides the cloud sideways and changes nothing else.
- (a) r = -0.95: faster runners (smaller times) jump further. (b) r = 0.95. The new record is 15 - t, that is -1 \cdot t + 15: the -1 mirrors the cloud and flips the sign, and adding 15 changes nothing. A higher number now means a faster runner, so the association is positive.
- (a) No change: a change of units. (b) No change: adding a constant. (c) The sign flips, r becomes -r: multiplying by a negative number. (d) No change: a positive multiple plus a constant.
- r has no units. It is the pure number 0.92, and it would be the same in any units.
- r = 0.80 both ways. Predicting y from x, the slope is 0.83; predicting x from y, it is 0.77. The reciprocal of 0.83 is about 1.21, so no.
- r = 1 both ways. The slopes are 2 and 0.5, and \displaystyle 0.5 = \frac{1}{2}, so this time they are reciprocals. Every point lies on y = 2x + 1, so both lines are that line, read either way round.
- r = 0.41 for the six, a weak association; with (16, 15), r = 0.95. The new point sits far up and to the right of the clump, so to r the cloud is a clump plus one far dot, which lie close to a line.
- r = 0.99 for the six, very close to a line; with (3.5, 20), r = 0.59. One point far above the trend shrinks r a lot.
- r = 0.83, against 0.44 for Manfred. This volunteer is far above the trend but sits among the others in hours, so the dot pulls on the cloud less than Manfred’s, which was far from the others in hours as well as off the trend.
- The scatter plot. It shows ten volunteers in a loose cloud, with r = 0.30 for those ten, and Milena far out on her own; one dot produces the 0.96. For volunteers who worked a normal shift, hours predicted the litter only weakly, so the headline overstates what the data show.
- There is a mistake somewhere: in the calculation, the data entry or the copying. r always lies from -1 to 1.
- Converting divides every wingspan by the same number, 2.54. Redrawn to fit its frame, the plot has new numbers on one axis but every dot in the same place relative to the others. The band round the cloud is exactly as thin, and r measures only that.
- Multiplying by -1 mirrors the cloud: dots that sat above the center in that variable now sit below it by the same amount. A climbing band becomes a falling band, so the sign flips, but the band is just as thin, so the size stays.
- r treats the two variables in the same way, and swapping them only reflects the cloud in a diagonal, which leaves its thinness alone. The least-squares line for predicting y makes the vertical misses small, while the line for predicting x makes the horizontal misses small. Unless every point lies on one line, those are different jobs with different best lines.