KS Maths
Year 11 Extended Β· Unit 5 Sampling, correlation and regression Β· Lesson 5 of 5

Is a straight line appropriate?

Is a straight line the right model? Residuals, r and prediction

This lesson uses the gaps from the line, the residuals, to decide whether a straight line is a fair model, and says how far to trust a prediction from it.

Statistics and ProbabilityGDC optional

Words you need (10 key words in this lesson)

The maths words this lesson uses, in plain English. Open this before you start if English is not your first language.

straight line
A line that does not bend.A ruler draws a straight line.
predict
Say what you think will happen using the data.Predict the score for 5 hours of study.
regression
A method for finding the best straight line through data.The regression line predicts y from x.
positive
Greater than zero.7 is a positive number.
line of best fit
A straight line drawn through the middle of scattered points.The line of best fit shows the trend.
negative
Less than zero. A negative number has a minus sign.Minus 4 is a negative number.
decimal place
A digit after the decimal point. We count places from the point.3.14 has two decimal places.
standard deviation
A number that shows how far data are from the mean on average.A small standard deviation means data are close together.
extrapolate
Estimate a value outside the range of the data.Extending the line past the data is less reliable.
approximately
Close to a value, but not exactly equal.Pi is approximately 3.14.

Preview You are reading the start of this lesson. The rest opens with a plan. See plans Already paid? Sign in

Warm-up

Three quick ones from earlier work. Try each in your head or on paper before you open the answer.

  1. From Year 9: a line is y = 3x + 2. A dot is at (4, 17). Is the dot above or below the line, and by how much?
    AnswerThe line gives 14, so the dot is 3 above the line.
  2. From Lesson 4: what does the regression line make as small as possible?
    AnswerThe total of the squared vertical gaps from the dots to the line.
  3. From Year 9: a line of best fit for data with x from 5 to 20 is used to predict at x = 12 and at x = 60. Which prediction is inside the data, and which is safer?
    Answerx = 12 is inside the data (interpolation) and is the safer one; x = 60 is far outside it (extrapolation), where nobody knows whether the pattern holds.
Words used in this lesson
residual
a dot's y minus the line's y at the same x. For example: a plant 2.5 cm below the line has residual βˆ’2.5.
model
a rule or equation used to describe or predict real data. For example: the regression line used to forecast sales.
appropriate
suitable for the data and the purpose. For example: a straight line is appropriate when the residuals have no pattern.
systematic
following a pattern rather than being random. For example: residuals that are positive, then negative, then positive.
extrapolation
predicting for an x outside the range of the data. For example: forecasting sales beyond the months measured.

Two sets of dots

A regression line can be worked out for any dots. Here are two sets of eight dots at x = 1 to 8. In one the dots form a rough band that rises; in the other they follow a clear curve that bends upwards. The residual of a dot is its gap from the line: the dot's y minus the line's y. It is positive above the line and negative below it.

Predict first: which set do you think will have the higher r, the rough band or the curve? And for which set does a straight line deserve to be called a good model? Slide through the dots and switch sets.

yresiduals12345678x
0.93r, to two decimal places
y = 2x + 3regression line
3residual of the chosen dot

Roughly straight data: r = 0.93 and the line is y = 2x + 3. The dot at x = 4 is 3 above the line.

Show me the steps
  1. Roughly straight data, dot at x = 4: r = 0.93 and the line is y = 2x + 3. The dot is at 14 and the line gives 11, so its residual is 14 βˆ’ 11 = 3.
  2. The eight residuals are 1, βˆ’2, βˆ’1, 3, βˆ’2, 1, 2 and βˆ’2: some above, some below, no shape. Their total is 0. A straight line is a fair model.
  3. Curved data: r = 0.98, higher than before, and the line is y = 9x βˆ’ 13. Its residuals are 7, 1, βˆ’3, βˆ’5, βˆ’5, βˆ’3, 1 and 7.
  4. The curved residuals are positive at both ends and negative in the middle, a U. The line misses the bend, so a straight line is the wrong shape here, whatever r says.

Judge a straight line by its residuals as well as by r.

  • The residuals of a regression line add to 0. Look at them in order of x, not just at their size.
  • A shapeless scatter of residuals about 0 supports a linear model. A U or an arch says the line is the wrong shape. Residuals that grow in size as x rises say the line's predictions are less reliable where the spread is large.
  • r measures how closely dots follow a straight line. r is a number about the dots you have, not a promise about dots you do not.
  • Predicting y from x inside the data (interpolation) is reasonable with a sound model. Predicting outside it (extrapolation) assumes the pattern goes on, and the cost grows with the distance.

A high r and a good model are different things. It is tempting to report r and stop. Two checks are needed: the residuals for the shape of the model, and the position of x for the trust in a prediction. A good report says both: β€œthe line is a fair model for x from 1 to 8, and predictions inside that range are reasonable; beyond 8 it is untested.”

The rest of this lesson is in the full course

Still to come in this lesson:

  • Worked examples
  • Check before you go on
  • Your turn

In the full lesson every figure moves as you drag it, and every answer you type is checked, with a note on what each wrong answer means.

Years 7 to 11 plan$59Every lesson from Year 7 to Year 11, so the refresher links always open, and every Year 7 to 11 revision pack, for the whole family. $59 for 12 months or $99 for 2 years.
IB Diploma plan$99Every lesson from Year 7 to the IB Diploma, AA and AI, SL and HL, for the whole family. $99 for 12 months or $149 for 2 years.

One plan opens every Diploma lesson, AA and AI, SL and HL, for the whole family.

One payment. Nothing renews. Full refund within 30 days. Prices are in US$; Gumroad shows your local currency at checkout. Pay by card on Gumroad, then come back here and type the email you paid with: we email you a sign-in link. For a refund, reply to your Gumroad receipt or email hello@ksmaths.com.

Try a free sample lesson in every unit, and the whole Skill Tree. See this unit.

Already have a revision pack or the Years 7 to 11 plan? Move up and the unused part of what you paid comes off.

Teaching students who need extra support? Student codes for 5, 10 or 30 students.

Year 11 revision pack, $19BuyPlan $59