Through a cloud of points, draw the straight line that makes the total of the squared deviations as small as possible. Its slope puts a number on the relationship, and the points that stray from the line show what the equation cannot explain.
Body size, and the amount of land a species uses
Primates range from species weighing 48 grams to species weighing more than 110,000 grams. Larger species also tend to have a larger home range, the area an animal normally moves around in. A scatter plot is enough to see this much.
Regression answers the next question. When body mass is ten times larger, is the home range ten times larger, or less than that? And which species depart from that trend, and by how much?
On ordinary scales, most species overlap in the lower-left corner and the shape of the relationship cannot be read. Body mass spans more than a 2,000-fold range, and home range size more than a 10,000-fold range. The hands-on panel below therefore puts both axes on a log scale, where each tick mark is ten times the previous one.
- Species
- —
- Least-squares slope
- —
- Body mass ×10 gives
- —
- R²
- —
- RSS: your line
- —
- RSS: least squares
- —
- RSS: flat line
- —
How it works: least squares, and the slope on log-log axes
The vertical distance between a point and the line is called a residual. Residuals can be positive or negative, so they are squared before being added up. The method that chooses the line with the smallest residual sum of squares is called least squares, and the line it produces is the regression line. However you move the sliders in the panel above, you cannot get a smaller residual sum of squares than the least-squares line.
Because both axes are logarithmic, the slope of 0.933 is read as a multiplicative relationship, not an additive one. When body mass becomes k times larger, the predicted home range becomes k to the power 0.933 times larger. A slope of exactly 1 would mean “ten times the body mass, ten times the home range”; 0.933 is a little less than that.
| Body mass larger by | Predicted home range larger by |
|---|---|
| 2× | 1.9× |
| 10× | 8.6× |
| 100× | 73.6× |
The coefficient of determination, R², is the share of the variation on the vertical axis that the line explains. The “flat line” in the panel predicts every species with the overall mean, without using body mass; its residual sum of squares is the total variation on the vertical axis. R² is how much of that the least-squares line removes.
With the same body mass on the horizontal axis, both the slope and R² differ completely depending on the variable on the vertical axis.
| Variable on the vertical axis | Species | Slope | Body mass ×10 gives | R² |
|---|---|---|---|---|
| Home range size | 153 | 0.933 | 8.6× | 0.46 |
| Neonate body mass | 117 | 0.828 | 6.7× | 0.92 |
| Maximum longevity | 125 | 0.199 | 1.6× | 0.53 |
| Population density | 170 | −0.418 | 0.38× | 0.20 |
Reading the points off the line
For home range, the species farthest above the line is the patas monkey (Erythrocebus patas). With a body mass of 7,966 grams it has a home range of 28.24 square kilometres, about 49 times the line’s prediction. Any single departure might reflect a difference in how the data were measured, or a feature of how that species lives. The numbers alone cannot tell which.
Take care when departures are consistent within a group. Against the home range line, the 25 species of Cebidae lie on average at about 3 times the prediction, and the 6 species of Indriidae at about 0.18 times. You can check this with “Highlight a family”. A single line summarizes the average trend across all species, and it does not necessarily fit every family equally well.
Does adding variables make a better model?
If group size, temperature, or other variables are added to the equation alongside body mass, R² always rises or at least does not fall. Yet an equation fitted too closely to the data at hand predicts new species worse. Balancing goodness of fit against the simplicity of the equation is called model selection; session 11 of Statistics I covers it using an index called AIC.
Common misconceptions
“If R² is low, there is no relationship”
For population density R² is only 0.20, but the slope is −0.418, so the direction is clear: a species with ten times the body mass has about 0.38 times the density. A low R² means that many factors other than body mass affect density, and the points scatter widely around the line.
“The slope is the effect of changing body mass”
A regression slope is an association: how home range differs when species of different body mass are lined up side by side. It does not show the causal claim that increasing a species’ body mass would enlarge its home range. The same slope would appear if some other factor influenced both body mass and home range (03 Correlation and causation).
“A line that fits well can be used beyond the range of the data”
The home range line was estimated from species weighing from 48 grams to about 110,000 grams. Within that range it predicts about 0.083 square kilometres at a body mass of 1 kilogram and about 0.71 square kilometres at 10 kilograms. Nothing in these data guarantees that the relationship stays straight outside that range (extrapolation).
“The least-squares line fits every species fairly”
The least-squares line only makes the overall residual sum of squares small. It can be pulled toward families with many species, while families with few species all sit off the line together. As the Cebidae and Indriidae example shows, some biases only become visible when residuals are examined family by family.
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 the 376 primate species, those with records for both body mass and each variable are used (home range size 153 species, neonate body mass 117, maximum longevity 125, population density 170). All lines are fitted by least squares after taking base-10 logarithms.