Year 2 Statistics · Chapter 1

Regression and Correlation

Specification: Edexcel Paper 3 §2.2, 5.1 — Correlation and regression  ·  AQA section L2, O1

In this chapter
  1. 1. The product moment correlation coefficient
  2. 2. Testing for correlation
  3. 3. Straightening curves
  4. Practice

Key facts — this chapter

  • The product moment correlation coefficient rr measures the strength of linear correlation in a sample. Always −1≤r≤1-1 \le r \le 1: r=1r = 1 is perfect positive linear correlation, r=−1r = -1 perfect negative, and r=0r = 0 no linear correlation.
  • Find rr with a calculator. It has no units, and it is unchanged by coding either variable with a positive scale factor.
  • To test for correlation in the population, use its correlation coefficient ρ\rho: H0:ρ=0H_0: \rho = 0 against H1:ρ>0H_1: \rho > 0 or ρ<0\rho < 0 (one-tailed) or ρ≠0\rho \ne 0 (two-tailed).
  • Compare rr with the critical value for the sample size and significance level. If rr is beyond it, in the direction of H1H_1, reject H0H_0. With a p-value, reject when the p-value is at most the significance level.
  • A model y=axny = ax^n becomes the straight line log⁡y=log⁡a+nlog⁡x\log y = \log a + n\log x. A model y=kbxy = kb^x becomes log⁡y=log⁡k+xlog⁡b\log y = \log k + x\log b.

Year 1 described correlation in words and used a regression line to make predictions. This chapter puts a number on the strength of a linear relationship, then asks the question a statistician must: is the pattern in this sample strong enough to believe it holds in the whole population? It ends by straightening curves, so that the tools of linear regression can fit exponential and power models too.

1. The product moment correlation coefficient

Four scatter diagrams in a row. The first has points close to a rising line, r = 0.95. The second rises but is widely spread, r = 0.6. The third is a shapeless cloud, r close to 0. The fourth falls from left to right, fairly tightly, r = −0.8
The closer the points lie to a straight line, the closer r is to 1 or −1. Its sign gives the direction.

Reading the coefficient

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

Why it works

r=SxySxxSyyr = \dfrac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}, where Sxy=∑(x−xˉ)(y−yˉ)S_{xy} = \sum(x - \bar x)(y - \bar y) measures how xx and yy vary together, and SxxS_{xx} and SyyS_{yy} measure how each varies on its own. Points above and to the right of (xˉ,yˉ)(\bar x, \bar y), or below and to the left, make SxyS_{xy} positive; the division scales the result to lie between −1-1 and 11.

Common mistake

rr measures linear correlation only. Points lying on a U-shaped curve can give rr near 00, even though yy depends strongly on xx. Always look at the scatter diagram before trusting rr.

Worked example 1.1 · Finding the coefficient

A kiosk records the hours of sunshine, xx, and the number of ice creams sold, yy, on eight days. Find the product moment correlation coefficient and interpret it.

xx (hours)23456789
yy (sales)3145385249635670
Sunshine and ice cream sales

The calculator’s two-variable statistics mode gives r=0.915r = 0.915 (3 s.f.).

In context

There is strong positive linear correlation between hours of sunshine and ice cream sales: sunnier days tend to bring more sales.

On your calculator

Enter the data in the two-variable statistics or linear regression mode, with xx and yy in separate columns. The results list rr alongside the coefficients aa and bb of the regression line y=a+bxy = a + bx.

2. Testing for correlation

A sample of eight days gives r=0.915r = 0.915. Would a different eight days give something similar, or could the pattern be chance? A hypothesis test decides, using the population correlation coefficient ρ\rho (the Greek letter rho).

Testing for correlation

  1. State H0:ρ=0H_0: \rho = 0 (no correlation in the population).
  2. State H1H_1: ρ>0\rho > 0 or ρ<0\rho < 0 if a direction is suggested (one-tailed), or ρ≠0\rho \ne 0 if not (two-tailed).
  3. Find the critical value for the sample size nn and the significance level. For a two-tailed test, use half the significance level in each tail.
  4. Reject H0H_0 if rr is beyond the critical value in the direction of H1H_1, and conclude in context.

