Prediction &
Forecasting
Learn how regression models make predictions, why extrapolation is risky, and how to interpret forecasts with confidence intervals.
What Is Prediction?
In statistics, prediction means using a mathematical model to estimate the value of a response variable \( \hat{y} \) for a given value of the explanatory variable \( x \). If we have a regression line \( \hat{y} = b_0 + b_1 x \), we simply plug in our chosen \( x \) to get the predicted value.
The Regression Line as a Tool
Interpolation vs Extrapolation
The critical distinction in forecasting is where your \( x \)-value falls relative to the data you used to build the model.
The Danger Zone of Extrapolation
The Prediction Equation
For simple linear regression, the predicted value at a given \( x^* \) is:
Confidence vs Prediction Intervals
Two types of intervals quantify uncertainty when we forecast. They look similar but answer different questions.
Intervals Widen Away from \( \bar{x} \)
Forecasting vs Prediction
| Prediction | Forecasting | |
|---|---|---|
| Goal | Estimate \( y \) for a known \( x^* \) | Estimate future values over time |
| Data axis | Any explanatory variable | Time is the explanatory variable |
| Context | Cross-sectional or experimental | Time series data |
| Key risk | Extrapolation beyond \( x \)-range | Structural changes over time |
| Example | Predict sales from ad spend | Forecast next quarter's sales |
Why Extrapolation Fails
How to Make a Responsible Prediction
Example 1: Basic Prediction
A café finds that daily iced coffee sales (\( y \)) relate to temperature (\( x \), in °F) by the regression equation:
Question: Predict iced coffee sales when the temperature is \( 80°F \).
Example 2: Extrapolation Warning
Using the same model: \( \hat{y} = -50 + 3.2x \), data range [55, 95].
Question: Predict sales when temperature is \( 110°F \).
Example 3: Prediction Interval
A retailer models weekly online orders (\( y \)) from website visits (\( x \), in thousands). At \( x^* = 12 \), software reports:
Common Mistakes
Summary of Key Concepts
| Concept | Definition | Reliability |
|---|---|---|
| Interpolation | Predicting within the data range | High |
| Extrapolation | Predicting beyond the data range | Low / Risky |
| Confidence Interval | Interval for the mean at \( x^* \) | Narrower |
| Prediction Interval | Interval for a single observation | Wider |
| Forecasting | Predicting future values over time | Depends on horizon |
Question 1 of 5
A regression model is built using data where \( x \) ranges from 10 to 50. A manager uses the model to predict \( y \) when \( x = 75 \). This is an example of:
Question 2 of 5
Which interval is always wider: the 95% confidence interval for the mean response, or the 95% prediction interval for an individual observation?
Question 3 of 5
Given \( \hat{y} = 200 + 15x \), what is \( \hat{y} \) when \( x = 8 \)?
Question 4 of 5
Both the confidence interval and prediction interval are narrowest at which point?
Question 5 of 5
A company's regression model predicts revenue from employee count. The data includes companies with 50 to 500 employees. The CEO of a 10-person startup asks for a revenue prediction. What should the analyst say?