Simple Linear Regression
A biologist measures femur length in 50 birds. She wants to predict body mass from it. Correlation can tell her that leg length and mass rise together. But it cannot answer the practical question a field ecologist actually needs answered: if a bird's femur is 42 mm, what mass should I expect? That requires more than a coefficient describing strength of association. It requires an equation. Simple linear regression supplies exactly that equation. It turns a scatter of points into a predictive and explanatory model. This distinction matters throughout biology. Correlation and the Correlation Coefficient quantifies how tightly two variables move together. It does so symmetrically, with no sense of which variable drives which. Regression breaks that symmetry. One variable is designated the predictor (independent variable, often denoted ). The other is the response (dependent variable, ). The model describes how the mean of changes as changes. This lets biologists predict oxygen consumption from body mass. It also lets them estimate enzyme velocity from substrate concentration. They can also project population size from time. Or they can calibrate a spectrophotometer reading against known drug concentrations. The big picture is deceptively simple. Fit the straight line that comes closest to the data. Then use the slope, intercept, and scatter around that line. These describe the relationship and make predictions. When the next stage of inference is added, they also test whether the relationship is real or just noise. The mathematics is old. Legendre and Gauss developed least squares around 1805. But its adoption as a biological tool is inseparable from Francis Galton's 1886 studies of inheritance. From these studies, regression gets its curious name. This article builds the model from its assumptions upward. It covers what the regression line represents, and how it is fitted conceptually. It also shows how to read its slope and intercept biologically. It explains how the same logic that gave regression its name became the founding experiment of the whole method. This was Galton's discovery of "regression toward mediocrity" in inherited height. It closes with worked numerical examples, common errors, and the modern reach of this 200-year-old tool.
- Simple linear regression models a response variable as a linear function of one predictor : .
- Unlike correlation, regression is asymmetric — it distinguishes predictor from response and describes how changes as changes.
- The fitted line minimizes the sum of squared vertical distances between observed and predicted -values (least squares).
- The slope () is the predicted change in per unit change in ; the intercept () is the predicted when .
- Francis Galton's 1886 study of parent–offspring height established the method and revealed "regression toward the mean," the phenomenon that named the technique.
- Regression underlies growth curves, dose–response calibration, allometric scaling, and countless biomedical prediction models today.
Simple linear regression finds the single straight line that best predicts a response variable's mean value from a predictor, by minimizing the total squared vertical distance between the data and the line.
The core idea
Simple linear regression models a response variable as a linear function of one explanatory (predictor) variable , plus random scatter:
Here is the true (population) intercept, is the true slope, and is the deviation of the th individual's actual -value from the line — the part of not explained by . The Greek letters denote unknown population parameters; biologists estimate them from sample data as and , giving the fitted line:
The hat over signals a predicted value, not an observed one. For any bird with a given femur length , is the regression model's best guess at mean body mass — not a guarantee for that individual bird, but the expected value averaged over many birds with that femur length. Three ideas separate regression from correlation. First, asymmetry: swapping which variable is and which is changes the regression line (the line predicting from is generally not the same line as the one predicting from ), whereas the correlation coefficient is unchanged by the swap. Second, units and interpretation: is a unitless index from to , while the slope carries units (mass per mm, for instance) and has direct biological meaning — a rate of change. Third, purpose: correlation answers "how strongly are these associated?"; regression answers "what value of do we predict for a given , and by how much does change per unit of ?" Both techniques assume the same underlying bivariate structure, and in fact and are mathematically linked: , where and are the sample standard deviations of and . Regression is correlation's more committed, directional cousin.
Mechanism
Step 1 — Specify the model. The biologist chooses which variable is the predictor based on the scientific question, not the data. If the question is "does femur length predict mass," = femur length and = mass. In a controlled experiment (e.g., enzyme velocity at set substrate concentrations), the manipulated variable is always .
Step 2 — Assumptions the model requires. For the fitted line to be meaningful and (later) for inference to be valid, several conditions should approximately hold:
- Linearity — the true relationship between the mean of and is a straight line.
- Independence — errors () for different observations are independent of one another.
- Homoscedasticity — the scatter of around the line has constant variance across all values of (no "fanning out").
- Normality of residuals — for a given , the values of are normally distributed around the line (most critical for inference, less so for merely fitting the line).
- measured with little error — classical regression assumes the predictor is fixed or measured precisely; heavy measurement error in biases the slope toward zero.
Step 3 — Fit the line by least squares. Among all possible straight lines, regression picks the one minimizing the sum of squared residuals:
A residual is the vertical distance between an observed point and the line — the part of that individual's -value the model fails to explain. Squaring penalizes large deviations disproportionately and makes the minimization solvable in closed form (calculus shows the minimizing line has a unique slope and intercept, derived by setting partial derivatives of with respect to and to zero). This yields:
The slope is the ratio of how and co-vary to how much alone varies — essentially, covariance divided by variance of the predictor. The line necessarily passes through the point , the centroid of the data — a useful mental anchor.
Step 4 — Partition variance. Total variability in () splits into variability explained by the line () and variability left over ():
The proportion explained is the coefficient of determination, — identical numerically to the square of the correlation coefficient in simple linear regression. An of 0.81 means 81% of the variance in body mass is statistically accounted for by femur length; the remaining 19% reflects individual variation, measurement error, and other unmeasured biological factors.
Step 5 — Interpret slope and intercept biologically. The slope is the predicted change in mean per one-unit increase in . The intercept is the predicted when — biologically meaningful only if falls within (or near) the observed range of data; extrapolating the intercept far outside the data (e.g., predicting mass at femur length = 0) is usually nonsensical and a common misuse.
The evidence
Simple linear regression's method — least squares — was developed independently by Adrien-Marie Legendre (1805) and Carl Friedrich Gauss (who claimed prior use, published 1809), originally to fit orbits of comets and asteroids from astronomical observations. But the biological birth of regression, and its name, comes from Francis Galton. In the 1880s Galton was obsessed with quantifying heredity. Using records from his "anthropometric laboratory," he measured the heights of 205 pairs of parents (averaging mother's and father's height, the latter scaled by a factor of 1.08 to make sexes comparable — Galton's "mid-parent height") and the adult heights of 928 of their offspring. He plotted offspring height against mid-parent height and fitted a line through the data. The result, published in "Regression Towards Mediocrity in Hereditary Stature" (1886), was striking: tall parents tended to have tall children, but on average, less tall than the parents themselves. Children of parents who stood far above the mean tended to be closer to the mean than their parents were. Symmetrically, children of unusually short parents tended to be taller than their parents. Galton calculated that offspring height moved back toward the population mean by a consistent fraction each generation — he called this "regression toward mediocrity" (now known as regression toward the mean).
What this proved: The slope of the offspring-on-midparent line was reliably less than 1 (Galton found approximately 2/3), meaning extreme parental heights predicted less extreme, but still directionally correct, offspring heights. This was not evidence against heredity — tall parents still had taller-than-average children — but it demonstrated that any trait influenced by both heritable and non-heritable (environmental, developmental, chance) components will show this compression toward the mean across generations, a purely statistical consequence of imperfect correlation rather than a biological "regression" of the species. Galton's numerical method for drawing that best-fit line, and his coining of the term "regression" for the fitted slope, became the foundation of the whole technique — and the reason a modeling tool used across all of science is named after a 19th-century height study, not after the mathematics of least squares itself.
A modern echo of Galton's discovery is the "sophomore slump" or regression-to-the-mean artifact seen throughout biology and medicine: patients selected for extremely high blood pressure on one visit tend to show lower readings on a second visit even with no treatment, simply because extreme measurements partly reflect transient noise. Recognizing this is essential to correctly designing and interpreting biological experiments — a direct descendant of what Galton's regression line first revealed. A second classic strand of evidence for the predictive power of regression is Julian Huxley's allometric scaling studies (1932), where he showed that log(organ size) regressed linearly on log(body size) across species and within growth series — for example fiddler crab claw mass against body mass — establishing that simple linear regression on log-transformed variables (allometry) accurately captures growth-scaling laws across biology, from crab claws to mammalian brain size.
Worked examples
Example 1 — Predicting metabolic rate from body mass (allometric regression). A physiologist measures resting metabolic rate (, in mL O₂/hr) and body mass (, in kg) in 8 mammal species spanning three orders of magnitude in size. After log₁₀-transforming both variables (standard practice for allometric data because the relationship is multiplicative, not additive), she obtains:
| Quantity | Value |
|---|---|
| 8 | |
| (log mass) | 1.20 |
| (log metabolic rate) | 2.35 |
| 0.85 | |
| 0.65 | |
| 0.93 |
Slope:
Intercept:
Fitted line: . The slope of 0.711 is close to the classic ¾-power (Kleiber's) scaling law for metabolic rate against mass, an empirical regularity across mammals from mice to elephants. To predict metabolic rate for a new species weighing 25 kg:
: about 86.5% of the variance in log metabolic rate across these species is explained by log body mass, leaving 13.5% attributable to metabolic differences between taxa (e.g., basal metabolic differences between marsupials and placental mammals) not captured by mass alone.
Example 2 — Dose–response calibration curve in a toxicology assay. A toxicologist exposes fish larvae to five concentrations of a pesticide (, µg/L) and records percentage mortality after 96 hours (, %), replicated with asymmetric spacing typical of real dose-ranging studies:
| Dose (µg/L) | Mortality (%) |
|---|---|
| 0.5 | 4 |
| 1.5 | 12 |
| 3.0 | 22 |
| 6.0 | 41 |
| 10.0 | 68 |
(For teaching purposes we treat the mid-range of this dose–response relationship as approximately linear; true dose–response curves are sigmoidal and normally require probit or logistic regression — a simplification flagged deliberately here.) Computing the sums:
Fitted line: .
Biological interpretation: each additional 1 µg/L of pesticide is associated with an estimated 2.83-percentage-point increase in larval mortality across this dose range. The intercept, 17.5%, would represent predicted mortality at zero dose — clearly higher than the observed near-zero mortality at the lowest tested dose, a signal that the true relationship curves rather than continuing linearly down to , and a caution against extrapolating below the tested range. Using the line to interpolate the dose producing 50% mortality (an approximate LD50):
This falls just outside the tested range (max tested = 10 µg/L), illustrating both the predictive utility of regression and the risk of extrapolation beyond observed data — the LD50 estimate should be treated cautiously and ideally confirmed with an additional trial closer to that dose.
Common misconceptions & traps
| Misconception | Why it's wrong |
|---|---|
| "A high proves causes " | Regression describes association and prediction, not causation; confounding variables can produce strong linear fits between unrelated variables. |
| "The regression line for predicting from is the same as for predicting from " | Regression is asymmetric; minimizing vertical distances (for -on-) gives a different line than minimizing horizontal distances (for -on-), except in the trivial case . |
| "You can always extrapolate the line beyond the data" | The linear model is only justified within the range of observed ; behavior outside that range is unknown and often nonlinear (as in the LD50 example above). |
| "The intercept always has biological meaning" | If is far outside the data range (e.g., body mass = 0), the intercept is a pure mathematical artifact, not a biological prediction. |
| "Regression toward the mean means a trait is 'weakening' over generations" | It is a statistical consequence of imperfect correlation between generations, not a biological force eroding extreme traits — a misreading of Galton's own results. |
| "A significant slope means the effect is large" | Statistical detectability (addressed at the inference stage) is separate from the size of the slope; a tiny, biologically trivial slope can still be statistically distinguishable from zero with a large sample. |
The scientist behind it
Origins · 1 minSir Francis Galton and how this was discovered
Galton was a half-cousin of Charles Darwin and one of the most prolific quantifiers of the Victorian age, applying measurement to fingerprints, weather, psychology, and heredity alike. Trained initially in medicine and mathematics at Cambridge, he abandoned clinical practice for exploration and, later, for statistics. Obsessed with quantifying human variation, he established an "Anthropometric Laboratory" at the 1884 International Health Exhibition in London, where visitors paid threepence to have their height, weight, grip strength, and reaction time measured — generating the vast datasets from which he derived correlation and regression. His scientific legacy is inseparably entangled with his advocacy of eugenics, a program he founded and named, which used statistical arguments about heredity to justify deeply unethical social policies; this history is a permanent and necessary caveat whenever his statistical contributions are discussed.
Where this matters today
Clinical medicine: regression models predict drug dosage from body weight or renal function (creatinine clearance), estimate cardiovascular risk from cholesterol and blood pressure, and calibrate assay readings (e.g., converting spectrophotometer absorbance to hormone concentration) via standard curves fit by least squares.
Growth and development: pediatric growth charts and animal husbandry weight-gain curves use regression of mass or height against age to flag individuals deviating from expected trajectories.
Ecology and conservation: regression of species richness against habitat area (species–area curves), population growth rate against resource availability, or contaminant concentration against distance from a pollution source, all use the same least-squares logic to make quantitative field predictions.
Agriculture: yield response to fertilizer dose, feed conversion ratio against animal weight, and calibration of remote-sensing vegetation indices against actual crop biomass all rely on fitted regression lines (or their generalizations) to guide practical decisions.
Genomics and biotechnology: standard curves in qPCR (cycle threshold against known template concentration) and ELISA assays are simple linear regressions (often on log-transformed concentration) used daily in molecular biology labs to quantify unknown samples.
Evolutionary biology: regression remains central to quantitative genetics — the modern descendant of Galton's own parent–offspring height study, where the regression slope of offspring trait value on mid-parent value estimates the heritability () of a trait, connecting this 19th-century method directly to present-day breeding programs and evolutionary predictions.
Ask the tutor: How does adding a second predictor variable turn simple linear regression into multiple regression, and what new problems (like collinearity) does that introduce?
How is simple linear regression different from correlation, in practice?
Correlation () measures the strength and direction of a linear association symmetrically — it doesn't matter which variable is called or . Regression fits an actual equation, , designating one variable as predictor and one as response; swapping them generally changes the fitted line. Use correlation when you simply want to know how tightly two variables track each other (e.g., are leg length and wing length correlated in this bird species?). Use regression when you want to predict one variable's value from the other, quantify a rate of change (a slope with real units), or build a calibration curve. In practice, biologists often report both: or to describe fit quality, and the regression equation to enable prediction.
Does a statistically significant slope mean the relationship is biologically important?
Not necessarily. Statistical significance (covered under regression inference) tells you whether the slope is reliably different from zero, given the sample size and scatter — but with a large enough sample, even a tiny, biologically trivial slope can be statistically detectable. Conversely, a biologically meaningful slope in a small or noisy dataset might not reach statistical significance. Always examine the actual magnitude of in its real units (e.g., "0.02 g per day of age" versus "5 g per day of age") alongside any p-value, and consider the effect size and together with significance.
Can I use regression if my predictor variable was measured with substantial error?
Classical least-squares regression assumes the predictor is measured precisely (or fixed by the experimenter), with all the random error residing in . When itself has substantial measurement error, ordinary least squares tends to underestimate the true slope (attenuation bias), because scatter in gets misattributed as scatter around the line rather than uncertainty in the predictor's true value. Specialized methods — such as reduced major axis (RMA) or Deming regression — are used when both variables carry meaningful measurement error, a common situation in morphometrics comparing two measured traits rather than a manipulated variable and a response.
Why do biologists often log-transform variables before running a linear regression, as in the metabolic rate example?
Many biological relationships are inherently multiplicative rather than additive — organ size scaling with body size, population growth over time, or dose–response curves — and appear curved, not straight, on raw axes. Taking logarithms of both variables often converts a power-law relationship () into a straight line (), because logarithms turn multiplication into addition. This lets ordinary linear regression estimate the scaling exponent directly as the slope, which is exactly how allometric relationships like Kleiber's ¾-power law for metabolic rate are estimated in practice.
What is regression toward the mean, and why does it cause problems in biological and clinical studies?
Regression toward the mean is the tendency for an extreme measurement (a very high or very low value on one occasion) to be followed by a value closer to the average on a second, independent measurement — a purely statistical consequence of imperfect correlation between the two measurements, not a real biological change. It causes serious interpretive problems when researchers select subjects specifically because they showed an extreme value (e.g., very high blood pressure or very low a test score) and then remeasure them: the group will appear to "improve" on average even with no real treatment effect, purely from statistical regression. Proper experimental design uses control groups and randomization specifically to distinguish this artifact from a genuine treatment effect.
Is it valid to swap x and y and use the same regression line "backwards" to predict x from y?
No. The least-squares line for predicting from minimizes vertical distances (in the -direction), while the line for predicting from minimizes horizontal distances (in the -direction) — these are mathematically different lines unless the correlation is perfect (). If your scientific goal is to predict from a known , you must fit a separate regression with as the response variable, not simply algebraically invert the original equation. This asymmetry is one of the most common technical errors when regression is used for calibration purposes.
What role does the coefficient of determination, r², play that r alone does not?
The correlation coefficient describes the direction and strength of linear association, but has a more direct and quantitative interpretation: the proportion of variance in the response variable statistically accounted for by the predictor. An of 0.7 might sound reasonably strong, but reveals that fewer than half of the observed differences in among individuals are explained by differences in — the rest reflects unmeasured biological variation, measurement error, or other factors. Reporting alongside the regression equation gives a much more honest sense of the model's real predictive power than alone.