πŸ”— Testing for Correlation

A Level Maths Year 2 Β· Hypothesis Testing

Level 3 · Ages 17–18

← Back to topic overview
1 Is the Correlation Real?

A sample correlation coefficient $r$ is never exactly $0$, even when two variables are completely unrelated β€” random variation always produces some apparent pattern. A hypothesis test decides whether the sample value of $r$ is far enough from $0$ to be convincing evidence of correlation in the whole population.

$r$ is the correlation coefficient of the sample. The Greek letter $\rho$ (rho) is the correlation coefficient of the population. The hypotheses are always about $\rho$, never about $r$.
Hypotheses
$\mathrm{H}_0: \rho = 0$  (no correlation in the population)
$\mathrm{H}_1: \rho > 0$  or  $\mathrm{H}_1: \rho < 0$  (one-tailed)  ·  $\mathrm{H}_1: \rho \neq 0$  (two-tailed)
The claim in the questionAlternative hypothesis
"There is positive correlation" / "$y$ tends to increase with $x$"$\mathrm{H}_1: \rho > 0$
"There is negative correlation" / "$y$ tends to decrease as $x$ increases"$\mathrm{H}_1: \rho < 0$
"There is some correlation" / "the variables are related" (no direction)$\mathrm{H}_1: \rho \neq 0$
Choose the alternative hypothesis before looking at the data. The direction comes from the claim being tested, not from the sign of $r$ you happen to get.

The general language of hypothesis testing β€” significance level, critical value, "sufficient evidence" β€” is the same as in Year 1: see The Language of Hypothesis Testing.

2 Critical Values of $r$

If $\mathrm{H}_0$ is true, the sampling distribution of $r$ depends only on the sample size $n$. From it we get a critical value: the smallest value of $|r|$ that is significant at a given level. Exams provide these in a table β€” the values below were calculated from the $t$ distribution using $r_{\text{crit}} = \dfrac{t}{\sqrt{t^2 + n - 2}}$ with $n - 2$ degrees of freedom (you do not need this formula).

$n$One tail $5\%$One tail $2.5\%$One tail $1\%$One tail $0.5\%$
Two tails $10\%$Two tails $5\%$Two tails $2\%$Two tails $1\%$
40.90000.95000.98000.9900
50.80540.87830.93430.9587
60.72930.81140.88220.9172
70.66940.75450.83290.8745
80.62150.70670.78870.8343
90.58220.66640.74980.7977
100.54940.63190.71550.7646
110.52140.60210.68510.7348
120.49730.57600.65810.7079
130.47620.55290.63390.6835
140.45750.53240.61200.6614
150.44090.51400.59230.6411
160.42590.49730.57420.6226
170.41240.48210.55770.6055
180.40000.46830.54250.5897
190.38870.45550.52850.5751
200.37830.44380.51550.5614
250.33650.39610.46220.5052
300.30610.36100.42260.4629
400.26380.31200.36650.4026
500.23530.27870.32810.3610
Decision rule
$\mathrm{H}_1: \rho > 0$  β€” reject $\mathrm{H}_0$ if $r \geqslant r_{\text{crit}}$
$\mathrm{H}_1: \rho < 0$  β€” reject $\mathrm{H}_0$ if $r \leqslant -r_{\text{crit}}$
$\mathrm{H}_1: \rho \neq 0$  β€” halve the significance level for each tail; reject if $|r| \geqslant r_{\text{crit}}$
Notice how fast the critical values fall. With $n = 5$ you need $r \geqslant 0.8054$ for significance at $5\%$ (one tail); with $n = 50$, only $r \geqslant 0.2353$. A large sample can show that even a weak correlation is real.
Assumption. The test assumes the data are a random sample from a bivariate normal distribution. A scatter diagram that looks roughly elliptical supports this. Some specifications only ask you to know the test is based on this; you will not be asked to verify it formally.
3 The Method, Step by Step
Worked Example 1 β€” One-tailed test for positive correlation

For a random sample of $10$ students, the correlation coefficient between time spent on homework and exam mark is $r = 0.62$. Test at the $5\%$ level whether there is positive correlation.

β‘ $\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho > 0$, where $\rho$ is the population correlation coefficient between homework time and exam mark.
β‘‘One-tailed, $5\%$, $n = 10$: critical value $0.5494$.
β‘’$0.62 > 0.5494$, so $r$ lies in the critical region $r \geqslant 0.5494$. Reject $\mathrm{H}_0$.
β‘£There is sufficient evidence at the $5\%$ level to suggest positive correlation between homework time and exam mark.
Worked Example 2 β€” One-tailed test for negative correlation

