When two quantities rise together (when they are correlated), that is not evidence that one causes the other. A third variable that drives both may be hiding behind the relationship.
Longevity and home range are clearly correlated
Line up primate species by their recorded maximum longevity and the size of their home range (the area a group or individual normally uses), and a clear tendency appears: longer-lived species have larger home ranges. Across the 100 species with records for all three of body mass, longevity, and home range, the correlation coefficient is 0.65.
Faced with this relationship, more than one explanation is possible.
Species that live longer may, over a long lifetime, learn and come to use a wider area.
Species that can use a wider area may secure food more reliably and so live longer.
Larger-bodied species may live longer, and larger bodies may use wider areas. There would then be no direct link between longevity and home range.
A variable like the one in the third explanation, which influences both quantities and creates a spurious correlation between them, is called a confounding variable (a third variable). The correlation coefficient alone cannot tell these three explanations apart.
Body mass is strongly tied to both longevity and home range
First, check body mass, the candidate third variable. In the same 100 species, body mass is correlated with both longevity and home range at 0.74. That is a stronger relationship than the 0.65 between longevity and home range themselves.
Both axes use log scales. Body mass ranges from 48 grams to about 110,000 grams, and home range spans several thousandfold, so on ordinary scales a few large species would take over the whole figure. All correlation coefficients below are calculated on the logarithms (log10) of the values.
- Species
- —
- Body mass vs. x
- —
- Body mass vs. y
- —
- Raw r
- —
- r without body mass
- —
Point color shows body mass: light blue for lighter species, dark navy for heavier species. The dashed line is the straight line that best fits the points.
How it works: the correlation coefficient and partial correlation
The correlation coefficient r expresses the strength of the straight-line relationship between two quantities as a number from −1 to 1. The closer it is to 1, the more closely the points follow an upward straight line; the closer to −1, a downward straight line; near 0, no straight-line relationship is visible. It multiplies together the directions in which each species’ values deviate from their means, averages the result, and divides by the overall spread.
A correlation with the effect of a third variable z removed is called a partial correlation. Predict x and y each from z with a straight line, then take the correlation between the deviations from those predictions (the residuals). When you choose “Remove the effect of body mass” in the panel above, the scatter plot of these residuals is what you see. The same value can also be obtained from the three correlation coefficients with the following formula.
| Pair (z = body mass) | Species | rxz | ryz | Raw r | r without body mass |
|---|---|---|---|---|---|
| Longevity × home range | 100 | 0.74 | 0.74 | 0.65 | 0.23 |
| Gestation × longevity | 106 | 0.70 | 0.75 | 0.56 | 0.07 |
| Longevity × group size | 116 | 0.72 | 0.61 | 0.48 | 0.07 |
In all three pairs, the correlation drops sharply once body mass is removed. The square of r is a rough measure of “the share of the variation in one quantity that moves in a straight line with the other”; for longevity and home range it falls from 0.42 to 0.05. Most of the apparent relationship can be read as running through body mass. A weak relationship of 0.23 remains between longevity and home range, and what other than body mass produces it cannot be determined from these data alone.
Common misconceptions
“The stronger the correlation, the stronger the causal effect”
A correlation coefficient only expresses how closely the points line up along a straight line. The 0.65 between longevity and home range is a reasonably strong correlation, yet it fell to 0.23 once body mass was held equal. A strong correlation can also arise from strong confounding.
“Removing body mass made the correlation vanish, so body mass is proven to be the cause”
A partial correlation can only remove the effects of variables that were measured and put into the formula. Body mass itself is entangled with other factors, such as closely related species tending to resemble each other. What the partial correlation shows is that “with body mass held equal, the relationship is barely visible”; it does not go as far as identifying the cause.
“A correlation near 0 means the two are unrelated”
The correlation coefficient only captures straight-line relationships. A hump-shaped relationship, or one that is strong only over part of the range, can produce a small r. This page takes logarithms before calculating for the same reason: for quantities spanning many orders of magnitude, a straight-line relationship is hard to see on the raw scale.
“A correlation with variables removed is always the right one”
What to remove depends on assumptions about the causal pathways. Removing a variable that is itself influenced by both x and y can create a spurious correlation between two quantities that were originally unrelated. Before removing a variable, you need to think about where it sits in the causal structure.
Covered in the courses
The course sites are in Japanese and open to anyone. To go further, visit the page for each session.
Data: Jones, K. E. et al. (2009) PanTHERIA: a species-level database of life history, ecology, and geography of extant and recently extinct mammals. Ecology 90: 2648. Of 376 primate species, uses the 100 species with body mass, maximum longevity, and home range size; the 106 species with body mass, gestation length, and maximum longevity; and the 116 species with body mass, maximum longevity, and group size. All correlation coefficients are calculated on the common logarithms (log10) of each variable.