4.10 Regression line of x on y

4.10 Regression line of x on y

IB Maths: Analysis and Approaches SL: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • yy on xx predicts yy from xx; xx on yy predicts xx from yy. Never swap them.
  • Find x=cy+dx=cy+d on the GDC with yy as the independent list; do not rearrange the yy on xx line.
  • Both lines pass through (xˉ,yˉ)(\bar x,\bar y), so they intersect there.
  • The lines are the same only when r=±1r=\pm1.
  • Predictions are reliable only with strong correlation and interpolation.

Why two regression lines?

yy on xx minimises vertical distances and predicts yy; xx on yy minimises horizontal distances and predicts xx.

The regression line of yy on xx minimises the squared vertical distances. The regression line of xx on yy, x=cy+dx=cy+d, minimises the squared horizontal distances. The lines differ unless r=±1r=\pm1; the weaker the correlation, the further apart they are.

So an xx on yy line cannot reliably predict yy from xx, and vice versa. Ask: which variable am I predicting? It goes on the left of the line you use.

45678910200220240260280300320340xymean point (6.89, 277)y on x: y = −13.3x + 369x on y: x = −0.0624y + 24.2
Two lines for the same data, crossing at the mean point.

You want to predict xx from a given yy. Which line do you use?

Finding the x on y line

Run linear regression with the lists swapped: yy independent, xx dependent.

The calculator returns an equation in its own letters; rewrite it as x=cy+dx=cy+d. For sleep xx hours and reaction time yy ms, it gives x=−0.0624y+24.2x=-0.0624y+24.2, while the yy on xx line is y=−13.3x+369y=-13.3x+369. Give coefficients to 3 s.f., but keep full accuracy for predictions.

  1. 1

    Enter the data in two lists

    xx values and yy values

  2. 2

    Swap the roles

    yy independent, xx dependent

  3. 3

    Run linear regression

    Read the slope and intercept

  4. 4

    Rewrite

    As x=cy+dx=cy+d

On the GDC

Worked example

Data: (2,5),(4,9),(6,10),(8,16),(10,20)(2,5),(4,9),(6,10),(8,16),(10,20). Find the xx on yy line.

On the GDC, which list is the independent (explanatory) list for the xx on yy line?

The mean point

Both least squares lines pass through the mean point (xˉ,yˉ)(\bar x,\bar y), so they intersect there.

So solving the two equations simultaneously gives xˉ\bar x and yˉ\bar y. If you know one mean and one line, substitute to find the other mean. An unknown data value can be found from a given mean: 5+9+p+16+205=12\frac{5+9+p+16+20}{5}=12 gives p=10p=10.

To verify that a line passes through the mean point, substitute one mean and show you get the other.

12345678910246810xy(x̄, ȳ)y on xx on y
Illustrative regression lines of y on x and of x on y: both pass through the mean point (x̄, ȳ) = (5, 6).
  • Both lines pass through(xˉ,yˉ)(\bar x,\bar y)
  • Solve simultaneouslyto find xˉ\bar x and yˉ\bar y

Worked example

The yy on xx line is y=2x+10y=2x+10 and the xx on yy line is x=0.4y−2x=0.4y-2. Find the mean point.

Two regression lines meet at (8,20)(8, 20). What is yˉ\bar y?

Prediction and reliability

A prediction is reliable when the correct line is used, the correlation is strong and the value lies inside the data range.

Predicting outside the data range is extrapolation: the pattern may not continue. For example, reaction times in the data run from 248 ms to 305 ms, so estimating sleep for 340 ms is extrapolation. In an exam comment, refer to both rr and the range of the data. A strong correlation does not rescue an extrapolation.

  1. 1

    Correct line

    xx on yy to predict xx

  2. 2

    Strong correlation

    ∣r∣|r| close to 1

  3. 3

    Interpolation

    The given value is within the range of its own variable

Three conditions

Reaction times in the data run from 248 ms to 305 ms. You use the xx on yy line for y=340y=340. What is this?

Try an exam question

The regression line of yy on xx is y=−1.5x+30y=-1.5x+30 and the regression line of xx on yy is x=−0.4y+16x=-0.4y+16. (a) Find the mean point (xˉ,yˉ)(\bar x,\bar y). (b) State which line should be used to estimate xx when y=18y=18.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find the mean point (xˉ,yˉ)(\bar{x},\bar{y}) of the data.

1 mark, marked against the mark scheme

Revision notes