4.10 · SLPaper 1Paper 2

Regression line of x on y and prediction

In a minute

When you know yy and want to estimate xx, you need the . It is a different line from the one you met for predicting yy. You learn to find it with your GDC, predict with it, and pick the right line for every prediction.

You'll be able to

  • Find the with your GDC, and use it to predict xx from a given yy.
  • Choose the right regression line for a prediction, and explain why a line of xx on yy can't reliably predict yy from xx.
  • Use the mean point, where the two regression lines cross, to find xˉ\bar{x}, yˉ\bar{y} or a missing constant.
  • Judge whether a prediction is reliable: the right line, strong correlation, and a given value inside the data.
Before you start3 quick questions on what this builds on
Check yourself
The regression line of yy on xx is y=3x−4y = 3x - 4, and xˉ=6\bar{x} = 6. Find yˉ\bar{y}.
Check yourself
The regression line of yy on xx makes the sum of which squared distances as small as possible?
Check yourself
A line of yy on xx was built from data with xx between 2020 and 5050, and r=0.95r = 0.95. How would you describe a prediction of yy at x=65x = 65?

Revise first: 4.4 Correlation and regression (y on x)

The regression line of x on y

A forester can measure round a tree trunk with a tape in seconds. Finding the tree's age is much harder. So she wants to predict age xx from circumference yy: here yy is known and xx is the unknown.

The line of yy on xx from 4.4 won't do. It was built to keep the errors in yy small. To predict xx, you need a line that keeps the errors in xx small.

Six points with the regression line of x on y drawn through them, and a short horizontal dashed segment from each point to the line xyhorizontal distances
The squares of these horizontal distances add up to as little as possible.

Here cc and dd are constants. Exam questions may use other letters, so check which variable is on the left.

Worked exampleOver 6060 days, a household recorded the mean outdoor temperature xx °C and its electricity use yy kWh. Its daily use ranged from 99 to 2727 kWh. The regression line of yy on xx is y=30−0.8xy = 30 - 0.8x, and the regression line of xx on yy is x=31.2−0.9yx = 31.2 - 0.9y. Estimate the mean temperature on a day when the household used 1414 kWh.

Try it first, then reveal one step at a time.

  1. You know y=14y = 14 and want xx, so use the line of xx on yy: x=31.2−0.9yx = 31.2 - 0.9y.

Your GDC finds the line of xx on yy with the same linear regression command as before. The only change is the lists: the yy-values go in the X list and the xx-values in the Y list.

Worked exampleA forester records the age xx years and the trunk circumference yy cm of eight trees. xx: 12,18,25,31,40,46,55,6312, 18, 25, 31, 40, 46, 55, 63. yy: 62,95,78,124,105,150,122,16862, 95, 78, 124, 105, 150, 122, 168. (a) Use your calculator to find the regression line of xx on yy. (b) Estimate the age of a tree with circumference 100100 cm. Give your answers to 3 s.f.

Try it first, then reveal one step at a time.

  1. (a) You will predict xx from yy, so you need the line of xx on yy. Enter the circumferences (yy) as the X list and the ages (xx) as the Y list.
Check yourself
You want the regression line of xx on yy from your GDC. Which values go in the X list?
Check yourself
Use the trees' line of xx on yy to estimate the age, in years, of a tree with circumference 140140 cm. Give your answer to 3 s.f.

Which line predicts which variable

Each regression line predicts the variable named first. The line of yy on xx predicts yy. The line of xx on yy predicts xx.

Rearranging doesn't help. Making yy the subject of x=cy+dx = cy + d gives the same line, which still minimises horizontal distances. It is not the line of yy on xx.

Two regression linesDrag the ringed point or use the sliders
12345671234567y on x (solid)x on y (dashed)small ring: (x̄, ȳ)
6.0
1.0

Mean point (x̄, ȳ) = (3.20, 3.00)

y on x: y = −0.2x + 3.65

x on y: x = −0.3y + 4.1

Pearson's r = −0.247 (y on x: y = −0.2x + 3.65; x on y: x = −0.3y + 4.1)

Use the y on x line to predict y from a given x, and the x on y line to predict x from a given y. Both pass through (x̄, ȳ), and they coincide only when r = ±1.

The ringed point starts far off the trend, so r≈−0.25r \approx -0.25 and the lines cross at a wide angle. Drag it up to (5,6)(5, 6): rr rises to 0.90.9 and the lines close up. The weaker the correlation, the more their predictions differ. They are one line only when r=±1r = \pm 1.

Worked exampleFor the eight trees above, the regression line of yy on xx is y≈1.72x+50.7y \approx 1.72x + 50.7. (a) Estimate the circumference of a 2020-year-old tree. (b) A student makes yy the subject of the line of xx on yy instead. Find the student's estimate, and explain why the method is not appropriate. Give your answers to 3 s.f.

