Prediction &
Extrapolation
Learn how regression models make predictions using \(\hat{y} = a + bx\), and why extrapolating beyond your data can lead to dangerous conclusions.
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
Seeing the Danger Zone
The Regression Equation
The least-squares regression line takes the form:
Residuals and Prediction Error
Every prediction carries error. The residual measures the difference between what we observe and what we predict:
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
Step-by-Step Prediction
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:
This is interpolation (5 is within 1 to 8). ✓ Reliable
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.
\(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.
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:
Common Mistakes
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?