Knaph

Statistics of Two Variables86 of 1002 min read

Fitting a Line with Technology

Zoe measured the height and weight of 8 classmates. A calculator gave the line y^=−96.1+0.94x\hat{y} = -96.1 + 0.94x. How does it pick that line, and what do its numbers mean?

What the technology gives you

Type the pairs into a calculator or a spreadsheet and ask for a linear regression. It returns the least-squares line. The little hat on y^\hat{y} means a predicted value. Here xx is height in cm and yy is weight in kg.

Each dot has a vertical miss: its gap from the line. This line makes the sum of the squared misses as small as possible. The line also always passes through the point of the two means, here (162.25,56.25)(162.25, 56.25).

A scatter plot of 8 dots, height in cm across and weight in kg up, with the least-squares line drawn through them and the point of the two means marked on the line.

Say what the numbers mean

The slope 0.940.94: each extra cm of height goes with about 0.94 kg more weight. The intercept −96.1-96.1 is the predicted weight at height 0. No one is 0 cm tall, and a weight of −96.1-96.1 kg is impossible. Here it just places the line. Give the units.

Inside the data or far outside

Zoe's heights run from 148 to 178 cm. For 165 cm, −96.1+0.94⋅165≈59-96.1 + 0.94 \cdot 165 \approx 59 kg. Guessing inside the range of the data is interpolating, and it is usually safe. For 100 cm the line says −96.1+0.94⋅100=−2.1-96.1 + 0.94 \cdot 100 = -2.1 kg. Going far outside the data is extrapolating, and the line may not hold there.

Your turn: y^=12+3x\hat{y} = 12 + 3x was fit to weeks 1 to 10. Predict week 6, and say whether week 30 is safe. Answer: 12+3⋅6=3012 + 3 \cdot 6 = 30; week 30 is far outside the data, so no.

Careful

An intercept can be a number that means nothing in the story. Do not read a meaning into it.

Try it at home

  1. Measure the height and the arm span of 6 people.
  2. Enter the pairs in a spreadsheet and ask for a trend line with its equation.
  3. Say what the slope means, with units.

Words in this lesson

  • least-squares line - the line that makes the sum of the squared vertical misses smallest.
  • interpolating - predicting inside the range of the data.
  • extrapolating - predicting far outside the range of the data.

Big idea

A calculator finds the least-squares line. Read its slope and intercept in context with units, trust predictions inside the data, and doubt them far outside.

Test your understanding

Sign in to test your understanding of this lesson and track your progress.