The critical values come from a table in the formula booklet; questions state the ones you need. The table assumes the data come from a bivariate Normal distribution, so that both variables are roughly Normal.

Worked example 1.2 · A one-tailed test

Using the data in Example 1.1, test at the 1% level whether there is positive correlation between hours of sunshine and ice cream sales. The critical value for n=8n = 8 at 1% (one-tailed) is 0.78870.7887.


  1. H0:ρ=0H_0: \rho = 0 and H1:ρ>0H_1: \rho > 0, where ρ\rho is the population correlation coefficient.

  2. r=0.915r = 0.915, which is more than 0.78870.7887, so the result is significant: reject H0H_0.

In context

There is sufficient evidence at the 1% level of positive correlation between hours of sunshine and ice cream sales.

Common mistake

Hypotheses are about the population, so they use ρ\rho, never rr. Writing H0:r=0H_0: r = 0 loses the mark: rr is a number you calculate, and it certainly isn’t exactly 00.

Worked example 1.3 · A two-tailed test

A teacher suspects that the time students spend on social media is related to their sleep, but has no view on the direction. For a sample of 12 students, r=−0.54r = -0.54. Test at the 5% level whether there is correlation. The critical value for n=12n = 12 at 2.5% (one-tailed) is 0.57600.5760.


  1. H0:ρ=0H_0: \rho = 0 and H1:ρ≠0H_1: \rho \ne 0.

  2. Two-tailed at 5% means 2.5% in each tail, so the critical values are ±0.5760\pm 0.5760.

  3. −0.54-0.54 lies between −0.5760-0.5760 and 0.57600.5760: not significant, so do not reject H0H_0.

In context

There is insufficient evidence at the 5% level of correlation between time on social media and sleep.

Drag the points, or add and remove them. The product moment correlation coefficient r moves along the scale underneath, where the shaded part is the critical region for the test you choose. When r lands in it, the sample is evidence of correlation in the population.

Software often reports a p-value instead: the probability, if ρ=0\rho = 0, of a sample correlation at least as extreme as the one observed.

Worked example 1.4 · Using a p-value

A researcher records the daily step count and the hours of sleep of a random sample of 25 adults, and tests H0:ρ=0H_0: \rho = 0 against H1:ρ>0H_1: \rho > 0. The sample gives r=0.43r = 0.43, with a p-value of 0.0160.016. State the conclusion at the 1% level, and at the 5% level.


  1. At 1%: 0.016>0.010.016 > 0.01, so the result is not significant: do not reject H0H_0.

  2. At 5%: 0.016<0.050.016 < 0.05, so the result is significant: reject H0H_0.

In context

At the 1% level there is insufficient evidence of positive correlation between step count and sleep; at the 5% level there is sufficient evidence. The stricter the test, the stronger the evidence it demands.

Common mistake

Not rejecting H0H_0 does not prove that ρ=0\rho = 0. It means this sample isn’t strong enough evidence against it. And rejecting H0H_0 shows correlation, not causation.

3. Straightening curves

Many relationships are curved: populations grow exponentially, and areas and masses grow as powers of length. Taking logarithms turns both kinds of curve into straight lines, as in Chapter 11 of Year 1 Pure, and a straight line is something regression can fit.

Changing the variables

y=axn  ⇒  log⁡y=log⁡a+nlog⁡xy=kbx  ⇒  log⁡y=log⁡k+(log⁡b)x\begin{aligned} y = ax^n \;&\Rightarrow\; \log y = \log a + n\log x \\ y = kb^x \;&\Rightarrow\; \log y = \log k + (\log b)x \end{aligned}

For y=axny = ax^n, plot log⁡y\log y against log⁡x\log x: the gradient is nn and the intercept log⁡a\log a. For y=kbxy = kb^x, plot log⁡y\log y against xx: the gradient is log⁡b\log b and the intercept log⁡k\log k.

