Statistics · Regression and Correlation · Year 2

Measuring Correlation

A single number, from -1 to 1, that says how closely two variables follow a straight line.

7 min read 1 worked example

The product moment correlation coefficient

The product moment correlation coefficient (PMCC), denoted $r$, is a single number that measures the strength and direction of linear correlation between two variables. It always satisfies $-1\le r\le1$.

  • $r=1$: perfect positive linear correlation — every point lies exactly on a line sloping upward.
  • $r=-1$: perfect negative linear correlation — every point lies exactly on a line sloping downward.
  • The closer $r$ is to $-1$ or $1$, the stronger the correlation.
  • $r=0$, or close to $0$, means no linear correlation — though a strong non-linear relationship could still be present.
r = -1 r = -0.8 r = 0 r = 0.3 r = 1
As $r$ moves away from $0$ towards $\pm1$, the points sit closer to a straight line. A line is drawn through the first, second, fourth and fifth panels because a linear pattern genuinely exists there; the $r=0$ panel has no such line, since the points show no linear trend at all.
r measures linear correlation only

A scatter diagram can show an unmistakable curved pattern — points tracing a perfect parabola, say — and still have $r$ close to $0$. The PMCC only ever asks "how close to a straight line", never "is there a relationship at all". This is exactly why the coding from the previous lesson exists: turning a curved relationship into a linear one first lets $r$ actually detect it.

Calculating r

The PMCC has a formula built from sums of squares and cross-products, but in practice you almost never compute it from that formula directly — scientific and statistical calculators compute $r$ straight from a list of paired $(x,y)$ data, the same way they compute a regression line.

Calculator

Enter the bivariate data into your calculator's statistics mode (the same mode used for the regression line), and read $r$ directly from its output — this is the expected method in the exam, and no working is required beyond stating the value.

Worked example

Windspeed and gust strength
From the large data set, the daily mean windspeed, $w$ knots, and the daily maximum gust, $g$ knots, were recorded for the first 10 days of September in Hurn in 1987.
Day12345678910
$w$4487121234710
$g$13121923333710n/an/a23

a — State the meaning of n/a in the table

1
Data on the daily maximum gust was not recorded (or not available) for those two days.
n/a means missing data, not a gust of zero.

b — Calculate r for the remaining 8 days, and comment on the suitability of a linear regression model

MethodDiscard incomplete pairs, then use the calculator
1
Remove days 8 and 9, leaving 8 complete pairs of $(w,g)$.
A day with a missing g-value can't contribute to a correlation between w and g.
2
Entering the 8 pairs into a calculator: $r=0.9533$ (4 s.f.).
Direct calculator output.
3
$r$ is close to $1$, so there is strong positive correlation — the points lie close to a straight line, so a linear regression model is suitable.
Interpreting the value in context.
▪ concluded
Common mistake

Never silently substitute a missing value with $0$ or an average — incomplete pairs are removed from the calculation entirely, and any comment about a "day" always refers to the original numbering, even after some days have been dropped.

Check yourself

A sample of 12 paired observations gives $r=-0.12$. Describe, in context, what this value suggests about the linear correlation between the two variables — and explain why it would be wrong to conclude there is "no relationship" between them.

1
$r=-0.12$ is very close to $0$, so there is very weak (almost no) linear correlation between the variables.
2
This does not rule out a relationship altogether — a strong non-linear (e.g. curved) relationship could exist between the variables while still producing an $r$ close to $0$, since $r$ only ever measures closeness to a straight line.