01 / 21

Slope, Intercept,
\( R^2 \) & Residuals

Master the four pillars of linear regression: interpret what the slope and intercept mean, gauge model fit with \( R^2 \), and diagnose problems using residuals.

Biostatistics

What Is Linear Regression?

Linear regression fits a straight line to data so we can predict one variable from another. The equation of the best-fit line is:

\( b_1 \) : Slope
How much \( \hat{y} \) changes for each one-unit increase in \( x \).
\( b_0 \) : Intercept
The predicted value of \( \hat{y} \) when \( x = 0 \).

Why It Matters in Biology

Biologists use regression every day: predicting drug dosage effects, relating body mass to metabolic rate, or testing whether a toxin concentration predicts cell death. Understanding these four quantities lets you read and critique published research.

Visualising the Best-Fit Line

Dose (mg) Response Best-fit line Data points Residuals

Interpreting the Slope \( b_1 \)

The slope tells you the direction and rate of change. A slope of \( b_1 = 4.5 \) means: for every one-unit increase in \( x \), the predicted \( \hat{y} \) increases by 4.5 units.

\( b_1 > 0 \)
Positive association: as \( x \) rises, \( \hat{y} \) rises.
\( b_1 < 0 \)
Negative association: as \( x \) rises, \( \hat{y} \) falls.
\( b_1 = 0 \)
No linear trend: \( x \) does not predict \( \hat{y} \).

Interpreting the Intercept \( b_0 \)

The intercept \( b_0 \) is the predicted value of \( y \) when \( x = 0 \). Whether it is meaningful depends on context:

Meaningful
If \( x = 0 \) is possible: "Baseline blood pressure with zero caffeine intake."
Not Meaningful
If \( x = 0 \) is impossible: "Metabolic rate at 0 kg body mass" is biologically nonsensical.

What Is \( R^2 \)?

\( R^2 \) (the coefficient of determination) tells you the proportion of variance in \( y \) explained by the model. It ranges from 0 to 1.

\( R^2 = 0.92 \)
92% of variability explained. Strong fit.
\( R^2 = 0.45 \)
45% explained. Moderate: other factors matter.
\( R^2 = 0.08 \)
8% explained. Weak linear predictor.

Understanding Residuals

A residual is the vertical distance between an observed point \( y_i \) and the predicted value \( \hat{y}_i \). It tells you how far the model missed for that observation.

\( e_i > 0 \)
Model under-predicted: actual was higher than the line.
\( e_i < 0 \)
Model over-predicted: actual was below the line.

Reading a Residual Plot

Good: Random Scatter Predicted Residual Bad: Curved Pattern Predicted

\( R^2 \) vs Slope: Not the Same

Slope \( b_1 \) \( R^2 \)
Measures Rate of change per unit \( x \) Proportion of variance explained
Range \( -\infty \) to \( +\infty \) 0 to 1
Units Units of \( y \) per unit of \( x \) Unitless (proportion)
Steep slope means... Large effect per unit Not necessarily high \( R^2 \)

How to Interpret a Regression Output

1
State the equation. Write \( \hat{y} = b_0 + b_1 x \) with actual values.
2
Interpret the slope in context. "For each 1 [unit of x], predicted [y] changes by \( b_1 \) [units of y]."
3
Interpret the intercept. State whether \( x = 0 \) makes sense biologically.
4
Report \( R^2 \). "[value]% of the variation in [y] is explained by [x]."
5
Check the residual plot. Look for random scatter: no curves, no fans, no patterns.

Example 1: Fertiliser & Plant Height

1
Slope: For each additional 1 g of fertiliser, predicted height increases by 1.8 cm.
2
Intercept: With 0 g fertiliser, predicted height is 5.2 cm. Meaningful: seedlings have some height without fertiliser.
3
\( R^2 \): 74% of the variation in plant height is explained by the amount of fertiliser.

Example 2: Drug Dose & Heart Rate

1
Slope: For each additional 1 mg, heart rate is predicted to decrease by 0.6 bpm. Negative slope: the drug lowers heart rate.
2
Intercept: At 0 mg, predicted heart rate is 72 bpm: a plausible resting rate.
3
\( R^2 \): 58% explained. Moderate: other factors (age, weight) also matter.

Example 3: Computing a Residual

1
Predicted value: \( \hat{y} = 5.2 + 1.8(4) = 5.2 + 7.2 = \) 12.4 cm
2
Residual: \( e = y - \hat{y} = 14 - 12.4 = \) +1.6 cm
3
Interpretation: The actual height was 1.6 cm above the prediction: the model under-predicted for this plant.

Common Mistakes

✕ Confusing \( R^2 \) with slope
\( R^2 \) measures fit quality, not direction or rate. A high \( R^2 \) does not mean a steep slope.
✕ Over-interpreting the intercept
If \( x = 0 \) is outside your data range, the intercept has no real-world meaning.
✕ Ignoring residual patterns
A high \( R^2 \) does not guarantee a good model. A curved residual plot means the model is wrong.
✕ Reversing the residual formula
Residuals are \( y_i - \hat{y}_i \), not \( \hat{y}_i - y_i \). Mixing up the order flips the sign.

Summary of Key Concepts

Concept Symbol What It Tells You
Slope \( b_1 \) Rate of change per unit \( x \)
Intercept \( b_0 \) Predicted \( \hat{y} \) when \( x = 0 \)
Coefficient of Determination \( R^2 \) Proportion of variance explained
Residual \( e_i \) Difference between observed and predicted

Question 1 of 5

A study finds \( \hat{y} = 20 + 3.4x \), where \( x \) is hours of sunlight and \( y \) is crop yield (kg). What does the slope mean?

Question 2 of 5

If \( R^2 = 0.81 \) for a model predicting blood pressure from age, which statement is correct?

Question 3 of 5

For the model \( \hat{y} = 10 + 2x \), one observation has \( x = 5 \) and \( y = 18 \). What is the residual?

Question 4 of 5

A residual plot shows a clear U-shaped curve. What does this indicate?

Question 5 of 5

A model predicting tree height (m) from trunk diameter (cm) gives \( \hat{y} = -1.5 + 0.8x \). What does the intercept \( b_0 = -1.5 \) mean?