1 / 17
Fitting a Linear Function | Lesson 1 of 1

Fitting a Linear Function to a Scatter Plot

Lesson 1 of 1: Which Line Is Best?

In this lesson:

  • Recall one hand-drawn line for study-hours data
  • Run the regression and see what makes it least squares
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Learning Objectives for This Lesson

By the end of this lesson, you should be able to:

  1. Fit a line to linear-looking data with technology, recorded as
  2. Explain least squares (the smallest total of squared residuals) and show the regression line's total beats a hand line's
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Should We Fit a Line Here?

Two panels: the study-hours scatter rising in a straight band with a line through it, marked fit a line; and a projectile's rise-then-fall arc that a straight dashed line misses, marked do not

  • Study hours vs score: straight path → fit a line
  • Projectile height vs time: curved → a line is the wrong model
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

The Study-Hours Data: Twelve Students

Hours, 3 4 4 4 5 5 6 6 7 7 7 8
Score, 67 73 77 73 84 78 86 88 90 87 93 99
  • Rises along a straight path: no curve, no outlier
  • Observed range: 3 to 8 hours per week
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Recall: One Hand Line, Two Points

Step Work
Two points on the drawn line and
Slope (98 − 68) ÷ (8 − 3) = 30 ÷ 5 = 6
Intercept 68 − 6 × 3 = 50
Hand line
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Is the Hand Line a Reasonable Fit?

Residuals (actual − predicted): −1, −1, +3, −1, +4, −2, 0, +2, −2, −5, +1, +1

  • Follows the trend: rises with the cloud
  • Balanced: 5 above, 6 below, 1 on the line
  • Close: every miss within 5 points
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Recall: Run the Linear Regression

  • Run linear regression on the 12 pairs, as in HSS.ID.B.6.a
  • Read by role, not letter: TI's LinReg(ax+b) calls the slope a
  • Intercept , slope
  • Record ; display
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Why Not Just Add the Residuals?

  • Hand line: residuals sum to −1; regression line: 0
  • Every line through the mean point, (5.5, about 82.92), sums to 0
  • Even the flat line at the mean score sums to 0, and it ignores the trend
  • Plus and minus misses cancel, so the sum can't pick one line
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Square the Misses, Then Total Them

A fitted line with a dashed vertical miss from each data point to the line, captioned minimize the total of these squared

  • Squares are never negative: every miss counts, big ones more
  • Least-squares line: the smallest total of squared residuals
  • The regression line from technology is that line
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Hand Line: Squared Residuals Total 67

3 4 4 4 5 5 6 6 7 7 7 8
Residual −1 −1 3 −1 4 −2 0 2 −2 −5 1 1
Squared 1 1 9 1 16 4 0 4 4 25 1 1

Total of the squares: 67

Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Regression Line: Total About 65.80

3 4 4 4 5 5 6 6 7 7 7 8
Residual −1.43 −1.22 2.78 −1.22 3.98 −2.02 0.19 2.19 −1.61 −4.61 1.39 1.59
Squared 2.03 1.49 7.72 1.49 15.85 4.07 0.03 4.78 2.60 21.26 1.93 2.54

Total (from unrounded columns) ≈ 65.80

Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

By the Criterion, the Regression Line Wins

  • Criterion: 65.80 < 67, so the regression line fits better
  • Not wrong: the hand line still follows the trend, is balanced, and is close
  • Different coefficients alone decide nothing; the totals do
  • Rounded totals 65.8 here; a rounded line need not always win
Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Quick Check: Is the Hand Line Wrong?

Your hand line is ; the calculator gives .

  • Is your line wrong? Explain in one sentence.

Answer: No. The unrounded regression line has the smallest total, so yours totals more; yours can still be a reasonable informal fit.

Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Practice 1: Which Line Does the Criterion Pick?

0 2 4 6 8
10 13 18 20 24
  • Supplied line:
  • Find both totals of squared residuals; which line wins?

Answer: Regression , total 1.5; supplied line total 9. Regression wins.

Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Practice 2: A Falling Cloud, Same Rule

1 2 3 4 5
20 18 15 11 9
  • Supplied line:
  • Find both totals of squared residuals; which line wins?

Answer: Regression , total 1.1; supplied line total 3. Regression wins.

Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Practice 3: More Points Hit, Better Fit?

1 2 3 4 5
3 5 6 9 10
  • Supplied passes through 3 data points. Better?
  • Judge with both totals of squared residuals

Answer: Supplied total 2; regression total 0.8. The criterion picks the regression line.

Grade 9 Statistics | HSS.ID.B.6.c
Fitting a Linear Function | Lesson 1 of 1

Key Takeaways and What's Next

✓ Fit a line only to a linear cloud

✓ Least squares: smallest total of squared residuals

✓ Regression finds that line:

⚠️ Plain residuals cancel; square them

⚠️ A larger total ≠ a wrong hand line

Next: interpret slope and intercept (C.7).

Grade 9 Statistics | HSS.ID.B.6.c