Least-Squares Criterion vs Least-Squares Regression Line
Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.
Least-squares criterion
Regression and correlation
The least-squares criterion picks the line that makes the sum of the squared vertical distances from the points to the line as small as possible.
Out of every line you could draw through a scatterplot, the least-squares criterion keeps the one that minimizes , where (read y-hat) is the height of the line above each . Two details in that sentence do the work. The distances are vertical, measured parallel to the axis, not perpendicular to the line, so the criterion is asking how badly the line predicts and nothing else. And they are squared, which stops positives and negatives cancelling and makes one big miss cost more than several small ones.
Take the four points , , and . The obvious line through the first and last of them is , leaving residuals 0, -1, 1 and 0, which score . Least squares instead returns , whose residuals are 0.3, -0.9, 0.9 and -0.3 and score . No line scores below 1.8 on these four points.
What that comparison kills is the rule students reach for first: "the best line is the one whose residuals add to zero." Both lines above do that. So does every line through the point of averages , read x-bar and y-bar, and there are infinitely many of those. Residuals summing to zero is a property the least-squares line happens to have, not the test that identifies it.
Least squares is one criterion, not the only sensible one. Minimizing the total unsigned residual is a different rule, and on these same four points it prefers , whose absolute total is 2.0 against the least-squares line's 2.4. Squaring is also what lets a single far-out point swing the fit, since a miss of 4 costs sixteen times a miss of 1.
The criterion is topic 5.5, Least-Squares Regression, in Unit 5 of the Fall 2026 AP Statistics course.
The deeper reason for squaring is a calculus one. A sum of squares is smooth, so its minimum sits where the derivative is zero and can be found by solving one equation, while a sum of absolute values has corners where no derivative exists and the minimum has to be hunted for. That is the same machinery as any optimization problem, and the corners are why a critical point includes places the derivative fails to exist, not just places it is zero.
Least-squares regression line
Regression and correlation
The least-squares regression line is the straight line through a scatterplot that makes the sum of the squared residuals as small as possible.
The least-squares regression line is the one line that the least-squares criterion selects out of all the straight lines you could draw: the line minimizing , the total of the squared vertical residuals. It is written (read y-hat for ), and its two coefficients come from the summary statistics, with slope and intercept , where is x-bar, the mean of the explanatory values.
Six students study 1, 2, 3, 4, 5 and 6 hours and score 60, 72, 65, 78, 71 and 86. Here , , , and , so points per hour and . The fitted line is , its residuals are -2, 6, -5, 4, -7 and 4, and their squares total 146. No other straight line drives that total below 146.
The picture to correct is the one where the best-fit line threads through as many points as it can. This line passes through none of the six, and its smallest miss is 2 points. The point it does pass through is the point of averages , since , and that holds for every least-squares line because it is the intercept formula rearranged. Quality of fit is a statement about all the residuals at once, never about how many points were hit.
Two limits come with the line. The formulas return one as long as the -values are not all identical, curved data included, so the existence of a line is no evidence that a line belongs on the data. And squaring the misses leaves the fit with no resistance, so a single observation far out in can move a long way.
Least-squares regression is topic 5.5 in Unit 5, Regression Analysis.
A physics lab runs this procedure almost every week. Data is rearranged so the relationship plots as a straight line, a least-squares line is fitted to it, and a physical constant is read off the slope: linearization.