01 / 21

Prediction &
Extrapolation

Learn how regression models make predictions using \(\hat{y} = a + bx\), and why extrapolating beyond your data can lead to dangerous conclusions.

College Statistics

What Is Prediction?

In statistics, prediction means using a regression equation to estimate the value of \(\hat{y}\) for a given value of \(x\). If we have a least-squares regression line \(\hat{y} = a + bx\), we can plug in any \(x\)-value and compute a predicted response.

Interpolation vs Extrapolation

Interpolation
Predicting \(\hat{y}\) for an \(x\)-value within the range of observed data. Generally reliable if the model fits well.
Extrapolation
Predicting \(\hat{y}\) for an \(x\)-value outside the range of observed data. Risky because the pattern may not continue.

Seeing the Danger Zone

\(x\)
\(y\)
Observed Data Range Interpolation (safe) Extrapolation (risky!) Extrapolation

The Regression Equation

The least-squares regression line takes the form:

\(\hat{y}\)
The predicted value of the response variable
\(a\)
The y-intercept: predicted \(y\) when \(x = 0\)
\(b\)
The slope: change in \(\hat{y}\) per unit change in \(x\)

Residuals and Prediction Error

Every prediction carries error. The residual measures the difference between what we observe and what we predict:

Positive Residual
Model underestimated: actual \(y\) is above the line
Negative Residual
Model overestimated: actual \(y\) is below the line

Correlation vs Prediction

Correlation \(r\) Regression Prediction
Purpose Measures strength & direction Estimates a specific value of \(\hat{y}\)
Output Single number: \(-1 \leq r \leq 1\) A predicted value: \(\hat{y}\)
Causation? No No (still just association)
Extrapolation risk? Not applicable High outside data range

Why Extrapolation Fails

Age (years)
Height (cm)
True growth pattern Linear extrapolation Observed (ages 2-10)
?

Step-by-Step Prediction

1
Identify the regression equation. Write it in the form \(\hat{y} = a + bx\).
2
Check the \(x\)-range. Determine the minimum and maximum \(x\)-values in the original dataset.
3
Classify the prediction. Is your \(x\) inside the range (interpolation) or outside (extrapolation)?
4
Substitute and compute. Plug \(x\) into the equation to get \(\hat{y}\).
5
State your confidence. If extrapolating, add a warning that the prediction may be unreliable.

Example 1: Study Hours

A professor collects data on hours studied (\(x\)) and exam scores (\(y\)) for 30 students. Hours ranged from 1 to 8. The regression equation is:

Predict for \(x = 5\)
\(\hat{y} = 52.3 + 5.1(5) = \) 77.8
This is interpolation (5 is within 1 to 8). ✓ Reliable
Predict for \(x = 15\)
\(\hat{y} = 52.3 + 5.1(15) = \) 128.8
This is extrapolation (15 > 8). A score of 128.8 is impossible! ✕ Unreliable

Example 2: Temperature & Ice Cream

An ice cream shop records daily high temperature (\(x\), in °F) and sales (\(y\), in dollars). Data covers temperatures from 60°F to 95°F. The regression line is:

Predict sales when \(x = 80\)°F:

Predict sales when \(x = 30\)°F:

Example 3: Residual Interpretation

Using the study-hours model \(\hat{y} = 52.3 + 5.1x\): a student who studied 6 hours scored 85 on the exam.

1
Predicted score: \(\hat{y} = 52.3 + 5.1(6) = 52.3 + 30.6 = \) 82.9
2
Residual: \(y - \hat{y} = 85 - 82.9 = \) +2.1
3
Interpretation: The student scored 2.1 points higher than the model predicted. The model underestimated this student's performance.

\(r^2\) and Prediction Quality

The coefficient of determination \(r^2\) tells us what fraction of the variation in \(y\) is explained by the linear model. It directly affects how much we should trust our predictions.

\(r^2 = 0.92\)
92% of variation in \(y\) is explained. Predictions within the data range are quite reliable.
\(r^2 = 0.55\)
Only 55% explained. Predictions carry substantial uncertainty even for interpolation.
\(r^2 = 0.15\)
Just 15% explained. The model is a poor predictor: other factors dominate.

Influential Points and Leverage

Points at the extremes of the \(x\)-range have high leverage: they strongly influence the slope and intercept. This matters because:

1
A single outlier at a high \(x\)-value can tilt the regression line, changing predictions for all \(x\)-values.
2
Extrapolation amplifies this: the further past the data you go, the more any leverage-driven tilt compounds.
3
Always check for influential points before trusting any prediction, especially near the edges of your data.

Common Mistakes

✕ Blind Extrapolation
Plugging in an \(x\)-value far outside the data range and trusting the result without stating a warning.
✕ Confusing \(y\) and \(\hat{y}\)
Writing \(y = a + bx\) instead of \(\hat{y} = a + bx\). The hat notation means predicted, not observed.
✕ Claiming Causation
Saying "\(x\) causes \(y\)" when the regression only shows association. Regression does not prove causation.

Summary Table

Interpolation Extrapolation
\(x\) location Within observed range Outside observed range
Reliability Generally trustworthy Risky and unreliable
Residuals Expected to be small Could be very large
Example Predicting score for 5 hrs studied (range: 1-8) Predicting score for 20 hrs studied
Best practice Report \(\hat{y}\) with context State that prediction is an extrapolation

Question 1 of 5

A regression model is based on data where \(x\) ranges from 10 to 50. A researcher uses the model to predict \(\hat{y}\) when \(x = 75\). This is an example of:

Question 2 of 5

The regression equation is \(\hat{y} = 14.2 + 3.8x\). If a student observes \(y = 30\) when \(x = 4\), what is the residual?

Question 3 of 5

Why is extrapolation considered risky even when \(r^2\) is very high?

Question 4 of 5

A model predicts that a car with \(x = 0\) years of age has a value of \(\hat{y} = $35{,}000\). What does this value represent?

Question 5 of 5

Data on tree age (\(x\), in years, ranging from 5 to 40) and trunk diameter (\(y\), in cm) gives \(\hat{y} = 2.1 + 0.9x\). Which prediction is most trustworthy?