AP Statistics · Topic 5.5 · Unit 5

AP Stats 5.5: Least-Squares Regression

By Jude Wallis · Published

Topic 5.5 in the Fall 2026 AP Statistics course is least-squares regression. The line minimizes the sum of squared residuals and passes through the mean point. Read the slope as the predicted change in y per one-unit rise in x, and r-squared as the share of variation in y it explains.

AP Statistics: Unit 5 (topics 5.5). Topic 5.5 (Least-Squares Regression) closes Unit 5 in the Fall 2026 CED. Coefficients come from technology; inference for the slope of a regression line is not part of the redesigned course.

The least-squares regression line

Topic 5.5 pins down exactly which line the regression model uses. The least-squares regression line (LSRL) is the line fit by minimizing the sum of the squares of the residuals, which is why it is also called the line of best fit. Squaring the residuals makes larger misses count much more and makes the best line unique.

Two facts follow. The line always passes through the point (xˉ,yˉ)(\bar{x}, \bar{y}), the mean of the x-values and the mean of the y-values, which acts like a balance point. Its coefficients, the slope bb and intercept aa, are calculated with technology, because they come from a sample of paired values. On the exam you read aa, bb, rr, and r2r^2 from calculator output rather than computing them by hand.

Where the coefficients come from

Even though technology reports them, seeing how the coefficients relate to the summary statistics helps you check the output. The slope ties the correlation rr to the spreads of the two variables, and the intercept then forces the line through the mean point:

b=rsysxa=yˉbxˉb = r \cdot \frac{s_y}{s_x} \qquad a = \bar{y} - b\bar{x}

Here sxs_x and sys_y are the sample standard deviations (the typical spread) of the x-values and y-values. Compute the slope first, then the intercept. These relationships are no longer printed on the Fall 2026 formula sheet, which lists only the line's form y^=a+bx\hat{y} = a + bx, so lean on your calculator and use them as a sanity check.

Interpreting slope, intercept, and r-squared

Interpretation is where most points are won or lost, and each piece must be stated in context.

  • Slope bb is the predicted increase or decrease in the response variable for a one-unit increase in the explanatory variable. Say predicted, and do not claim cause unless the data came from an experiment.
  • Intercept aa is the predicted response when the explanatory variable equals 0. Sometimes it has no reasonable meaning, either because x=0x = 0 is far outside the data (extrapolation) or because it is a negative value for a quantity that cannot be negative.
  • Coefficient of determination r2r^2 is the proportion of the variation in the response variable that the linear relationship with the explanatory variable explains. An r2r^2 of 0.95 means about 95 percent of the variation in yy is explained by the model.

The r versus r-squared guide separates these two numbers carefully, since they are easy to confuse.

Find and interpret a least-squares line

A store records weekly advertising spend xx and sales yy, both in thousands of dollars, for four weeks: (2, 3), (4, 7), (6, 8), (8, 12). Find the least-squares regression line, then interpret the slope, the intercept, and r2r^2.

  1. Find the means. xˉ=2+4+6+84=204=5\bar{x} = \frac{2+4+6+8}{4} = \frac{20}{4} = 5 and yˉ=3+7+8+124=304=7.5\bar{y} = \frac{3+7+8+12}{4} = \frac{30}{4} = 7.5 thousand dollars.

  2. Find the deviations from the means. For xx: 3,1,1,3-3, -1, 1, 3. For yy: 4.5,0.5,0.5,4.5-4.5, -0.5, 0.5, 4.5.

  3. Build three sums. (xxˉ)2=9+1+1+9=20\sum (x-\bar{x})^2 = 9+1+1+9 = 20; (yyˉ)2=20.25+0.25+0.25+20.25=41\sum (y-\bar{y})^2 = 20.25+0.25+0.25+20.25 = 41; (xxˉ)(yyˉ)=13.5+0.5+0.5+13.5=28\sum (x-\bar{x})(y-\bar{y}) = 13.5+0.5+0.5+13.5 = 28.

  4. Find the slope. b=(xxˉ)(yyˉ)(xxˉ)2=2820=1.4b = \frac{\sum (x-\bar{x})(y-\bar{y})}{\sum (x-\bar{x})^2} = \frac{28}{20} = 1.4, the same value technology returns for rsysxr \cdot \frac{s_y}{s_x}.

  5. Find the intercept. a=yˉbxˉ=7.51.4×5=7.57=0.5a = \bar{y} - b\bar{x} = 7.5 - 1.4 \times 5 = 7.5 - 7 = 0.5 thousand dollars.

  6. Find r2r^2. r=2820×41=28820=2828.63560.9778r = \frac{28}{\sqrt{20 \times 41}} = \frac{28}{\sqrt{820}} = \frac{28}{28.6356} \approx 0.9778, so r20.9561r^2 \approx 0.9561.

The least-squares line is y^=0.5+1.4x\hat{y} = 0.5 + 1.4x. Slope: each additional one thousand dollars of advertising predicts a 1.4 thousand dollar rise in sales, about 1,400 dollars. Intercept: with no advertising the model predicts 0.5 thousand dollars in sales, but x=0x = 0 lies outside the observed range of 2 to 8, so it is an extrapolation. The value r20.956r^2 \approx 0.956 means about 95.6 percent of the variation in sales is explained by the linear relationship with advertising spend.

Frequently asked questions

Do I calculate the least-squares line by hand on the exam?

Usually not. A graphing calculator with statistical capabilities reports the slope, intercept, rr, and r2r^2 directly, and the formula sheet gives the line's form y^=a+bx\hat{y} = a + bx. The graded skill is interpreting those values in context.

What is the difference between r and r-squared?

The correlation rr ranges from 1-1 to 11 and gives the direction and strength of the linear association. Its square, r2r^2, ranges from 0 to 1 and gives the proportion of variation in the response explained by the model. They answer different questions, so interpret each with its own template.

Why might the y-intercept have no real meaning?

The intercept is the predicted response when xx equals 0. If x=0x = 0 sits far outside the data, reading the intercept is extrapolation. It can also be impossible in context, such as a negative predicted value for a quantity that cannot be negative, in which case you say it has no logical interpretation.