AP Statistics / Unit 5: Regression Analysis / Topic 5.3
NUM8ERS study notes · Topic 5.3

Linear Regression Models

Use a straight-line model to turn an explanatory value into a predicted response. Learn to substitute correctly, explain the answer in context, and spot when a prediction reaches beyond the data.

2026–27 curriculum4 worked examples8 practice questionsPrediction + visual explanations

By the end of this lesson, you should be able to:

  • Identify the explanatory variable, response variable and predicted response in a model.
  • Calculate a prediction from a given linear regression equation, with the correct units.
  • Distinguish interpolation from extrapolation and explain the limits of a prediction.

Before you start: Review scatterplots and correlation. You should be comfortable substituting a number into a linear equation.

First time learning this? Follow the delivery-time example and the prediction graph. Then work through the four examples.

Here to revise? Review the prediction checklist, then attempt the practice questions before opening the solutions.

The concept in 60 seconds

A linear regression model uses an explanatory variable to predict a response with a straight-line equation. The general form is:

y^=a+bx.\hat{y}=a+bx.

xx is the explanatory value you supply. y^\hat{y}, read “y-hat,” is the response the model predicts. The coefficient aa is the intercept and bb is the slope.

Prediction is a model estimate. It is not a guaranteed result for an individual. An observed response is written yy; the predicted response is written y^\hat{y}.

For example, suppose delivery time in minutes is predicted from distance in kilometres by y^=12+1.8x\hat{y}=12+1.8x. A distance of 10 km10\,\mathrm{km} gives y^=12+1.8(10)=30 min\hat{y}=12+1.8(10)=30\,\mathrm{min}. The model predicts a delivery time of 3030 minutes.

Quick check: what goes into the equation?

The explanatory value goes in for xx. You calculate y^\hat{y}, the predicted response. You do not substitute an already observed response for xx.

A real situation: predict delivery time

A local delivery company records distance and total delivery time for 99 deliveries on similar routes. Distance is measured in kilometres and time in minutes. These are invented teaching data.

Distance and time belong to the same delivery in each row.
Delivery IDDistance xx (km)Observed time yy (min)
A552222
B7.57.524.524.5
C10102929
D12.512.535.535.5
E15153939
F17.517.544.544.5
G20204747
H22.522.551.551.5
I25255858

Software supplies the fitted model below. For now, use the given equation; how least squares determines the coefficients is developed in Topic 5.5.

y^=12+1.8x.\hat{y}=12+1.8x.
Follow an input up to the prediction line
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 5 10 15 16 20 25 Distance (km) 15.0 25.0 35.0 40.8 50.0 60.0 Delivery time (min) Predicted response $\hat{y}=40.8$ $\hat{y}=12+1.8x$ An input becomes a prediction image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 5 10 16 20 25 Distance (km) 15.0 25.0 35.0 40.8 50.0 60.0 Delivery time (min) Predicted response $\hat{y}=40.8$ $\hat{y}=12+1.8x$ An input becomes a prediction

Dots are observed deliveries. The square marks a model prediction at a new distance; dashed guides connect the input to its predicted response. All data are invented.

Question: What time does the model predict for a delivery travelling 16 km16\,\mathrm{km}?

y^=12+1.8(16)=40.8.\hat{y}=12+1.8(16)=40.8.

Answer in context: For a delivery travelling 1616 kilometres on a comparable route, the model predicts a total time of about 40.840.8 minutes. It does not promise that the delivery will take exactly that long.

The recorded distances span 5≤x≤255\le x\le25. Since 1616 lies inside that interval, this prediction is interpolation—even though there is no recorded delivery at exactly 1616 kilometres.

Why are the dots not all on the fitted line?

The dots show actual observations; the line shows model predictions. Traffic, loading and other factors create variability. For delivery C, the observed time is 2929 minutes at 1010 kilometres, while the model predicts 3030 minutes. Measuring the difference between observation and prediction is the focus of Topic 5.4.

Key ideas and notation

Explanatory value: xx

The input used to make the prediction. In the delivery model, it is distance in kilometres.

Observed response: yy

The response actually recorded for an individual. A dot on the scatterplot represents an observed pair.

Predicted response: y^\hat{y}

The output from the fitted equation at a specified xx. A point on the regression line represents a model prediction.

Intercept: aa

The predicted response when x=0x=0. Its units are the response units. Whether it has a useful real-world meaning depends on the context.

Slope: bb

The change in the predicted response for a one-unit increase in the explanatory value. Its units are response units per explanatory unit.

Observed range

The interval from the smallest to the largest explanatory value used to fit the model. Check it before trusting a prediction.

Watch the hat: yy is measured; y^\hat{y} is calculated from the model. Writing the hat helps keep evidence and prediction separate.

Make a prediction in four steps

  1. Identify the variables and units. Confirm which measurement is the input and which is being predicted.
  2. Choose the explanatory value. Express it in the same units used in the model.
  3. Substitute and calculate. Multiply before adding, keep the sign of the coefficient, and retain useful precision.
  4. Interpret and check the range. State the predicted response with units and assess whether the input lies within the observed interval.

Apply the method to the delivery model

The input is distance in kilometres and the output is predicted time in minutes. For x=16x=16:

y^=12+1.8(16)\hat{y}=12+1.8(16)
y^=12+28.8=40.8.\hat{y}=12+28.8=40.8.

So the model predicts about 40.840.8 minutes. The input lies between 55 and 2525 kilometres, making this interpolation.

Keep the original units

If the distance is given as 16,000 m16{,}000\,\mathrm{m}, convert it to 16 km16\,\mathrm{km} before using this equation. Substituting 16,00016{,}000 into a model built for kilometres would produce an incorrect prediction.

Round at the end

Use the supplied coefficients as given. If software provides more digits than the written equation, use that precision unless the question specifies the rounded model. Write “approximately” when appropriate; a decimal output does not make the prediction exact.

Read the line and its units

In y^=12+1.8x\hat{y}=12+1.8x, the intercept is a=12a=12 minutes and the slope is b=1.8b=1.8 minutes per kilometre. Each extra kilometre corresponds to an increase of 1.81.8 minutes in the predicted time.

The intercept gives the model’s prediction at x=0x=0: y^=12\hat{y}=12. But zero kilometres is outside the recorded interval and a zero-distance delivery may not make sense in this setting. Treat that intercept as part of the equation; do not claim the data establish an actual zero-distance delivery time.

Negative slopes work the same way

Suppose an invented battery study provides y^=98−6x\hat{y}=98-6x, where xx is hours of use and y^\hat{y} is predicted remaining charge as a percentage. The observed times span 0≤x≤100\le x\le10.

A decreasing model can still predict a positive response
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 0 2 4 6 8 10 Use time (hours) 0 20 40 60 74 100 Remaining charge (%) Predicted charge $\hat{y}=74\%$ $\hat{y}=98-6x$ A negative slope gives lower predictions image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 0 2 4 6 8 10 Use time (hours) 0 20 40 60 74 100 Remaining charge (%) Predicted charge $\hat{y}=74\%$ $\hat{y}=98-6x$ A negative slope gives lower predictions

The line is the supplied battery model over the observed time interval. The square marks the prediction after four hours; no individual measurements are shown.

y^=98−6(4)=74.\hat{y}=98-6(4)=74.

At 44 hours, the model predicts 74%74\% remaining charge. A negative slope means predictions decrease as the input increases; it does not mean the predicted response must be negative.

This section helps you read a supplie[Truncated]