Correlation and regression · Grade 12

In Grade 12 you get fluent with: the correlation coefficient.

The product moment correlation coefficient r measures how closely points lie to a straight line. It goes from −1 (perfect negative) through 0 (none) to +1 (perfect positive). The least squares regression line y = a + bx is the best straight line for predicting y from x.

Key facts

  • Sxx = Σx² − ((Σx)²)/n, Syy = Σy² − ((Σy)²)/n, Sxy = Σxy − ((Σx)(Σy))/n.
  • r = Sxy ÷ √(Sxx × Syy). It is always between −1 and 1.
  • Regression line of y on x: b = Sxy/Sxx and a = ȳ − bx̄.
  • The regression line always passes through the mean point (x̄, ȳ).
  • b is the change in y for each extra unit of x. a is the value of y when x = 0.
  • Use the line of y on x to predict y from x, and only within the range of the data.
  • Changing units (linear coding with positive multipliers) does not change r.

Worked examples

Example 1

The correlation coefficient between hours of daylight and heating costs is r = −0.92. Describe the correlation.

Answer: Strong negative correlation

Example 2

Find the regression line of y on x for x: 1, 2, 3, 4, 5 and y: 3, 5, 4, 7, 8.

Answer: y = 1.8 + 1.2x

Example 3

For the same data, find the product moment correlation coefficient.

Answer: r = 0.915

Other years