Algebra 1 · Study guide

Regression and Median-Fit Lines

Algebra 1 · Data lab 04.07

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.

Observed yThe output actually measured.
Predicted ŷThe output the fitted line predicts.
ResidualThe vertical miss: observed minus predicted.

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

Residual always means observed − predicted. Switching the order reverses every sign and breaks the interpretation.

Calculator translation

Turn output symbols into a model with meaning

Suppose technology runs LinReg in the form \(y=ax+b\) and reports these values.

LinReg(ax+b)a = 4.82
b = 12.6
r = 0.94
Model\(\widehat y=4.82x+12.6\)
Slope 4.82Predicted y rises 4.82 units for each 1-unit increase in x.
Intercept 12.6Predicted y when x = 0—interpret only if x = 0 makes sense in context.
r = 0.94Strong positive linear association; it does not prove causation.

Model 2 · Median-fit

Compress the cloud into three resistant summary points

Sort all points from smallest x to largest x.
Split them into three nearly equal groups.
Find median x and median y in each group.
Use the outside medians for slope; average three intercepts.
The median x and median y are found within each group. They form a summary point; it does not have to be one of the original observed pairs.

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.

!
One small residual does not certify the model.

Judge the full residual plot. A line can hit one point perfectly and still miss the overall shape.