, as you scroll — highermaths.org highermaths.org read instead ›

Regression and correlation

Sunny days, busy kiosk. How strong is the link?

A scatter diagram shows a pattern. One number measures how closely the points follow a straight line, and a test decides whether the pattern is more than chance.

scroll ↓

Eight days

A kiosk records the hours of sunshine xx and the ice creams sold yy on eight days. The points rise from left to right, not perfectly, but clearly.

Four quadrants

Cross the plot at the means, xˉ=5.5\bar x = 5.5 and yˉ=50.5\bar y = 50.5. A point above and right of centre, or below and left, has (x−xˉ)(y−yˉ)>0(x - \bar x)(y - \bar y) > 0: it pulls towards positive correlation. Six points do; the two in the other quadrants sit close to the centre and pull only a little.

r = 0.915

The product moment correlation coefficient scales the sum of those products to lie between −1-1 and 11. At 0.9150.915 it is close to 11: strong positive linear correlation. A calculator gives it directly from the data.

More than chance?

Test H0:ρ=0H_0: \rho = 0 against H1:ρ>0H_1: \rho > 0 at the 1% level. For n=8n = 8 the critical value is 0.78870.7887: the shaded region. 0.9150.915 lands inside it, so reject H0H_0. There is evidence of positive correlation between sunshine and sales.

Chapter 1

A number for the pattern. A test for the population.

Two-tailed tests, p-values, what r can and can't tell you, straightening exponential and power curves with logarithms, and twelve graded exam questions with full worked solutions are waiting.