Mistake Master
Student view — seeing the site as a student does

Least-Squares Regression

▶︎  Watch it animatedinteractive step-through · ~3 min · optional ⚙︎  Open the appletLSRL Lab · move one point and flip the slope with r-squared barely flinching

The least-squares line minimizes $\sum (y - \hat{y})^2$, the sum of the squared vertical residuals, and it is determined by $b_1 = r\frac{s_y}{s_x}$ and $b_0 = \bar{y} - b_1\bar{x}$, so it always passes through $(\bar{x}, \bar{y})$. For the eight students: $r = 0.977$, $s_y = 8.78$, $s_x = 2.449$, giving $b_1 = 3.5$ and $b_0 = 58.5$, with $\bar{x} = 4.5$ returning $\bar{y} = 74.25$. Then $r^2 = 0.954$: about 95.4% of the variability in exam scores is accounted for by the linear model with study hours, equivalently $1 - \frac{25.0}{539.5}$.

The criterion gets misstated as minimizing absolute errors, or perpendicular distances, or as making every residual zero. $r^2$ gets read as the percentage of points on the line, as a success rate, as an accuracy figure, or as the share of variation one variable causes in another, when it counts variability accounted for by the model and cause is a design question. And influential points get overlooked: a single high-leverage observation can swing the slope or even reverse its sign, and a large $r^2$ driven by that point describes the fit to it rather than to the rest of the data.

least squares minimizes the TOTAL AREA of these squares (4.5, 74.25) sum of squared residuals = 25.0, and no other line beats it the line always passes through the point of averages
Drawing the residuals as literal squares makes the criterion visible: it is a total area, so one large miss costs far more than several small ones.
one high-leverage point can reverse a slope slope positive slope now NEGATIVE one point the check: fit with and without the point, compare, and report both a large r-squared driven by that point describes the fit to IT
An extreme x-value gives a point leverage because the line pivots near the point of averages. Squaring the residuals is what makes the far-out observation expensive enough to swing the fit.

The work

3 ways in · any order
Lesson
Least-Squares Regression

States the least-squares criterion precisely as minimizing squared vertical residuals, derives the slope from r and the two standard deviations, shows the line through the point of averages, interprets r-squared as variability accounted for, and works the influential points that can swing the whole fit.

Skill check · 10 scenarios
Diagnostic
10-item topic check

Ten items on least squares: perpendicular or absolute criteria, r-squared read as points on the line or as an accuracy rate, causal readings of variability accounted for, and influential points overlooked. Take it cold to find your habit, or after the lesson to check it is gone.

Not started · 10 items · ~15 min
Targeted Practice
Drill a single misconception

Pick one of the failure modes you missed and drill it on its own. The round is adaptive: two correct in a row clears it for now and moves you to the next. Two in a row is a checkpoint, not proof: if the error resurfaces later, the misconception comes back.

Take the diagnostic to identify your misconceptions