AP Statistics · Unit 5 · Topic 5.5

    5.5 Least-Squares Regression

    Reviewed by P V Satish, Senior Faculty of Science and Academic Consultant · PG Life Sciences, PGD Biotechnology · 20+ years teaching NEET and AP · Special interest in biotechnology, biochemistry and the basics of physics
    Updated

    In short

    The least-squares regression line minimises the sum of the squared residuals. Its slope is b=rsysxb = r\frac{s_y}{s_x} and it passes through (xˉ,yˉ)(\bar{x}, \bar{y}), so a=yˉ−bxˉa = \bar{y} - b\bar{x}. Interpret the slope as the predicted change in y for each 1-unit increase in x, and r² (the coefficient of determination) as the proportion of the variation in y explained by the linear relationship with x.

    What you need to know

    • Explain what makes the least-squares line 'best'.
    • Calculate the slope and intercept from summary statistics.
    • Interpret the slope, intercept and r² in context.
    • Read the regression equation, s and r² from computer output.

    Why 'least squares'?

    Many lines could be drawn through a scatterplot. The least-squares line is the one that makes the sum of the squared residuals, Σ(y − ŷ)², as small as possible. Squaring stops positive and negative residuals cancelling and gives extra weight to large misses.

    b=r sysxa=yˉ−bxˉb = r\,\frac{s_y}{s_x} \qquad a = \bar{y} - b\bar{x}

    For the 10 students: x̄ = 4.2 hours, s_x = 2.30, ȳ = 65.2 points, s_y = 10.18, r = 0.952. Then b = 0.952 × 10.18/2.30 ≈ 4.21 points per hour and a = 65.2 − 4.21 × 4.2 ≈ 47.5, matching the line from topic 5.3. The line always passes through the point of means (4.2, 65.2).

    Interpreting slope, intercept and r²

    • Slope (4.21): for each additional hour studied, the predicted test score increases by about 4.21 points.
    • Intercept (47.5): the predicted score for a student who studies 0 hours is 47.5 points (an extrapolation here, since the data start at 1 hour).
    • r² (0.906): about 90.6% of the variation in test scores is explained by the linear relationship with hours studied.
    • s (3.32): actual scores typically differ from predicted scores by about 3.3 points.

    r² = (0.952)² ≈ 0.906. The remaining 9.4% of the variation in scores is due to other factors (prior knowledge, sleep, test-day nerves) and random variation.

    Reading computer output

    Typical regression output for the study data
    PredictorCoefSE CoefTP
    Constant47.5002.27820.850.000
    Hours4.2140.48138.760.000

    Below the table you'd see S = 3.32066, R-Sq = 90.6%. Read the equation from the Coef column: ŷ = 47.5 + 4.214x. The 'Constant' row is the intercept; the row named after the explanatory variable gives the slope.

    The SE Coef, T and P columns relate to inference about the regression line, which is not part of the 2026–27 AP Statistics course. You only need the coefficients, S and R-Sq. Find r from R-Sq by taking the square root and giving it the sign of the slope: √0.906 ≈ +0.952.

    Key terms

    Least-squares regression line
    The line that minimises the sum of squared residuals.
    Slope b
    The predicted change in y for a 1-unit increase in x; b = r·s_y/s_x.
    Coefficient of determination r²
    The proportion of the variation in y explained by the linear relationship with x.
    Point of means
    (x̄, ȳ), which always lies on the least-squares line.

    Common mistakes

    • Interpreting the slope without 'predicted'.

      'The predicted [y] increases by b [units] for each 1 [unit] increase in [x].'

    • Saying r² is the percentage of points on the line.

      r² is the proportion of variation in y explained by the line.

    • Taking r = √r² without checking the sign.

      r has the same sign as the slope.

    How this topic is tested

    • Write slope interpretations with 'predicted' and units.
    • Read a and b from the Coef column of output.
    • Interpret r² as 'the percentage of the variation in [y] explained by the linear relationship with [x]'.

    Practice questions

    Original AP-style multiple-choice questions. Pick an answer to see the explanation.

    1. Question 1 · SP 3 · Analyze Data

      r = 0.6, s_x = 5, s_y = 20. The slope of the least-squares line is:

    2. Question 2 · SP 3 · Analyze Data

      With b = 2.4, x̄ = 10 and ȳ = 50, the intercept is:

    3. Question 3 · SP 4 · Interpret Results

      A line predicting fuel cost (₹) from distance (km) has slope 6.5. The correct interpretation is:

    4. Question 4 · SP 3 · Analyze Data

      Output shows R-Sq = 64% and a negative slope. What is r?

    5. Question 5 · SP 4 · Interpret Results

      r² = 0.72 for a line predicting sales from advertising spend. The best interpretation is:

    Free-response practice

    Write your answer first, then mark it against the scoring guide.

    Regression · 4 points

    For 20 randomly selected flats in a city, the regression of monthly rent (₹ thousands) on floor area (m²) gives this output: Constant 4.2, Area 0.31; S = 2.6, R-Sq = 81%.

    1. (a) Write the equation, defining variables.
    2. (b) Interpret the slope.
    3. (c) Interpret R-Sq and find r.

    Connected topics

    Frequently asked questions

    Does the least-squares line always pass through (x̄, ȳ)?

    Yes, always. It's a quick check on any equation you compute by hand.

    Will I need the T and P columns?

    Not in the 2026–27 course; inference for the slope was removed. Read only the coefficients, S and R-Sq.

    Is a high r² enough to trust the line?

    No. Check the residual plot for patterns too.

    How this shows up on the exam42 multiple-choice questions and 4 free-response questions of 10 points. See what each one asks you to do.Full-length AP Statistics practice examsUnit 5 is one of 5 units on the exam. Two timed exams in the 2027 format (42 MCQ + 4 FRQ), with explanations, scoring guides and an estimated 1–5 score. $14.99 · try 5 questions free.

    Free Unit 5 cheat sheet

    Every topic in Unit 5: Regression Analysis on a few printable pages: the core idea, key terms, the two traps students fall into and what the exam asks.

    We'll use your email to tell you when new AP Statistics practice material is ready. No spam, and we'll delete it if you ask.

    Free Unit 5 practice test: 25 questions with explanations

    All topics in Unit 5: Regression Analysis

    1. 5.1 Graphical Representations Between Two Quantitative Variables
    2. 5.2 Correlation
    3. 5.3 Linear Regression Models
    4. 5.4 Residuals
    5. 5.5 Least-Squares Regression

    Other units in AP Statistics

    AP® is a trademark registered by College Board, which is not affiliated with, and does not endorse, this website.