Two graphs side by side. On the left, data points rise along a curve that gets steeper. On the right, the same data plotted as log y against log x lie close to a straight line, with its gradient labelled n and its intercept labelled log a
Data from y = axⁿ lie on a curve; plotted as log y against log x, they lie close to a line with gradient n.

Worked example 1.5 · A power model

A student times a pendulum of length ll metres and finds its period TT seconds for several lengths. She models T=alnT = al^n. The regression line of log⁡10T\log_{10} T on log⁡10l\log_{10} l is log⁡10T=0.303+0.498log⁡10l\log_{10} T = 0.303 + 0.498\log_{10} l. Find aa and nn, and estimate the period of a pendulum 0.80.8 m long.


  1. Compare with log⁡T=log⁡a+nlog⁡l\log T = \log a + n\log l: n=0.498n = 0.498 and log⁡10a=0.303\log_{10} a = 0.303, so a=100.303=2.01a = 10^{0.303} = 2.01 (3 s.f.).

  2. The model is T=2.01 l0.498T = 2.01\,l^{0.498}, so for l=0.8l = 0.8, T=2.009…×0.80.498=1.80T = 2.009\ldots \times 0.8^{0.498} = 1.80 s (3 s.f.).

In context

T≈2.01 l0.5T \approx 2.01\,l^{0.5}: the period grows with the square root of the length, as physics predicts.

Worked example 1.6 · An exponential model

The number of bacteria NN in a culture is counted at times tt hours and modelled by N=kbtN = kb^t. The regression line of log⁡10N\log_{10} N on tt is log⁡10N=2.1+0.035t\log_{10} N = 2.1 + 0.035t. Find kk and bb, interpret them, and estimate NN when t=10t = 10.


  1. Compare with log⁡N=log⁡k+(log⁡b)t\log N = \log k + (\log b)t: log⁡10k=2.1\log_{10} k = 2.1 and log⁡10b=0.035\log_{10} b = 0.035.

  2. So k=102.1=126k = 10^{2.1} = 126 (3 s.f.) and b=100.035=1.08b = 10^{0.035} = 1.08 (3 s.f.).

  3. At t=10t = 10: log⁡10N=2.1+0.35=2.45\log_{10} N = 2.1 + 0.35 = 2.45, so N=102.45=282N = 10^{2.45} = 282 (3 s.f.).

In context

The culture starts with about 126 bacteria, and the number grows by about 8.4% each hour, since b=1.0839…b = 1.0839\ldots. After 10 hours the model predicts about 282 bacteria.

Common mistake

Keep the logarithm in the intercept. The intercept of the straight line is log⁡k\log k, not kk, so k=10interceptk = 10^{\text{intercept}}. And a model only describes the range of the data it was fitted to: estimates far outside it are extrapolation.

Practice

Twelve questions in three tiers. Try each one properly before opening the solution. The solutions show the full method, not just answers. Critical values are given in each question; logarithms are to base 10 unless a question says otherwise. Give answers to 3 significant figures where they aren’t exact.

Warm-up

1 [3 marks]

Describe the correlation shown by each value of the product moment correlation coefficient: (a) r=0.87r = 0.87, (b) r=−0.12r = -0.12, (c) r=−0.95r = -0.95.

Show solution

(a) Strong positive linear correlation. (b) Very weak negative linear correlation: essentially none. (c) Strong negative linear correlation.

2 [4 marks]

A biologist believes that taller people have longer arm spans. For a sample of 8 adults, r=0.71r = 0.71. Test her belief at the 5% level. The critical value for n=8n = 8 at 5% (one-tailed) is 0.62150.6215.

Show solution

H0:ρ=0H_0: \rho = 0 and H1:ρ>0H_1: \rho > 0, where ρ\rho is the population correlation coefficient.

0.71>0.62150.71 > 0.6215, so the result is significant: reject H0H_0. There is sufficient evidence at the 5% level of positive correlation between height and arm span.

3 [4 marks]

For a sample of 20 cars, the correlation between engine size and the number of faults reported is r=0.41r = 0.41. Test at the 5% level whether there is correlation. The critical value for n=20n = 20 at 2.5% (one-tailed) is 0.44380.4438.