For $15$ towns, the correlation coefficient between altitude and mean January temperature is $r = -0.41$. Test at the $5\%$ level whether temperature tends to fall as altitude increases.

β‘ $\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho < 0$.
β‘‘One-tailed, $5\%$, $n = 15$: critical region $r \leqslant -0.4409$.
β‘’$-0.41 > -0.4409$, so $r$ is not in the critical region. Do not reject $\mathrm{H}_0$.
β‘£There is insufficient evidence at the $5\%$ level to suggest negative correlation between altitude and January temperature.
"Not significant" does not prove there is no correlation β€” only that this sample is not convincing. A bigger sample might well show it.
Worked Example 3 β€” Two-tailed test

A researcher believes reaction time and age are related but does not predict a direction. For $20$ adults, $r = 0.47$. Test at the $5\%$ level.

β‘ $\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho \neq 0$.
β‘‘Two-tailed $5\%$ means $2.5\%$ in each tail. $n = 20$: critical value $0.4438$, so the critical region is $r \leqslant -0.4438$ or $r \geqslant 0.4438$.
β‘’$0.47 \geqslant 0.4438$: reject $\mathrm{H}_0$.
β‘£There is sufficient evidence at the $5\%$ level to suggest a correlation between age and reaction time.
4 The $p$-Value Approach

Statistical software usually reports a $p$-value instead of comparing with a table. The $p$-value is the probability, if $\mathrm{H}_0$ is true, of a sample correlation at least as extreme as the one observed.

Decision rule
$p$-value $<$ significance level  $\Rightarrow$  reject $\mathrm{H}_0$
One tail or two? Software often gives a two-tailed $p$-value by default. For a one-tailed test (with $r$ in the predicted direction) halve it; for a two-tailed test use it as it stands. Read the question carefully to see which you have been given.
Worked Example 4 β€” Using a $p$-value

For a sample of $12$ cities, the correlation between population density and the percentage of journeys made by public transport is $r = 0.55$. Software gives a one-tailed $p$-value of $0.0320$. Test at the $5\%$ level and at the $1\%$ level whether there is positive correlation.

β‘ $\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho > 0$.
β‘‘At $5\%$: $0.0320 < 0.05$, so reject $\mathrm{H}_0$. There is evidence of positive correlation.
β‘’At $1\%$: $0.0320 > 0.01$, so do not reject $\mathrm{H}_0$. There is insufficient evidence at this stricter level.
Consistency check: for $n = 12$ the table gives $0.4973$ at $5\%$ and $0.6581$ at $1\%$; $r = 0.55$ lies between them, matching the two conclusions.
Worked Example 5 β€” Testing a regression context

In Regression and Exponential Models, $8$ students' revision hours and scores gave $r = 0.991$. Test at the $1\%$ level whether there is positive correlation, and comment on using the regression line.

β‘ $\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho > 0$; one-tailed $1\%$, $n = 8$: critical value $0.7887$.
β‘‘$0.991 > 0.7887$: reject $\mathrm{H}_0$. Strong evidence of positive correlation.
β‘’This supports using the regression line for predictions within the range of the data.
5 Quick Reference

Null hypothesis

$\mathrm{H}_0: \rho = 0$ β€” always.

Alternatives

$\rho > 0$, $\rho < 0$ (one tail) or $\rho \neq 0$ (two tails).

$\rho$ vs $r$

$\rho$ population (hypotheses); $r$ sample (test statistic).

Critical value

Depends on $n$ and the level; from the table.

Two-tailed

Halve the significance level for each tail.

$p$-value

Reject $\mathrm{H}_0$ if $p <$ significance level.

Assumption

Random sample from a bivariate normal population.

Conclusion

In context; "evidence to suggest", never "proves".

Causation

Significant correlation still does not show cause.

6 Practice Questions

Ten questions, from routine to exam-style. Use the table of critical values in Section 2.

Question 1

A biologist wants to test the claim that the longer a plant's leaves, the taller it grows. Write suitable hypotheses, defining any symbols.

β–Ά Show solution

$\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho > 0$,

where $\rho$ is the population product moment correlation coefficient between leaf length and plant height.

Question 2

A sample of size $8$ gives $r = 0.65$. Test at the $5\%$ level for positive correlation.

β–Ά Show solution

$\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho > 0$. Critical value ($n = 8$, $5\%$ one tail) $= 0.6215$.

$0.65 > 0.6215$: reject $\mathrm{H}_0$. There is sufficient evidence to suggest positive correlation.

Question 3

For $25$ cars, the correlation between engine size and fuel economy (miles per gallon) is $r = -0.30$. Test at the $5\%$ level whether there is negative correlation.

