4.4 Correlation and regression of y on x

4.4 Correlation and regression of y on x

IB Maths: Analysis and Approaches HL: 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 regression line passes through (xˉ,yˉ)(\bar{x},\bar{y}), so substitute xˉ\bar{x} to get yˉ\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

The direction and strength of the relationship between two variables.

Bivariate data are pairs (x,y)(x,y) measured on the same items. A scatter diagram can show positive correlation, negative correlation, or none. Correlation is strong when points lie close to a straight line and 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.

1234567891012345678xymean point (x̄, ȳ)line of best fit
A line of best fit passes through the mean point.

Positive

  • y tends to increase as x increases

Negative

  • y tends to decrease as x increases

Zero

  • No linear pattern

A scatter diagram shows points tightly clustered round a line sloping downwards. How is the correlation described?

Pearson's correlation coefficient

rr measures the strength and direction of a linear relationship, from −1-1 to 11.

Pearson's product-moment correlation coefficient rr measures the strength and direction of a linear relationship. It is found with technology and satisfies −1≤r≤1-1\le r\le1.

  • rr close to 1: strong positive linear correlation; close to −1-1: strong negative.
  • rr close to 0: little or no linear correlation.

When a question gives a critical value, the correlation is significant if ∣r∣|r| is larger than it. rr is only meaningful for linear relationships.

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
−3−2−1123246810xyy = x²
On y = x² with x symmetric about 0, r = 0 despite a perfect relationship.

A set of data has r=−0.82r=-0.82. What does this show?

Correlation is not causation

No: the variables may both depend on a third variable, or the link may be a coincidence.

A strong correlation shows that 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 be a coincidence.

In exam comments, say correlation does not imply causation and name a plausible third factor in context.

  1. 1

    Hot weather

    the third variable

  2. 2

    More ice cream sold

    one effect

  3. 3

    More sunburn

    another effect, so the two correlate

A third variable at work

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

The regression line of y on x

The line y=ax+by=ax+b passes through (xˉ,yˉ)(\bar{x},\bar{y}); aa is the change per unit of xx and bb the value at x=0x=0.

The regression line of yy on xx, y=ax+by=ax+b, is found with technology: it minimises the sum of squared vertical distances to the points. It always passes through (xˉ,yˉ)(\bar{x},\bar{y}).

  • aa (the gradient) is the change in yy per 1 increase in xx. For y=−1850x+21400y=-1850x+21400 (price against age), the price falls by about 1850 dollars per year.
  • bb (the yy-intercept) is the predicted yy when x=0x=0; only meaningful if that makes sense.

Give coefficients to 3 s.f., but use unrounded values for later predictions.

12345678910500010000150002000025000xy(4, 14 000)y = −1850x + 21400
A 4-year-old car is predicted to cost 14 000 dollars.

Worked example

A car's price in dollars is modelled by y=−1850x+21400y=-1850x+21400, where xx is its age in years. Predict the price of a 4-year-old car and interpret the gradient.

The regression line of yy on xx is y=2.4x+5y=2.4x+5 and xˉ=10\bar{x}=10. What is yˉ\bar{y}?

Making predictions safely

Inside the data range with a strong correlation; never outside it, and never to predict xx from yy.

Interpolation predicts inside the data range and is reliable if the correlation is strong. Extrapolation predicts outside it and is unreliable, because the linear pattern may not continue (a revision line predicting 130 out of 100 is an obvious example).

A yy on xx line should only be used to predict yy from xx. Rearranging it to predict xx from yy is not valid. A prediction is also unreliable if ∣r∣|r| is small.

2468101220406080100120140xymaximum markextrapolated: 130y = 40 + 9x
Revision hours against mark (illustrative). 1 to 6 hours is interpolation; at 10 hours the line predicts 130, above the maximum of 100.

Interpolation

Where:
Inside the data range
Reliability:
Reliable if correlation is strong

Extrapolation

Where:
Outside the data range
Reliability:
Unreliable: pattern may not continue

Data for x between 5 and 20 give a strong correlation. Which prediction is most reliable?

Try an exam question

For data with xx between 5 and 20, the regression line of yy on xx is y=2.4x+5y=2.4x+5, the mean of xx is 10 and r=0.91r=0.91. (a) Describe the correlation. (b) Find the mean of yy. (c) Explain why using the line to predict yy when x=50x=50 is unreliable.

[4 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