Show solution

H0:ρ=0H_0: \rho = 0 and H1:ρ≠0H_1: \rho \ne 0. Two-tailed at 5%, so compare with ±0.4438\pm 0.4438.

0.41<0.44380.41 < 0.4438, so the result is not significant: do not reject H0H_0. There is insufficient evidence at the 5% level of correlation between engine size and faults.

4 [4 marks]

Write each model as a straight line, stating what to plot and the gradient and intercept: (a) y=3x2y = 3x^2, (b) y=5×2xy = 5 \times 2^x.

Show solution

(a) log⁡y=log⁡3+2log⁡x\log y = \log 3 + 2\log x: plot log⁡y\log y against log⁡x\log x. The gradient is 22 and the intercept log⁡3=0.477\log 3 = 0.477.

(b) log⁡y=log⁡5+(log⁡2)x\log y = \log 5 + (\log 2)x: plot log⁡y\log y against xx. The gradient is log⁡2=0.301\log 2 = 0.301 and the intercept log⁡5=0.699\log 5 = 0.699.

Standard

5 [6 marks]

A coach records the hours of training, xx, and a performance score, yy, for six athletes in one month.

xx (hours)121517202428
yy (score)565466617166
  1. Find the product moment correlation coefficient. [1]
  2. Test at the 5% level whether more training goes with a higher score. The critical value for n=6n = 6 at 5% (one-tailed) is 0.72930.7293. [4]
  3. The critical value at 2.5% (one-tailed) is 0.81140.8114. Would the conclusion be the same at the 2.5% level? [1]
Show solution

(a) From a calculator, r=0.751r = 0.751 (3 s.f.).

(b) H0:ρ=0H_0: \rho = 0 and H1:ρ>0H_1: \rho > 0. 0.751>0.72930.751 > 0.7293, so reject H0H_0: there is sufficient evidence at the 5% level of positive correlation between training hours and score.

(c) No: 0.751<0.81140.751 < 0.8114, so at 2.5% the result would not be significant.

6 [4 marks]

A quantity is modelled by y=axny = ax^n. The regression line of log⁡y\log y on log⁡x\log x is log⁡y=0.3+0.8log⁡x\log y = 0.3 + 0.8\log x. Find aa and nn, and estimate yy when x=20x = 20.

Show solution

n=0.8n = 0.8 and log⁡a=0.3\log a = 0.3, so a=100.3=2.00a = 10^{0.3} = 2.00 (3 s.f.).

At x=20x = 20: y=1.995…×200.8=21.9y = 1.995\ldots \times 20^{0.8} = 21.9.

7 [5 marks]

The value VV pounds of a car tt years after it was new is modelled by V=kbtV = kb^t. The regression line of log⁡V\log V on tt is log⁡V=4.2−0.06t\log V = 4.2 - 0.06t. Find kk and bb, and interpret each in context.

Show solution

log⁡k=4.2\log k = 4.2, so k=104.2=15 800k = 10^{4.2} = 15\,800 (3 s.f.): the model’s value of the car when new, about £15,800.

log⁡b=−0.06\log b = -0.06, so b=10−0.06=0.871b = 10^{-0.06} = 0.871 (3 s.f.): each year the car keeps about 87.1% of its value, losing about 12.9% a year.

8 [3 marks]

A test of H0:ρ=0H_0: \rho = 0 against H1:ρ<0H_1: \rho < 0 gives a p-value of 0.0180.018. State, with a reason, the conclusion at the 1% level and at the 5% level.

Show solution

At 1%: 0.018>0.010.018 > 0.01, so do not reject H0H_0: insufficient evidence of negative correlation.

At 5%: 0.018<0.050.018 < 0.05, so reject H0H_0: sufficient evidence of negative correlation.

9 [4 marks]
  1. A scatter diagram shows points lying close to a U-shaped curve, but r=0.02r = 0.02. Explain how both can be true. [2]
  2. After a test finds insufficient evidence of correlation, a researcher writes “this proves the two variables are not related”. Give two criticisms. [2]
