Note AcademyNote Academy

Mathematics YMA01 · Chapter 29

Correlation and regression

Scatter diagrams, explanatory and response variables, the least squares regression line, interpreting its gradient and intercept, and the product moment correlation coefficient.

Written for the 2018 specification syllabus · 5 min read

Download this chapter (PDF)

Correlation and regression

Scatter diagrams

A scatter diagram plots pairs of values (x,y)(x, y) for two variables. Correlation describes the pattern.

  • Positive correlation: yy tends to increase as xx increases.
  • Negative correlation: yy tends to decrease as xx increases.
  • No correlation: no pattern.

The nearer the points are to a straight line, the stronger the correlation.

Explanatory and response variables

The explanatory (independent) variable xx is the one that is controlled, or is used to explain the other. The response (dependent) variable yy is the one that is measured or predicted. On a scatter diagram the explanatory variable goes on the horizontal axis.

Hours of revision is the explanatory variable xx, and the score is the response variable yy.

Summary values

For nn pairs of values, the regression and correlation formulae use

Sxx=∑x2−(∑x)2n,Syy=∑y2−(∑y)2n,Sxy=∑xy−∑x∑ynS_{xx} = \sum x^2 - \frac{(\sum x)^2}{n}, \qquad S_{yy} = \sum y^2 - \frac{(\sum y)^2}{n}, \qquad S_{xy} = \sum xy - \frac{\sum x \sum y}{n}

The regression line

The least squares regression line of yy on xx is the straight line y=a+bxy = a + bx that makes the sum of the squares of the vertical distances from the points as small as possible.

b=SxySxx,a=yˉ−bxˉb = \frac{S_{xy}}{S_{xx}}, \qquad a = \bar{y} - b\bar{x}

The line always passes through (xˉ,yˉ)(\bar{x}, \bar{y}).

Sxx=240−4028=40,Sxy=520−40×968=40S_{xx} = 240 - \frac{40^2}{8} = 40, \qquad S_{xy} = 520 - \frac{40 \times 96}{8} = 40

b=4040=1,xˉ=5,yˉ=12,a=12−1×5=7b = \frac{40}{40} = 1, \qquad \bar{x} = 5, \quad \bar{y} = 12, \qquad a = 12 - 1 \times 5 = 7

The line is y=7+xy = 7 + x.

Interpreting the line

  • The gradient bb is the change in yy for each increase of 1 in xx.
  • The intercept aa is the predicted value of yy when x=0x = 0. It may have no meaning if x=0x = 0 is outside the data.

The score is predicted to rise by 1 mark for each extra hour of revision. With no revision the predicted score is 7.

Using the line to predict

Substitute a value of xx to predict yy.

  • Interpolation predicts inside the range of the data and is usually reliable.
  • Extrapolation predicts outside the range and is less reliable, because the pattern may not continue.

Product moment correlation coefficient

The product moment correlation coefficient rr measures how close the points are to a straight line:

r=SxySxxSyyr = \frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}

It always lies between −1-1 and 11.

Value of rrMeaning
r=1r = 1All points on a straight line with positive gradient
rr near 11Strong positive linear correlation
rr near 00Little or no linear correlation
rr near −1-1Strong negative linear correlation
r=−1r = -1All points on a straight line with negative gradient

Syy=1260−9628=108,r=4040×108=4065.7=0.609S_{yy} = 1260 - \frac{96^2}{8} = 108, \qquad r = \frac{40}{\sqrt{40 \times 108}} = \frac{40}{65.7} = 0.609

This shows moderate positive linear correlation.

Limitations

  • rr only measures linear correlation. A curved pattern can have rr near 0.
  • A single unusual point (an outlier) can change rr and the line a great deal.
  • A high rr does not show that xx causes yy.
  • A prediction beyond the data may not hold.
Test yourself14 flashcards on this chapter.Flashcards →

These notes are AI generated and may contain mistakes. Check them against your syllabus.