Unit 5 · Topic 5.3 · about 20 minutes
Linear Regression Models
Use a linear regression model to calculate a predicted response, and judge whether that prediction can be trusted.
Predict first
A line fits the 14 used sedans from 5.1 Graphical Representations Between Two Quantitative Variables very well: their ages run from 1 to 10 years, and . A neighbor wants to use the same line to price her own sedan of that model, which is 20 years old. How much should she trust the prediction?
A line that predicts
When a scatterplot shows a linear form, you can summarize the relationship with a linear regression model: an equation that uses the explanatory variable to predict the response variable .
Here is the y-intercept, is the slope, and is a value of the explanatory variable. What and mean in context is the subject of 5.5 Least-Squares Regression.
The hat on (say "y-hat") marks a predicted value. Plain is a value that was actually observed. Keep the two apart. The model gives a prediction, and real cars land above it or below it.
The model only makes sense when the form looks linear. A straight line fit to curved data, like the typing speeds in 5.1 Graphical Representations Between Two Quantitative Variables, will miss in the same direction over whole stretches of the data.
The sedans with the model
Price is in thousands of dollars, so a predicted value of 17.03 means about 17,030 dollars.
Making a prediction
To predict, substitute a value of and calculate. For a 6-year-old sedan:
The model predicts an asking price of about 17,030 dollars. Two of the sedans in the data are 6 years old, listed at 16,800 and 17,800 dollars. Neither matches the prediction, and the model never promised that it would. 5.4 Residuals measures how far each real car lands from the line.
Inside the data or outside it
The 14 sedans are 1 to 10 years old. A prediction for an age inside that interval, like 6 years, is interpolation. A prediction for an age outside it, like 20 years, is extrapolation.
Interpolation has data on both sides of it. Extrapolation assumes the straight-line pattern keeps going where nobody collected any data, and patterns often change. Cars lose value quickly at first and more slowly later, so a line fit to younger cars drops below zero long before real prices do. The model hits zero at about 17 years.
The further you extrapolate, the less reliable the prediction. A 12-year-old sedan is a small stretch past the data. A 20-year-old sedan is a leap.
Chirp rate and temperature on 16 summer nights
The data stop at 82 chirps per minute. Everything to the left of that is the line continuing on its own, with no nights to check it against.
Worked examplePredicting temperature from cricket chirps
On 16 summer nights, a student counted how many times a snowy tree cricket chirped in one minute and recorded the temperature. Chirp rates ran from 82 to 184 per minute. The regression line is , where is chirps per minute and is the predicted temperature in degrees Fahrenheit. (a) Predict the temperature on a night with 150 chirps per minute. (b) A cricket in a cold garage chirps 30 times per minute. What does the model predict, and should you trust it?
Identify . The model takes chirps per minute and returns a temperature, so 150 and 30 are values of .
(a) Substitute. . The model predicts about 77.4 degrees. Since 150 is between 82 and 184, this is interpolation.
(b) Substitute. degrees. But 30 chirps per minute is far below anything in the data, so this is extrapolation. The student never recorded a night that cold and has no evidence the line still holds there.
Compare. Trust (a) far more than (b). The arithmetic is equally easy in both; the evidence behind it is not.
(a) About 77.4 degrees, an interpolation. (b) About 48.1 degrees, but 30 chirps per minute is well outside 82 to 184, so this extrapolation is much less reliable.
Check your understanding
A pet store models a hamster's weight (grams) from its age (weeks), using hamsters 3 to 12 weeks old: . What weight does the model predict for an 8-week-old hamster? Give your answer in grams.
A model that predicts a house's sale price from its floor area was built from 60 houses with floor areas between 1,100 and 3,200 square feet. For which house is the prediction an extrapolation?
A model predicts the temperature (degrees Fahrenheit) from the number of cricket chirps per minute, : . What does stand for?
A pediatrician's model predicts a child's height (inches) from age (years), using children aged 2 to 10: . A parent substitutes her own age, 40. Which statement is correct?
A linear regression model predicts nighttime temperature from cricket chirps per minute. The data used to fit it covered chirp rates from 82 to 184 per minute, but no night had between 125 and 130 chirps per minute. Using the model to predict the temperature at 127 chirps per minute is
Course alignment, for teachers
AP Statistics topic 5.3, Unit 5: Regression Analysis.
- Skill 3.B: Calculate summary statistics, relative positions of points within a distribution, and predicted responses.