Show solution

(a) rr measures linear correlation only. On a U-shape, yy falls then rises, so the linear trends cancel and rr is near 00, even though yy depends strongly on xx.

(b) Not rejecting H0H_0 is not proof that ρ=0\rho = 0: the sample may just be too small to show the correlation. And the test looks only for linear correlation, so the variables could still be related in a non-linear way.

Exam style

10 [9 marks]

A café owner records the midday temperature, xx °C, and the number of hot drinks sold, yy, on eight days.

xx (°C)4791214171922
yy (drinks)8285747964716066
  1. Find the product moment correlation coefficient. [1]
  2. Test at the 5% level whether there is correlation between temperature and hot drink sales. The critical value for n=8n = 8 at 2.5% (one-tailed) is 0.70670.7067. [4]
  3. The critical value for n=8n = 8 at 0.5% (one-tailed) is 0.83430.8343. State the conclusion of the same test at the 1% level. [2]
  4. State an assumption needed for the test to be valid. [2]
Show solution

(a) From a calculator, r=−0.826r = -0.826 (3 s.f.).

(b) H0:ρ=0H_0: \rho = 0 and H1:ρ≠0H_1: \rho \ne 0. Two-tailed at 5%, so compare with ±0.7067\pm 0.7067. −0.826<−0.7067-0.826 < -0.7067, so reject H0H_0: there is sufficient evidence at the 5% level of correlation between temperature and hot drink sales.

(c) At 1% two-tailed the critical values are ±0.8343\pm 0.8343, and −0.826-0.826 lies between them: do not reject H0H_0. There is insufficient evidence at the 1% level.

(d) The data come from a bivariate Normal distribution: temperature and sales are each roughly Normally distributed. (The eight days should also be a random sample.)

11 [8 marks]

A fisheries officer models the mass mm grams of a species of fish by m=alnm = al^n, where ll cm is its length. From fish between 10 cm and 40 cm long, the regression line of log⁡m\log m on log⁡l\log l is log⁡m=−1.9+3.05log⁡l\log m = -1.9 + 3.05\log l.

  1. Find aa and nn. [3]
  2. Estimate the mass of a fish 30 cm long. [2]
  3. Explain why nn close to 33 is reasonable. [1]
  4. Comment on using the model for a fish 80 cm long. [2]
Show solution

(a) n=3.05n = 3.05 and log⁡a=−1.9\log a = -1.9, so a=10−1.9=0.0126a = 10^{-1.9} = 0.0126 (3 s.f.).

(b) log⁡m=−1.9+3.05log⁡30=2.605…\log m = -1.9 + 3.05\log 30 = 2.605\ldots, so m=102.605…=403m = 10^{2.605\ldots} = 403 g.

(c) Mass is proportional to volume, and a fish that is twice as long is roughly twice as wide and twice as deep: the volume grows as the cube of the length.

(d) 80 cm is far outside the 10–40 cm range of the data, so this is extrapolation and the estimate is unreliable.

12 [6 marks]

A variable is modelled by y=kbxy = kb^x. Using natural logarithms, the regression line of ln⁡y\ln y on xx is ln⁡y=1.2+0.4x\ln y = 1.2 + 0.4x.

  1. Find kk and bb. [3]
  2. Estimate yy when x=5x = 5. [2]
  3. Write the model in the form y=kecxy = ke^{cx}. [1]
Show solution

(a) ln⁡k=1.2\ln k = 1.2, so k=e1.2=3.32k = e^{1.2} = 3.32 (3 s.f.). ln⁡b=0.4\ln b = 0.4, so b=e0.4=1.49b = e^{0.4} = 1.49 (3 s.f.).

(b) ln⁡y=1.2+2=3.2\ln y = 1.2 + 2 = 3.2, so y=e3.2=24.5y = e^{3.2} = 24.5.

(c) y=e1.2+0.4x=3.32e0.4xy = e^{1.2 + 0.4x} = 3.32e^{0.4x}.