01 / 21

Evaluating
Linear Model Fit

Learn to use scatterplots and residual reasoning to determine whether a linear model is the right choice for your data.

Math 2

What Is a Linear Model?

A linear model uses a straight line to describe the relationship between two variables. We write it as \( \hat{y} = a + bx \), where \( b \) is the slope and \( a \) is the \( y \)-intercept.

x y \(\hat{y} = a + bx\)

What Is a Residual?

A residual measures how far an actual data point is from the predicted value on the line. It is the vertical distance between the observed \( y \) and the predicted \( \hat{y} \).

+50 Actual (Above) -32 Actual (Below) Predicted line

Why Do Residuals Matter?

Looking at the scatterplot alone can be misleading. Residuals reveal hidden patterns that tell you whether a linear model is truly appropriate.

✓ Good Linear Fit
Residuals scatter randomly above and below zero with no visible pattern.
✕ Poor Linear Fit
Residuals show a curved pattern, suggesting the true relationship is nonlinear.

The Residual Plot

A residual plot graphs each residual \( (y - \hat{y}) \) against the corresponding \( x \)-value. The horizontal line at \( y = 0 \) represents perfect prediction.

x 0 + − Random Scatter = Good Linear Fit

Patterned Residuals: Bad Fit

If the residual plot shows a curved (U-shaped or arch) pattern, the linear model is missing a nonlinear relationship in the data.

x 0 Arch-Shaped Pattern = Nonlinear Relationship

\( r^2 \) vs. Residual Plot

Both tools help evaluate fit, but they answer different questions.

\( r^2 \) (Coefficient of Determination) Residual Plot
Tells you How much variability is explained Whether the model form is correct
A high value means Strong association N/A: look for pattern, not a number
Can be misleading? Yes: high \( r^2 \) doesn't prove linearity Rarely: patterns are visually clear
Use together? Always. Report \( r^2 \) and check residuals.

Other Red Flags in Residuals

Fan Shape
Residuals spread out (or narrow) as \( x \) increases. This signals non-constant variance (heteroscedasticity).
Clusters
Groups of residuals in distinct regions suggest subgroups in the data that a single line cannot capture.
Outliers
One or two points with extremely large residuals can distort the slope and intercept of the line.

How to Evaluate Linear Fit

1
Plot the scatterplot. Does the overall shape look roughly linear?
2
Fit the line and compute \( r \) and \( r^2 \). A higher \( r^2 \) means more variation explained.
3
Create the residual plot. Graph \( (x,\; y - \hat{y}) \) for every data point.
4
Inspect for patterns. Random scatter = good. Curve, fan, or clusters = bad.
5
Decide. If residuals are patterned, a linear model is not appropriate: consider a quadratic or exponential model.

Example 1: Good Linear Fit

A student measures hours studied vs. test score for 10 classmates. The scatterplot shows a clear upward trend. The regression gives \( \hat{y} = 52 + 4.3x \) with \( r^2 = 0.91 \).

Hours Studied Score \(\hat{y} = 52 + 4.3x\)

Example 1: Residual Plot

Hours Studied 0 Random scatter: linear model is appropriate

Example 2: Deceptive Scatterplot

A researcher tracks bacterial growth over 12 hours. The scatterplot seems to follow a line. The regression gives \( \hat{y} = 10 + 8x \) with \( r^2 = 0.94 \).

Hours Count Linear fit

Example 2: Residual Plot

Hours 0 Clear U-shape: linear model is NOT appropriate

Example 3: Fan-Shaped Residuals

An economist models income vs. spending. The residual plot below shows increasing spread as \( x \) increases.

Income 0 Fan Shape: Non-Constant Variance

Common Mistakes

✕ Trusting \( r^2 \) Alone
A high \( r^2 \) does not confirm linearity. Always pair it with the residual plot.
✕ Ignoring Residual Patterns
Saying "residuals are small" is not enough. Look for curves, fans, or clusters.
✕ Confusing Correlation with Causation
A good linear fit shows association, not that \( x \) causes changes in \( y \).

Summary: Evaluating Linear Fit

Indicator Good Linear Fit Poor Linear Fit
Scatterplot shape Roughly linear Curved or clustered
\( r^2 \) value High (close to 1) Low, or high but misleading
Residual plot Random scatter U-shape, fan, or clusters
Residual size Consistently small Large or growing
Conclusion Linear model works Try nonlinear model

Question 1 of 5

A residual plot shows points scattered randomly above and below zero with no visible pattern. What does this indicate?

Question 2 of 5

A student fits a linear model and gets \( r^2 = 0.96 \), but the residual plot shows a clear U-shaped curve. What should the student conclude?

Question 3 of 5

Which formula correctly defines a residual?

Question 4 of 5

A residual plot shows residuals that fan out (get wider) as \( x \) increases. What does this pattern suggest?

Question 5 of 5

For the regression \( \hat{y} = 20 + 3x \), a data point has \( x = 5 \) and \( y = 38 \). What is the residual?