4.4 Correlation and regression of y on x

4.4 Correlation and regression of y on x

IB Maths: Analysis and Approaches SL: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Use technology for rr and for the line y=ax+by=ax+b.
  • Describe correlation by direction (positive or negative) and strength (strong or weak), in context.
  • rr measures linear correlation only; correlation does not imply causation.
  • The line passes through (xˉ,yˉ)(\bar x,\bar y).
  • Interpret aa as the change per unit of xx and bb as the value at x=0x=0.
  • Predict yy from xx only, and avoid extrapolation.

Scatter diagrams

A scatter diagram of paired data shows the direction and strength of any linear pattern.

Bivariate data are pairs (x,y)(x,y) measured on the same items. Positive correlation: yy tends to increase with xx. Negative correlation: yy tends to decrease. Zero correlation: no linear pattern. It is strong when points lie close to a line, weak when scattered.

A line of best fit by eye should pass through the mean point (xˉ,yˉ)(\bar x,\bar y) with roughly equal numbers of points on each side.

123456789123456xymean point (4.5, 3.3)line of best fit
A line of best fit passes through the mean point (4.5, 3.3).

As the temperature rises, fewer people buy hot soup. What type of correlation is this?

Pearson's r

rr lies between −1-1 and 11; its sign gives the direction and its size the strength of the linear relationship.

Pearson's product-moment correlation coefficient rr is found with technology. rr near 11 is strong positive; near −1-1 strong negative; near 00 little or no linear correlation. When a critical value is given, the correlation is significant if ∣r∣|r| is larger than it.

Points on a curve can give a small rr even though xx and yy are closely related.

A strong positive correlation, r close to 1: points lie close to a rising line of best fit (illustrative values).

Strong

  • ∣r∣≥0.75|r|\ge0.75

Moderate

  • 0.5≤∣r∣<0.750.5\le|r|<0.75

Weak

  • 0.25≤∣r∣<0.50.25\le|r|<0.5

Little or none

  • ∣r∣<0.25|r|<0.25

Which value of rr shows the strongest linear relationship?

Correlation is not causation

A strong correlation shows two variables move together, not that one causes the other.

The link may come from a third variable affecting both: hot weather increases both ice cream sales and sunburn. Or it may be a coincidence. In an exam comment, say correlation does not imply causation and name a plausible third factor in context.

  1. 1

    Hot weather

    the third variable

  2. 2

    Affects both

    more ice cream bought, more sunburn

  3. 3

    Ice cream sales and sunburn rise together

    strong correlation

  4. 4

    Not causation

    ice cream does not cause sunburn

A third variable can explain a correlation.

Ice cream sales and sunburn cases are strongly correlated. Which is the best comment?

The regression line of y on x

The line y=ax+by=ax+b is found with technology, passes through (xˉ,yˉ)(\bar x,\bar y), and its coefficients have meanings in context.

It minimises the sum of the squared vertical distances from the points. The gradient aa is the change in yy for each increase of 1 in xx; the yy-intercept bb is the predicted yy at x=0x=0, meaningful only if x=0x=0 makes sense and is near the data.

For price against age, y=−1850x+21400y=-1850x+21400: the price falls by about 1850 dollars per year of age. Use unrounded values for later predictions.

12345678910500010000150002000025000xy(0, 21400)(4, 14000)y = −1850x + 21400
Price against age: the gradient is the fall in price per year.

Worked example

A car price (dollars) against age xx in years has regression line y=−1850x+21400y=-1850x+21400. Predict the price at 4 years and interpret the gradient.

In y=−1850x+21400y=-1850x+21400, what does 21400 represent?

Predicting safely

Interpolation inside the data range is reliable for strong correlation; extrapolation outside it is not.

A line predicting a revision score of 130 out of 100 shows why extrapolation fails. A yy on xx line should only predict yy from xx: rearranging it to predict xx is not valid. A prediction is also unreliable if ∣r∣|r| is small.

24681012141620406080100120140xymaximum 100130: impossibley = 8x + 20
Illustrative: data cover 2 to 8 hours. Extrapolating the line to 13.75 hours predicts 130, above the maximum of 100.

Interpolation

  • xx inside the data range
  • Reliable if correlation is strong

Extrapolation

  • xx outside the data range
  • Unreliable: the pattern may not continue

A regression line is based on data with xx from 10 to 60. Which prediction is least reliable?

Try an exam question

The regression line of mark yy on revision hours xx is y=2.4x+15y=2.4x+15, based on data with xx between 2 and 10. (a) Interpret the gradient. (b) Predict the mark for x=6x=6. (c) Comment on using the line for x=40x=40.

[3 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Use the regression line to estimate the selling price of a 5-year-old car.

1 mark, marked against the mark scheme

Revision notes