Try it first, then reveal one step at a time.

  1. (a) You know x=20x = 20 and want yy, so use the line of yy on xx. Run the regression with the ages in the X list, then use the stored values: y=1.7197…×20+50.659…=85.054…≈85.1y = 1.7197\ldots \times 20 + 50.659\ldots = 85.054\ldots \approx 85.1 cm.
Worked exampleFor 3535 gardens, xx is the lawn area in m2\text{m}^{2} and yy is the water used in litres per week. The regression line of yy on xx is y=0.6x+26y = 0.6x + 26. The regression line of xx on yy is x=1.25y−22.5x = 1.25y - 22.5. (a) Estimate the water used by a garden with a 30 m230\text{ m}^{2} lawn. (b) Estimate the lawn area of a garden that uses 6060 litres per week.

Try it first, then reveal one step at a time.

  1. (a) You know xx and want yy: use the line of yy on xx. y=0.6×30+26=18+26=44y = 0.6 \times 30 + 26 = 18 + 26 = 44 litres per week.
Check yourself
For the household, y=30−0.8xy = 30 - 0.8x is the line of yy on xx and x=31.2−0.9yx = 31.2 - 0.9y is the line of xx on yy. Estimate the electricity use, in kWh, on a day with mean temperature 1010 °C. Give your answer to 3 s.f.
Check yourself
The tree data had ages from 1212 to 6363 years and circumferences from 6262 to 168168 cm. For which estimate is the line of xx on yy the right, reliable tool?

Where the two lines meet

Both regression lines pass through the (xˉ,yˉ)(\bar{x}, \bar{y}). So that is where they cross.

Worked exampleFor a set of bivariate data, the regression line of yy on xx is y=0.5x+13y = 0.5x + 13. The regression line of xx on yy is x=1.2y−10x = 1.2y - 10. Find xˉ\bar{x} and yˉ\bar{y}.

Try it first, then reveal one step at a time.

  1. The point (xˉ,yˉ)(\bar{x}, \bar{y}) lies on each line, so its coordinates satisfy both equations at once.
Worked exampleFive pairs of data have yy-values 15,17,21,33,3415, 17, 21, 33, 34 and xˉ=16\bar{x} = 16. Their line of xx on yy has equation x=0.75y+dx = 0.75y + d. (a) Find dd. (b) Estimate xx when y=30y = 30.

Try it first, then reveal one step at a time.

  1. First find yˉ=15+17+21+33+345=1205=24\bar{y} = \frac{15 + 17 + 21 + 33 + 34}{5} = \frac{120}{5} = 24.
Check yourself
The regression line of yy on xx is y=0.4x+9y = 0.4x + 9, and the regression line of xx on yy is x=2y−14x = 2y - 14. Find xˉ\bar{x}.
Check yourself
The regression line of xx on yy is x=1.5y+dx = 1.5y + d, and the mean point is (40,22)(40, 22). Find dd.

Common mistakes

  • Rearranging the line of yy on xx to predict xx, or the line of xx on yy to predict yy. Each line predicts only the variable on its left, so use the other line.
  • Entering the lists in the usual order. For the line of xx on yy, the yy-values go in the X list.
  • Mixing up the constants. Write the line out in full, such as x=0.440y−13.4x = 0.440y - 13.4, so it is clear which number multiplies yy.
  • Rounding cc and dd before predicting. Use the stored values and round only the answer.
  • Commenting only on rr when asked about reliability. Also check that the given value is inside the range of the data.

Exam tips

  • Find the regression line of xx on yy: write the whole equation, with xx on the left and constants to 3 s.f.
  • Give a reason a method is not appropriate: say which variable the line was built to predict, and that the question predicts the other one.
  • Find the means from two regression lines: both pass through (xˉ,yˉ)(\bar{x}, \bar{y}), so show the simultaneous equations you solve.
  • Estimate on Paper 2: write the substitution with the stored values first. The method mark depends on it.

Key takeaways

Learn thisThe line of xx on yy, x=cy+dx = cy + d, minimises squared horizontal distances. Use it to predict xx from yy.
Learn thisOn your GDC, put the yy-values in the X list and the xx-values in the Y list.
Learn thisA line of xx on yy can't reliably predict yy from xx: use the line of yy on xx. Never rearrange one line to predict the other variable.
Learn thisBoth lines go through (xˉ,yˉ)(\bar{x}, \bar{y}): solving the two equations together gives the means. They are one line only if r=±1r = \pm 1.
Learn thisTrust a prediction only with strong correlation and a given value inside the range of the data. For a line of xx on yy, check the yy data.

Practise this

5 past-paper questions on 4.10 in the AA HL bank, each with a mark scheme and a worked explanation.

Practise 4.10 →