One cloud of points. Two ways to draw the trend.
Least-squares regression and median-fit lines both summarize a linear association. They answer the same modeling question with different priorities: smallest total squared error versus resistance to extreme values.
Model 1 · Least squares
Regression chooses the line with the smallest squared misses
For every point, measure the vertical residual \(y-\widehat y\). Square those residuals, add them, and choose the line that makes that total as small as possible.
Why square?
Positive and negative misses cannot cancel, and a large miss receives more weight than several tiny misses.
What the hat means
\(\widehat y=mx+b\) is a prediction rule. It is an estimate from observed data, not a guarantee for every case.
Residual sign
Read each miss from the point to the line
Calculator translation
Turn output symbols into a model with meaning
Suppose technology runs LinReg in the form \(y=ax+b\) and reports these values.
b = 12.6
r = 0.94
Model 2 · Median-fit
Compress the cloud into three resistant summary points
Outlier stress test
Extreme points pull the two methods differently
Least squares
Large residuals are squared, so an extreme point can exert strong pull on the fitted line.
Median-fit
Group medians depend on rank and usually change less when one value becomes extreme.
Model check
A residual plot should look boring
A reasonable linear model leaves residuals scattered above and below zero with no clear shape. A curve, fan, or long run of one sign signals structure the line did not capture.
Judge the full residual plot. A line can hit one point perfectly and still miss the overall shape.