Least-Squares Regression

Drag any point. The line refits instantly to the one line that makes the sum of squared residuals smallest. A residual is the vertical gap point−line: e = y − ŷ. The LSRL always passes through (x̄, ȳ).

| positive residual (point above line)   | negative residual (below)  ·  navy line = LSRL

Residual plot (e vs x) — a good linear fit shows no pattern

ŷ = 0 + 0x
Slope b₁
0
Δŷ per +1 x
Intercept b₀
0
ŷ at x = 0
0
% of y-variation explained
SSR Σe²
0
what LSRL minimizes

Try: load Tight (SSR tiny, r² near 1, residual plot flat). Drag one point far off the line — SSR jumps because each residual is squared. Then load Outlier: a single far point tilts the whole line and dominates SSR. Drag it onto the cloud and watch SSR collapse and the line straighten.