β–Ά Show solution

$\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho < 0$. Critical region $r \leqslant -0.3365$.

$-0.30 > -0.3365$: not in the critical region, do not reject $\mathrm{H}_0$.

There is insufficient evidence at the $5\%$ level to suggest negative correlation between engine size and fuel economy.

Question 4

For $30$ pairs of observations, $r = 0.39$. Test at the $5\%$ level whether there is correlation (in either direction).

β–Ά Show solution

$\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho \neq 0$. Two-tailed $5\%$, so $2.5\%$ in each tail: critical value $0.3610$.

$|0.39| \geqslant 0.3610$: reject $\mathrm{H}_0$. There is sufficient evidence of correlation.

Question 5

A test of $\mathrm{H}_0: \rho = 0$ against $\mathrm{H}_1: \rho > 0$ gives a $p$-value of $0.032$. State the conclusion at (a) the $5\%$ level, (b) the $2.5\%$ level.

β–Ά Show solution

(a) $0.032 < 0.05$: reject $\mathrm{H}_0$ β€” evidence of positive correlation.

(b) $0.032 > 0.025$: do not reject $\mathrm{H}_0$ β€” insufficient evidence.

Question 6

For a sample of $40$, $r = 0.25$. Test for positive correlation at (a) the $1\%$ level, (b) the $5\%$ level. Comment.

β–Ά Show solution

(a) Critical value $0.3665$; $0.25 < 0.3665$: do not reject $\mathrm{H}_0$.

(b) Critical value $0.2638$; $0.25 < 0.2638$: do not reject $\mathrm{H}_0$.

Even at $5\%$ the result is not significant, though it is close. (At $10\%$ one tail it would be: the critical value there is $0.2070$.)

Question 7

Explain why $r = 0.7$ is significant at the $5\%$ level (one tail) for a sample of $10$ but not for a sample of $6$.

β–Ά Show solution

Critical values: $n = 10$ gives $0.5494$; $n = 6$ gives $0.7293$.

With only a few points, a high $r$ can easily happen by chance when there is no real correlation, so a larger $r$ is needed before it counts as evidence. $0.7 > 0.5494$ but $0.7 < 0.7293$.

Question 8

For six days, hours of sunshine $x$ and cold drinks sold $y$ (in tens) were: $(3, 14)$, $(5, 19)$, $(6, 21)$, $(8, 26)$, $(9, 27)$, $(11, 33)$. Calculate $r$ and test at the $1\%$ level for positive correlation.

β–Ά Show solution

Calculator: $r = 0.997$ (3 s.f.).

$\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho > 0$; $n = 6$, $1\%$ one tail: critical value $0.8822$.

$0.997 > 0.8822$: reject $\mathrm{H}_0$. Strong evidence of positive correlation between sunshine and drinks sold.

Question 9

A researcher expects a sample correlation of about $0.45$. Using the table, find the smallest sample size for which $r = 0.45$ would be significant evidence of positive correlation at the $5\%$ level.

β–Ά Show solution

Need the critical value to be at most $0.45$.

$n = 14$: $0.4575 > 0.45$ (not significant). $n = 15$: $0.4409 \leqslant 0.45$ (significant).

Smallest sample size: $n = 15$.

Question 10

A teacher thinks that students' marks in a mock exam and in the final exam are related. For a random sample of $18$ students, $r = 0.48$, and software gives a two-tailed $p$-value of $0.0438$.

(a) State suitable hypotheses. (b) Carry out the test at the $5\%$ level using the $p$-value. (c) Confirm your conclusion using a critical value. (d) The teacher claims this shows that doing well in the mock causes students to do well in the final exam. Comment. (e) State an assumption needed for the test to be valid.

β–Ά Show solution

(a) No direction is predicted: $\mathrm{H}_0: \rho = 0$, $\mathrm{H}_1: \rho \neq 0$, where $\rho$ is the population correlation coefficient between mock and final marks.

(b) Two-tailed $p$-value $0.0438 < 0.05$: reject $\mathrm{H}_0$. There is sufficient evidence at the $5\%$ level to suggest a correlation between mock and final marks.

(c) Two-tailed $5\%$, $n = 18$: critical value $0.4683$. $|0.48| \geqslant 0.4683$, so reject $\mathrm{H}_0$ βœ“

(d) Correlation does not imply causation. Both marks are likely to depend on the student's underlying ability and effort, so the mock need not cause the final result.

(e) The students are a random sample from a population in which the marks have a bivariate normal distribution.

Testing for Correlation · A Level Maths Year 2 · Created with MathJax