Unit 5 · Topic 5.5 · about 25 minutes
AP Statistics 5.5: Least-Squares Regression
Get the least-squares regression line from technology and interpret its slope, y-intercept and coefficient of determination in context.
Unit 5: 10 to 20% of the multiple-choice section
What you'll be able to do
- Calculate the slope and y-intercept of the least-squares regression line.
- Interpret the slope and y-intercept of the least-squares regression line in context.
Key vocabulary
| Term | What it means | The exam trap |
|---|---|---|
| Least-squares regression line | The line that makes the sum of the squared residuals as small as possible. It always passes through . | Passing through data points earns nothing: Jordan's Line A hits two points exactly and still loses, with a sum of squares of 3.875 against 3.60. |
| Slope | The predicted increase or decrease in the response variable for each one-unit increase in the explanatory variable. | On a TI-84, LinReg(ax+b) reports the slope as a, which is how the slope ends up reported as the intercept. |
| Y-intercept | The predicted value of the response variable when the explanatory variable equals 0. | A size of 0 square feet is far outside apartments of 450 to 1,400 square feet, so the rent model's intercept of 462.14 dollars has no reasonable meaning. |
| Coefficient of determination | The proportion of the variation in the response variable that is explained by the linear relationship with the explanatory variable. | Taking the square root of gives only the size of . Its sign comes from the slope. |
| Constant | The row of regression output that holds the y-intercept . The slope is in the row named for the explanatory variable. | The S and R-Sq values printed under the table are not coefficients, and using either one as the slope gives a wrong prediction. |
Predict first
Three students each draw a line through the same scatterplot, and each claims to have the best one. Which rule do statisticians use to settle the argument?
What least squares means
Every line drawn through a scatterplot leaves residuals. Squaring them does two jobs. Every miss counts as positive, so misses above the line cannot cancel misses below it. And a big miss counts far more than a small one. Out of all possible lines, exactly one makes the sum of the squared residuals as small as it can be. That line is the least-squares regression line, often shortened to LSRL.
Jordan recorded the most pull-ups he could do in each of his first five weeks of training: 2, 5, 4, 7 and 9. Line A connects his first week to his fifth. Line B is the least-squares line.
| Week, | Pull-ups, | Line A residual | Line A squared | Line B residual | Line B squared |
|---|---|---|---|---|---|
| 1 | 2 | ||||
| 2 | 5 | ||||
| 3 | 4 | ||||
| 4 | 7 | ||||
| 5 | 9 | ||||
| Sum of squares |
Line A hits two of the points exactly and still loses, 3.875 to 3.60. No line through these five points does better than 3.60. That is what the least-squares line guarantees.
You will not find the least-squares line by trying lines one at a time, or by hand at all. A calculator or software computes the slope , the y-intercept and the correlation from the data.
One fact about the line is worth knowing without technology: it always passes through the point . Jordan's averages are weeks and pull-ups, and Line B gives exactly.
Jordan's five weeks with the least-squares line
The line passes through , the point of averages, even though no week landed there.
Reading regression output
Software prints the least-squares line as a small table. This output comes from 15 apartments in one city, with floor area in square feet used to predict monthly rent in dollars.
| Predictor | Coef |
|---|---|
| Constant | 462.14 |
| Size | 1.2148 |
Under the table, the output adds S = 174.61 and R-Sq = 80.8%.
- The Constant row holds the y-intercept, .
- The row named for the explanatory variable holds the slope, .
- R-Sq is , the coefficient of determination, written as a percent. It is the proportion of the variation in the response variable that is explained by the linear relationship with the explanatory variable.
So the model is . Output usually prints more than you need. S is not part of this course, so find the two coefficients and R-Sq and leave the rest.
Rent and size for 15 apartments, with the least-squares line
Sizes run from 450 to 1,400 square feet. A size of 0 is far off the left edge of the data.
Worked exampleInterpreting the rent model
Use the output above. Interpret the slope, the y-intercept and in context, and find the correlation .
Slope. For each additional square foot of floor area, the predicted monthly rent increases by about 1.21 dollars. A square foot is small, so scaling up can help: 100 more square feet goes with about 121 dollars more in predicted rent.
Y-intercept. An apartment with 0 square feet has a predicted rent of 462.14 dollars. That has no reasonable meaning here. The apartments ranged from 450 to 1,400 square feet, so a size of 0 is far outside the data, and an apartment with no floor area does not exist.
. About 80.8% of the variation in monthly rent is explained by the linear relationship with floor area. The other 19.2% is variation the line does not account for, from things like location and the age of the building.
Correlation. . It is positive because the slope is positive; both describe the same upward direction.
Slope: about 1.21 dollars more in predicted rent for each additional square foot. Intercept: no sensible meaning, since 0 square feet is far outside the data. : about 80.8% of the variation in rent is explained by the linear relationship with size. .
Check your understanding
A model predicts a car's highway gas mileage (miles per gallon) from its weight (thousands of pounds). For this model, . Which is the correct interpretation?
The least-squares line for predicting how many minutes a phone's battery lasts from its screen brightness setting (percent) is . Which is the correct interpretation of the slope?
For 40 students, the mean number of hours spent studying for a test is 6.2 and the mean test score is 81.5. The least-squares line for predicting score from hours studied has slope 2.4. What score does the line predict for a student who studied 6.2 hours?
A teacher used data from 35 students to predict the final course grade (percent) from the number of absences. Computer output for the least-squares regression is shown.
What final grade does the model predict for a student with 6 absences?
Each model below was fit to the data described. For which model does the y-intercept have a reasonable interpretation in context?
Unit 5 check: 10 questions from every lesson in Unit 5
Exam strategy for this topic
- Section I, Multiple Choice: 42 questions in 90 minutes.
- Section II, Free Response: 4 questions in 90 minutes.
- A graphing calculator with statistical capabilities is expected on both sections.
Questions students ask
Why square the residuals instead of just adding them?
Squaring makes every miss count as positive, so misses above the line cannot cancel misses below it. It also makes a big miss count far more than a small one.
Do I have to compute the slope and intercept by hand?
No. A calculator or software computes , and from the data. On a TI-84, use LinReg(a+bx) so the letters match .
What is useful about the line passing through ?
It gives one prediction for free. If students averaged 6.2 hours of study and a mean score of 81.5, the least-squares line predicts 81.5 for a student who studied 6.2 hours.
How do I get from ?
Take the square root and give it the sign of the slope. For the rent model, , positive because the slope is positive.
Are and parameters?
No. They are calculated from one sample, so they are statistics. A different set of 15 apartments from the same city would give a slightly different line.
When does the y-intercept make sense?
When an x-value of 0 is possible and inside the data. A pizza with 0 toppings is a plain cheese pizza, so that model's intercept is a sensible predicted price.
Course alignment, for teachers
AP Statistics topic 5.5, Unit 5: Regression Analysis.
- Skill 3.B: Calculate summary statistics, relative positions of points within a distribution, and predicted responses.
- Skill 4.D: Interpret statistical calculations and results to assess meaning or a claim.