4.4 Correlation and linear regression

4.4 Correlation and linear regression

IB Maths: Applications and Interpretation SL: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Correlation describes linear association: positive, negative or zero, and strong or weak.
  • Pearson's rr lies between −1-1 and 11; it only measures linear correlation.
  • Correlation does not imply causation; a third variable may explain it.
  • The regression line y=ax+by=ax+b passes through (xˉ,yˉ)(\bar{x},\bar{y}); aa is the change in yy per unit of xx.
  • Prediction inside the data range is interpolation; outside is unreliable extrapolation.

Scatter diagrams and correlation

Correlation describes the direction and strength of the linear association between two variables.

Bivariate data are pairs (x,y)(x,y), plotted as a scatter diagram. Correlation describes the linear association: positive, negative or zero.

It is strong if the points lie close to a straight line and weak if widely scattered. A curved pattern can be strong without being linear.

Take x=1,…,6x=1,\dots,6 and y=3,5,4,7,8,9y=3,5,4,7,8,9: the points rise with xx, a strong positive correlation.

Positive

As x increases, y:
Tends to increase
Example:
Revision time and score

Negative

As x increases, y:
Tends to decrease
Example:
Age of a car and value

Zero

As x increases, y:
No linear pattern
Example:
Shoe size and score
xyOXYABCDEF
Scatter diagram of the six points (1,3), (2,5), (3,4), (4,7), (5,8), (6,9). They rise with x: strong positive correlation.

As xx increases, yy tends to decrease. What correlation is this?

Pearson's coefficient

Pearson's rr measures the strength and direction of linear correlation, between −1-1 and 11.

Pearson's product-moment correlation coefficient rr satisfies −1≤r≤1-1\le r\le1. r=1r=1 is perfect positive, r=−1r=-1 perfect negative and r=0r=0 no linear correlation. As a guide, ∣r∣|r| near 11 is strong, about 0.50.5 moderate and near 00 weak.

Use your GDC. If ∣r∣|r| exceeds the critical value for the sample size, the correlation is significant.

For the data above, r=0.949r=0.949: strong positive linear correlation. A strong curve can still give rr near 00.

−1−0.8−0.6−0.4−0.200.20.40.60.81-1 perfect negative0 noner = 0.9491 perfect positive

Which value of rr shows the strongest linear correlation?

Correlation and causation

No: a strong correlation shows association only, and a third variable or coincidence may explain it.

Correlation does not imply causation. Two variables may move together because of a third variable (ice-cream sales and sunburn both rise in hot weather), or by coincidence.

A causal claim needs more evidence than a high rr. When asked to comment, say the data show an association and name a plausible third variable if you can.

  1. 1

    Hot weather

    the hidden cause

  2. 2

    More ice cream sold

    and more sunburn

  3. 3

    Strong correlation

    but neither causes the other

A third variable at work

Shoe size and reading score are strongly correlated in primary pupils. Best comment?

Regression line

The regression line of yy on xx is the best-fit line; its gradient and intercept have a meaning in context.

Draw a line of best fit by eye with about half the points each side, through the mean point (xˉ,yˉ)(\bar{x},\bar{y}). For the data above the mean point is (3.5,6)(3.5,6).

The regression line of yy on xx, y=ax+by=ax+b, comes from your GDC. It minimises the squares of the vertical distances and passes through (xˉ,yˉ)(\bar{x},\bar{y}).

  • aa is the average change in yy per unit increase in xx
  • bb is the predicted yy when x=0x=0 (it may make no sense if 00 is outside the data)

Here y=1.2x+1.8y=1.2x+1.8, so each extra unit of xx goes with 1.21.2 more units of yy. Check: 1.2(3.5)+1.8=61.2(3.5)+1.8=6.

1234567246810xy(1, 3)(6, 9)mean point (3.5, 6)y = 1.2x + 1.8
The regression line y = 1.2x + 1.8 passes through the mean point (3.5, 6), between the first and last data points.

In y=1.2x+1.8y=1.2x+1.8, what does 1.2 mean?

Prediction

Predictions inside the range of the data are reasonably reliable; outside it they are not.

Predict yy by substituting xx into the regression line.

A prediction within the data range is interpolation and is reasonably reliable if ∣r∣|r| is high. A prediction outside the range is extrapolation and is unreliable: the trend may not continue.

The line of yy on xx is for predicting yy from xx. To estimate xx from a given yy, use the regression line of xx on yy.

246810121424681012141618xy(4.5, 7.2)(12, 16.2)y = 1.2x + 1.8
Inside the data (1 to 6) the prediction is interpolation; x = 12 is extrapolation.

Worked example

Use y=1.2x+1.8y=1.2x+1.8 (data for x=1x=1 to 66) to predict yy when x=4.5x=4.5 and when x=12x=12. Comment on each.

Data cover x=1x=1 to 66. Predicting at x=20x=20 is...

Try an exam question

For x=1,…,6x=1,\dots,6 the regression line of yy on xx is y=1.2x+1.8y=1.2x+1.8 and r=0.949r=0.949. Interpret the gradient, predict yy when x=3x=3, and comment on the reliability of a prediction at x=12x=12.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Which best describes the correlation between TT and nn?

1 mark, marked against the mark scheme

Revision notes