Cookmath

Linear Models and Regression Residuals

A linear model y=mx+b assumes constant change per unit input. In a fitted model, predictions need not pass through every observation; residual=observed−predicted measures each vertical error. A good fit within observed inputs is not evidence that the same rate continues indefinitely or that x causes y.

Before you begin

Check: the line through (1,4) and (3,10) has slope 3. Review slope units and intercept meaning.

What you will learn

Understand the idea

A linear model y=mx+b assumes constant change per unit input. In a fitted model, predictions need not pass through every observation; residual=observed−predicted measures each vertical error. A good fit within observed inputs is not evidence that the same rate continues indefinitely or that x causes y.

Worked example 1

A delivery costs 8 units for 2 km and 14 units for 5 km. Build a linear price model.

  1. Slope m=(14−8)/(5−2)=2 units/km.
  2. Use 8=2·2+b to find b=4.
  3. P(d)=2d+4. The intercept represents a fixed charge; a 7 km trip is predicted to cost 18.

Worked example 2

A fitted model is ŷ=1.5x+6. An observation is (8,20). Find and interpret its residual.

  1. Predicted response at x=8 is 1.5·8+6=18.
  2. Residual=20−18=2.
  3. The model underpredicts this response by 2; a positive residual places the observation above the fitted line.

Diagnose an error

A student interprets a negative residual as a negative observed response. Is that valid?

Compare your reasoning

A student interprets a negative residual as a negative observed response. Is that valid?

  1. No: residual compares two values rather than giving either value itself.
  2. An observed 12 and predicted 15 give residual −3 even though both are positive.

Independent practice

Submit your answer in the interactive lesson to unlock the worked solution. Type your reasoning or build it with clickable tiles.

Practice 1

Find the line through (0,5) and (4,13).

Solution locked until submission.

Practice 2

For ŷ=4x−1, compute the residual at (3,9).

Solution locked until submission.

Practice 3

Data use ages 10 through 18. Is a prediction at age 14 or age 40 an extrapolation?

Solution locked until submission.

Practice 4

A plan costs 20 per month plus 0.05 per message. Another costs 35 with unlimited messages. Find the break-even count.

Solution locked until submission.

Connect and reflect

Report the formula, units, valid input range and residual interpretation together; a numerical fit alone does not justify causal claims.

Original Cookmath explanations and exercises. Scope reference: OpenStax Precalculus 2e · scope reference; original Cookmath lesson. Cookmath units are smaller study groups, not publisher chapter counts.

Continue learning

Linear Functions and Models