4.10 Regression line of x on y

4.10 Regression line of x on y

IB Maths: Analysis and Approaches HL: 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 are there two regression lines?

One minimises vertical distances to predict yy; the other minimises horizontal distances to predict xx.

The regression line of yy on xx is the least squares line that minimises the squared vertical distances from the points. It predicts yy from a given xx.

The regression line of xx on yy, written x=cy+dx=cy+d, minimises the squared horizontal distances. It predicts xx from a given yy.

The lines differ unless the correlation is perfect (r=±1r=\pm1); the weaker the correlation, the further apart they are. Ask 'which variable am I predicting?' That variable goes on the left of the line you use.

2468101214161820102030405060xy(10, 30)y on x: y = 2x + 10x on y: x = 0.4y − 2
Both lines pass through (10, 30); x = 0.4y − 2 is drawn as y = 2.5x + 5

You want to predict x from a given value of y. Which line do you use?

Finding the x on y line

Swap the lists on the GDC so yy is the independent list, then rewrite the result as x=cy+dx=cy+d.

On a GDC, enter the data in two lists and run linear regression with the lists swapped: yy as the independent variable and xx as the dependent list. 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, the calculator 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 significant figures, but keep full accuracy in the calculator for predictions.

  1. 1

    Enter the data

    two lists, x and y

  2. 2

    Swap the lists

    y independent, x dependent

  3. 3

    Run linear regression

    read the coefficients

  4. 4

    Rewrite

    as x = cy + d

The x on y line on a 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 and predict xx when y=14y=14.

When finding the x on y line on a GDC, which list is the independent list?

The mean point

Both pass through the mean point (xˉ,yˉ)(\bar{x},\bar{y}), so they intersect there.

Every least squares regression line passes through the mean point. So:

  • the two lines intersect at the mean point, and solving them 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, for example 5+9+p+16+205=12\frac{5+9+p+16+20}{5}=12 gives p=10p=10.

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

2468101214161820102030405060xymean point (10, 30)y on xx on y
The regression lines y=2x+10y=2x+10 and x=0.4y−2x=0.4y-2 (that is y=2.5x+5y=2.5x+5) cross at the mean point.
  • Both lines pass through(xˉ,yˉ)(\bar{x},\bar{y})
  • Solve simultaneouslyto find xˉ\bar{x} and yˉ\bar{y}

Worked example

The regression lines are y=2x+10y=2x+10 and x=0.4y−2x=0.4y-2. Find the mean point.

xˉ=4\bar{x}=4 and the yy on xx line is y=2x+3y=2x+3. What is yˉ\bar{y}?

Prediction and reliability

When you use the correct line, the correlation is strong and the value lies within the data range.

A prediction is more reliable when the correct line is used (xx on yy to predict xx), the correlation is strong (∣r∣|r| close to 1), and the given value lies within the range of the data (interpolation).

Predicting outside the range is extrapolation; the pattern may not continue. If the reaction times run from 248 ms to 305 ms, estimating sleep for 340 ms is extrapolation.

A strong correlation does not rescue an extrapolation. In an exam comment, refer to both rr and the range of the data.

240250260270280290300310320330340350248305340: extrapolation

Reliable

  • Correct line used
  • Strong correlation, |r| near 1
  • Inside the data range

Unreliable

  • Wrong line used
  • Weak correlation
  • Outside the data range

The reaction times in the data run from 248 ms to 305 ms. Which given value is interpolation?

Try an exam question

The regression line of yy on xx is y=2x+10y=2x+10 and the regression line of xx on yy is x=0.4y−2x=0.4y-2. The yy-values in the data range from 20 to 50 and r=0.95r=0.95. (a) Find the mean point. (b) Use the appropriate line to estimate xx when y=40y=40. (c) Comment on the reliability of this estimate.

[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