A Level Further Mathematics · Chapter 48 · Further Statistics · Further Statistics 2
A correlation coefficient measures how closely paired data follow a straight line or a consistent order, on a scale from −1 to 1.
Do students who score well in maths also score well in physics, and do two judges rank a competition the same way? This chapter measures the strength of such links with two coefficients, and tests whether an observed correlation is strong enough to be more than chance.
In this chapter · jump to a section
Start here
Your route through this chapter
By the end of this chapter you will be able to:
- calculate the product moment correlation coefficient and interpret its value
- explain why linear coding does not change , apart from its sign
- test using critical values, with one or two tails
- rank data and calculate Spearman's coefficient , including tied ranks
- test for association using Spearman's coefficient
- choose the right coefficient and interpret a result without claiming causation
Time: three sessions, about 4 hours, plus the practice ladder and the exam workshop.
You need first: the summary statistics , and from Linear regression, and the language of hypothesis testing.
The big idea
The big idea
The product moment correlation coefficient measures how close paired data lie to a straight line:
A value near 1 means a strong positive linear relationship, near a strong negative one, and near 0 little linear relationship.
The diagram shows marks for eight students in two subjects. The points rise together and lie close to a line, so the coefficient is close to 1. If the points were more scattered, the coefficient would be smaller. If they fell from left to right, it would be negative.
Strength and direction
The sign of a correlation coefficient gives the direction: positive when the variables rise together, negative when one falls as the other rises. The size gives the strength: how tightly the points follow the pattern. A value of 0.95 is strong, 0.5 moderate, and 0.1 weak. These descriptions are rough guides, not strict rules.
Correlation has no units
The coefficient is the same whether marks are out of 100 or out of 50, and whether lengths are in metres or feet. This is because the units in the numerator and denominator cancel. It means coefficients from different studies can be compared directly, which makes them very useful in practice.
Two coefficients for two kinds of link
The product moment coefficient measures linear relationships between measurements. Spearman's coefficient measures how consistently the order of one variable matches the order of the other, using ranks. Some relationships are consistent in order but curved, and Spearman's coefficient captures them better. Section 6 explains how to choose.
Correlation and regression
Regression finds the best line to predict one variable from another. Correlation measures how well any line fits, without choosing a direction. The two are linked: the regression gradient and the correlation coefficient always share a sign. A strong correlation means regression predictions will be reliable.
Section 1
The product moment correlation coefficient
Calculating r
Find , and from the data or from summary totals, exactly as in regression. Then divide by the square root of the product of the other two. The result always lies between and 1. A value outside that range signals an arithmetic error somewhere.
Common mistake: dividing Sxy by Sxx times Syy without taking the square root of the product. The square root makes the units cancel and keeps between and 1. Without it, the value depends on the units and is usually tiny and meaningless.
The product moment correlation coefficient
- Sxy
- 55.75
- r = Sxy/√(SxxSyy)
- 0.7537
Figure 48.1 lets you change the trend and the scatter and watch on a gauge. The wrong model, without the square root, gives a value that barely moves.
What r measures
The coefficient measures the strength of the linear part of a relationship. It compares how much and vary together with how much each varies on its own. When every point lies on a straight line, the joint variation equals the product of the separate ones, and is exactly 1 or .
Interpreting r in context
A good interpretation names the variables and describes the direction and strength. For example, there is a strong positive correlation between maths and physics marks, so students who do well in one tend to do well in the other. Avoid saying that one causes the other.
Effect of outliers
A single unusual point can change a great deal, especially in a small sample. One point far from the others can create an apparently strong correlation, or hide a real one. Always look at a scatter diagram alongside the coefficient. It shows whether the value is driven by one point.
Small samples
With only a few points, a fairly large coefficient can arise by chance even when the variables are unrelated. That is why section 3 tests whether a coefficient is significant. A coefficient of 0.6 means much more from 50 points than from 5 points.
Accuracy in calculation
Keep full accuracy in the summary statistics before dividing. Rounding or the square root early can change the third decimal place of , which matters when comparing with a critical value. Give to three or four decimal places, as the critical value tables do.
Reading a scatter diagram first
A scatter diagram shows the shape of a relationship before any calculation. It reveals curves, clusters and outliers that a single number would hide. If the points form a rough ellipse along a sloping line, the product moment coefficient is a good summary. Otherwise, think carefully before relying on it.
Correlation and sample size
The same coefficient can mean different things for different sample sizes. A value of 0.7 from five points could easily happen by chance. The same value from fifty points is very strong evidence of a real relationship. Always consider the sample size when interpreting a coefficient.
Correlation in everyday language
In everyday speech, people say two things are correlated whenever they seem related. In statistics the word has a precise meaning: a measured tendency for paired values to move together along a straight line or in a consistent order. Using the word precisely in written answers shows understanding and avoids vague claims.
Worked example 1: from summary statistics
For the eight students, , and . Find .
| Working | Reason |
|---|---|
| Take the square root of the product | |
| Divide Sxy by that square root | |
| Evaluate the coefficient to three decimal places |
Perfect correlation
A coefficient of exactly 1 or means every point lies on a straight line. Real data almost never do this, because of measurement error and natural variation. A value very close to one usually reflects a strong physical law or a definition linking the variables, such as length in centimetres against length in inches.
Zero correlation
A coefficient of exactly zero means there is no linear trend at all. The points might form a shapeless cloud, or a curve that rises and falls symmetrically. A sample coefficient is rarely exactly zero even when there is no relationship, because of random variation. That is why tests are needed.
Worked example 2: from totals
For ten pairs, , and . Find and interpret .
| Working | Reason |
|---|---|
| Substitute into the formula | |
| Evaluate the coefficient to three decimal places | |
| Strong positive linear correlation | Describe the direction and strength |
Check yourself. A data set has , and . Calculate .
Show the answer
The square root of the product is , so . The points lie almost exactly on a rising straight line.
Section 2
Coding and r
Coding leaves r unchanged
If is coded as with , and is coded similarly, the correlation coefficient does not change. Subtracting a constant does not change any deviation from the mean. Dividing by a positive constant scales and the square root by the same factor, which cancels.
Common mistake: thinking that coding changes the value of r. Shifting and positively scaling either variable leaves exactly the same. Only a negative scale factor changes it, and then only its sign. Recalculating after coding is unnecessary.
Derivation: coding does not change r
With and , every deviation from the mean is divided by or .
Substituting into the formula, the scale factors cancel when and are positive.
If one scale factor is negative, the square root is still positive but the numerator changes sign, so changes sign.
Why this is useful
Coding makes calculations with large numbers easier. Since is unchanged, you can calculate it entirely in coded form and quote the result for the original data. This saves effort and reduces rounding errors. It is common in examination questions where the original values are awkward.
Negative scale factors
Multiplying one variable by a negative number reverses its order, so a rising pattern becomes a falling one. The strength is unchanged but the direction flips, so changes sign. Multiplying both variables by negative numbers flips both directions, and keeps its original sign.
Changing units
Converting from centimetres to inches, or from Celsius to Fahrenheit, is a linear coding. So the correlation between height and weight is the same whatever units are used. This is a key advantage of correlation over measures like , which do depend on units.
Contrast with regression
Coding does change the regression line, as Linear regression showed: both the gradient and the intercept must be decoded. Correlation needs no decoding. Keeping this difference clear avoids unnecessary work, and it avoids the error of trying to decode a correlation coefficient.
A quick check with coding
Because coding does not change the coefficient, it offers a quick check. Code the data in a convenient way, calculate the coefficient, and compare with a calculation from the original values. If they differ, there is an arithmetic error. This is a useful habit when working by hand.
Coding and rounding
Coding not only simplifies arithmetic but can also reduce rounding errors. Large values produce enormous totals, and subtracting nearly equal numbers loses accuracy. Coded values are small, so the totals are manageable and the summary statistics are more accurate. The correlation itself is unaffected, so nothing is lost.
Worked example 3: coded data
The marks in worked example 1 are coded by and . State the correlation between and .
| Working | Reason |
|---|---|
| Subtracting 50 leaves every deviation unchanged | Shifts do not affect the summary statistics |
| Dividing by 10 scales numerator and denominator equally | Positive scaling cancels in the ratio |
| The coefficient is unchanged by coding |
Coding in examination questions
Questions often give coded summary statistics and ask for the correlation of the original data. The answer is simply the coded correlation, with a sign change if a negative scale factor was used. Explaining briefly why coding has no effect usually earns a mark of its own.
Worked example 4: a negative scale
If instead , what is the correlation between and ?
| Working | Reason |
|---|---|
| , a scale factor of | Write the coding as a linear function |
| The order of the values is reversed | A negative factor flips the direction |
| The size is unchanged but the sign flips |
Check yourself. Temperatures in Celsius have correlation 0.85 with ice cream sales. Write down the correlation when the temperatures are converted to Fahrenheit by .
Show the answer
The conversion multiplies by a positive number and adds a constant, which is a linear coding. So the correlation is unchanged at 0.85.
Section 3
Testing for correlation
Hypotheses
A sample coefficient estimates the population coefficient . To test whether there is any correlation in the population, use . The alternative is or for a one-tailed test, or for a two-tailed test. The test assumes the data come from a bivariate normal distribution.
Common mistake: using the one-tailed critical value at the full significance level for a two-tailed test. A two-tailed test splits the level between two tails. Its critical value comes from the column for half the level. Using the one-tailed value makes the test reject too easily.
Critical values for a two-tailed test of zero correlation
- Critical value
- 0.6319
- p-value
- 0.0667
- Decision
- do not reject H₀
Figure 48.3 shows how critical values fall as the sample grows. The wrong model's curve, using the one-tailed value, lies too low.
Using the tables
Critical value tables list values by sample size and one-tailed significance level. For a one-tailed test at 5%, read the 5% column. For a two-tailed test at 5%, read the 2.5% column. Reject the null hypothesis if the observed coefficient is at least as extreme as the critical value.
Writing a conclusion
A conclusion should state the decision and its meaning in context. For example, there is evidence at the 5% level of positive correlation between maths and physics marks. Avoid saying that the hypothesis is proved, or that the variables are definitely related, since the test only gives evidence.
Why critical values fall with n
With more data, a moderate correlation is less likely to arise by chance. So the bar for significance is lower. With 5 points, needs to exceed about 0.8 at the 5% level; with 30 points, about 0.3 is enough. This is why large studies can detect weak correlations.
The bivariate normal assumption
The product moment test assumes that the pairs come from a bivariate normal distribution, so that each variable is roughly normal and the relationship is linear. A scatter diagram shaped roughly like an ellipse supports this. If the data are clearly not normal, Spearman's test is safer.
Negative correlation tests
For , the critical region is , where is the tabulated value. Compare the observed coefficient with the negative of the critical value. Writing the critical region explicitly, with its sign, avoids comparing a negative coefficient with a positive critical value.
Choosing one or two tails
Decide on one or two tails before seeing the data, based on the question being asked. If there is a reason to expect a particular direction, such as more revision leading to higher marks, use one tail. If any correlation is of interest, use two tails. Changing the decision after seeing the data is not valid.
Reporting the test
A full report names the test, states both hypotheses, gives the coefficient, the sample size, the significance level and the critical value, and ends with a conclusion in context. This may seem long, but each part carries information a reader needs, and each usually earns a mark.
Hypotheses about the population
The hypotheses are about the population coefficient, not the sample one. The sample coefficient is known exactly once the data are collected. The question is what it suggests about the whole population from which the sample came. Writing the hypotheses with the population symbol keeps this distinction clear.
Worked example 5: a one-tailed test
For the eight students, . Test at the 5% level whether there is positive correlation between the marks.
| Working | Reason |
|---|---|
| , | Positive correlation is the claim |
| Critical value for , one-tailed 5%: 0.6215 | Read the table for eight pairs |
| : reject; evidence of positive correlation | Compare and conclude in context |
The p-value approach
Instead of comparing with a critical value, a calculator or software can give the probability of a coefficient at least as extreme as the one observed, assuming no correlation. If this p-value is below the significance level, reject the null hypothesis. Both methods give the same decision.
What the test does not tell you
A significant result shows that the population correlation is probably not zero. It does not show that the correlation is strong. With a very large sample, even a weak correlation of 0.1 can be significant. Report the coefficient itself, as well as the test result, so a reader can judge its strength.
Worked example 6: a two-tailed test
For 10 pairs, . Test at the 5% level whether there is any correlation.
| Working | Reason |
|---|---|
| , | Any correlation is of interest |
| Critical value for , two-tailed 5%: 0.6319 | Use the column for half the level |
| : reject; evidence of correlation | Compare the size and conclude |
Check yourself. A sample of 10 pairs gives . Decide at the 5% level whether there is any correlation, using a two-tailed test.
Show the answer
The two-tailed critical value for 10 pairs is 0.6319, read from the 2.5% column. Since 0.6 is below it, do not reject: there is no evidence of correlation at this level.
Section 4
Spearman's rank correlation coefficient
Ranks and differences
Give each -value a rank from smallest to largest, and do the same for the -values. For each pair, find the difference between the two ranks. Spearman's coefficient is
It equals 1 when the rankings agree exactly and when they are exactly reversed.
Common mistake: forgetting to subtract from 1 in Spearman's formula, so perfect agreement gives zero. The fraction is zero for perfect agreement and two for complete reversal. Subtracting it from one rescales the value to run from 1 down to .
Spearman's rank correlation
- Σd²
- 20
- rₛ
- 0.7619
- Critical value, 5% one-tailed
- 0.6429
- Decision
- evidence of positive association
Figure 48.2 lets you change one judge's ranking and watch and . The wrong model, without the subtraction, gives zero for perfect agreement.
Derivation: the spread of the ranks 1 to n
Using the standard sums of the first n whole numbers and their squares,
Subtracting the square of the total over n gives the spread of any complete ranking.
Every ranking without ties has this same spread, which is why the formula for needs only .
Ranking direction
It does not matter whether you rank from smallest or largest, as long as both variables are ranked in the same direction. Ranking one up and the other down would reverse the sign of the coefficient. State the direction used, and apply it consistently to both variables.
Why ranks?
Ranks ignore the exact values and keep only the order. This makes Spearman's coefficient resistant to outliers, since an extreme value simply gets the top rank. It also means the coefficient detects any relationship that is consistently increasing or decreasing, even if it is curved rather than straight.
Data that are already ranks
Some data are ranks from the start, such as judges' placings in a competition. Then no ranking step is needed, and Spearman's coefficient is the natural measure. The product moment coefficient would not be appropriate, because ranks are not measurements on a continuous scale.
Checking the differences
The differences always add up to zero, because both sets of ranks add up to the same total. This is a quick check on the ranking. If the differences do not add to zero, a rank has been miscounted or a tie handled inconsistently.
Interpreting r_s
A value of near 1 means the two orders agree closely; near , they are nearly reversed; near 0, there is little consistent relationship between the orders. In context, describe what agreement means, such as the two judges ranking the entries in a similar order.
Ranking large data sets
For a large data set, sort the values first, then assign ranks in order. A calculator or spreadsheet can help. Check that the ranks run from 1 to with no gaps, apart from tied values, and that each value has exactly one rank.
Spearman and the product moment coefficient compared
For the students' marks, the product moment coefficient is 0.960 and Spearman's coefficient is 0.952. They are close because the relationship is roughly linear. When the two coefficients differ a lot, the relationship is probably curved or affected by outliers, which is worth investigating.
Resistance to outliers
Suppose one student scored an extreme mark far above the rest. The product moment coefficient could change a lot, because the mark is far from the mean. Spearman's coefficient would hardly change, since that student simply takes the top rank. This resistance is a key reason for choosing ranks.
Worked example 7: students' marks
The eight students in worked example 1 have maths ranks 2, 4, 1, 7, 6, 8, 3, 5. Their physics ranks are 1, 5, 2, 7, 6, 8, 3, 4. Find .
| Working | Reason |
|---|---|
| : 1, −1, −1, 0, 0, 0, 0, 1, so | Subtract the ranks and square |
| Substitute into the formula | |
| Evaluate the coefficient to three decimal places |
Spearman for agreement between judges
Spearman's coefficient is widely used to compare judges, tasters or examiners. A high value shows that they order the entries in a similar way, even if their marks differ in scale. It is a fair way to check consistency, because it ignores whether one judge is generally harsher than another.
Worked example 8: two judges
Two judges rank eight entries. Judge A ranks them 1 to 8 in order; judge B ranks them 3, 1, 2, 6, 4, 8, 5, 7. Find .
| Working | Reason |
|---|---|
| : −2, 1, 1, −2, 1, −2, 2, 1 | Subtract judge B's ranks from judge A's |
| Square and add the differences | |
| Substitute into the formula and evaluate |
Check yourself. Ten pairs of ranks give . Calculate .
Show the answer
Substitute the sum and the sample size into Spearman's formula: . A value this close to one shows that the two orders agree closely.
Section 5
Ties and testing Spearman's coefficient
Tied ranks
When two or more values are equal, give each the mean of the ranks they would occupy. For example, if two values tie for second and third place, each gets rank 2.5. With ties, the formula for is only approximate, so calculate the product moment coefficient of the ranks instead.
Common mistake: giving tied values different ranks. Equal values must get equal ranks, otherwise the coefficient depends on an arbitrary choice of order. Averaging the ranks treats the tied values fairly and keeps the total of the ranks correct.
Testing r_s
The test for Spearman's coefficient has : no association between the rankings, against an alternative of positive, negative or any association. Compare with the critical value from Spearman's tables for the sample size and level. The test does not need the normal assumption, so it suits ranked or skewed data.
Spearman's tables differ
Spearman's critical values are not the same as those for the product moment coefficient. They come from the exact distribution of ranks, so they are slightly different, especially for small samples. Make sure you read the right table. Using the product moment table for a Spearman test is a common slip.
Hypotheses in words
For Spearman's test, write the hypotheses in words about association, such as there is no association between the judges' rankings. This reflects that the test is about order, not about a linear relationship. Some texts use for the population coefficient, which is also acceptable.
Few ties do little harm
When there are only one or two ties, the formula gives a value very close to the product moment coefficient of the ranks. Examination questions usually say which method to use. If they do not, the product moment coefficient of the ranks is the safest choice when ties are present.
Small samples and Spearman's test
With very small samples, even perfect agreement may not be significant at strict levels. For five pairs at the 1% level, the critical value is 1, so only perfect agreement counts. This shows that small samples give limited evidence, however well the rankings agree.
How many ties is too many?
With a handful of ties, the formula and the product moment coefficient of the ranks give almost the same value. With many ties, they can differ noticeably. In that case, always use the product moment coefficient of the ranks. A question may state which method to use, so read it carefully.
Ranking categories
Some data are ordered categories, such as poor, fair, good and excellent. These can be given ranks, but many items will share each category, producing many ties. Spearman's method still applies, using mean ranks, but the result should be interpreted with care because so much information is lost.
Reading Spearman's table
Spearman's table lists critical values by the number of pairs and the one-tailed significance level, just like the product moment table. For a two-tailed test, use the column for half the level. Write down the value you read, with the sample size and the column, so the examiner can follow your reasoning.
Worked example 9: ranking with ties
Rank the values 5, 3, 3, 8 and 1, using the mean of the ranks for ties.
| Working | Reason |
|---|---|
| In order: 1, 3, 3, 5, 8 | Sort the values from smallest |
| The two 3s would take ranks 2 and 3 | Find the places shared by the tie |
| Ranks: 4, 2.5, 2.5, 5, 1 | Give each tied value the mean rank |
Tables for large samples
Spearman's tables usually stop at around thirty pairs. For larger samples, the distribution of the coefficient is close to that of the product moment coefficient, so similar critical values apply. In this course, questions keep to sample sizes covered by the tables.
Worked example 10: testing the judges
For the judges in worked example 8, with for , test at the 5% level for positive association.
| Working | Reason |
|---|---|
| : no association; : positive association | State the hypotheses in words |
| Critical value for , one-tailed 5%: 0.6429 | Read Spearman's table, not the other one |
| : reject; the judges tend to agree | Compare and conclude in context |
Check yourself. Ten pairs of rankings give . Test at the 2.5% level, one-tailed, for positive association, given the critical value 0.6485.
Show the answer
Since 0.6 is below the critical value 0.6485, do not reject the null hypothesis. There is not enough evidence at the 2.5% level of positive association between the rankings.
Section 6
Choosing and interpreting
Which coefficient?
Use the product moment coefficient for measurements that appear to follow a linear pattern and are roughly normal. Use Spearman's coefficient when the data are ranks, when the relationship is consistently increasing or decreasing but curved, or when the normal assumption is doubtful. A scatter diagram usually shows which is suitable.
Common mistake: concluding from a coefficient near zero that the variables are unrelated. A coefficient near zero shows only that there is no linear or monotonic pattern. A strong curved relationship, such as a U shape, can give close to zero.
Correlation is not causation
A strong correlation shows that two variables are associated, not that one causes the other. Both might depend on a third variable, or the link might run either way. For example, ice cream sales and sunburn are correlated because both rise in sunny weather. Always avoid causal language in conclusions.
Spurious correlations
With many variables, some pairs will correlate strongly by chance. Searching through data for any strong correlation is likely to find one that means nothing. A good study states its hypothesis before collecting data. Then a significant result is more convincing.
Comparing r and r_s
For data close to a straight line, and are usually similar. When they differ noticeably, the data may be curved, contain outliers, or have a pattern in order but not in spacing. Calculating both and comparing them can reveal the nature of a relationship.
Interpreting in context
A full interpretation names the variables, gives the direction and strength, and states the result of any test. It avoids causal claims and notes any limitations, such as a small sample. This complete answer earns marks in examinations and makes the result useful to a reader.
Restricted ranges
If data cover only a narrow range of one variable, the correlation may look weak even when a strong relationship exists over a wider range. For example, among students who all scored highly, the link between two subjects may seem weak. The range of the data affects what correlation can reveal.
Correlation in science and society
Correlation studies are common in medicine, economics and education. They often provide the first evidence that two things are linked. Controlled experiments are then needed to test whether one causes the other. Understanding the limits of correlation is part of reading research critically.
Beware of averages
Correlations calculated from averages, such as average income and average health by region, are usually much stronger than correlations between individuals. Averaging removes the individual variation. Conclusions about individuals should not be drawn from correlations between group averages, a mistake known as the ecological fallacy.
Monotonic relationships
A relationship is monotonic if one variable always rises, or always falls, as the other rises, even if not at a steady rate. Spearman's coefficient detects any monotonic relationship. The product moment coefficient detects only the linear part. For a steadily curving but always rising pattern, Spearman's coefficient gives the clearer picture.
Worked example 11: choosing a coefficient
A study ranks ten restaurants by price and by customer rating. Which coefficient should be used, and why?
| Working | Reason |
|---|---|
| The data are ranks, not measurements | Note the type of data given |
| Ranks are not normally distributed | The product moment test would not be valid |
| Use Spearman's coefficient and its tables | Choose the coefficient that suits ranks |
Explaining a lack of significance
When a test is not significant, there are several possible reasons. There may be no real relationship, the sample may be too small, or the relationship may be curved rather than linear. A good comment mentions the most likely reason in context, rather than simply stating that the variables are unrelated.
Combining evidence
A single correlation study rarely settles a question. Repeated studies with different samples, and experiments that control other factors, build a stronger case. Correlation is a useful first step that points to relationships worth investigating further. Treat it as evidence to weigh, not as a final answer.
Worked example 12: interpreting a strong correlation
For the drinks data in Linear regression, . Interpret this and comment on causation.
| Working | Reason |
|---|---|
| Very strong positive linear correlation | Describe the direction and strength |
| Hotter days tend to have higher drink sales | State the meaning in context |
| Plausible cause, but correlation alone does not prove it | Comment carefully on causation |
Check yourself. For points on the curve with , the coefficient is . Explain why this does not mean and are unrelated.
Show the answer
Every point lies exactly on a U-shaped curve, so depends completely on . The coefficient is zero because the relationship is not linear: the falling half and the rising half cancel out.
Reference
Results in this chapter
| Result | What it says | When to use it | In the formula booklet? |
|---|---|---|---|
| Product moment correlation | Linear relationships | Yes | |
| Coding leaves unchanged | Except a sign change for negative scales | Coded data | No, learn it |
| Test for correlation | Bivariate normal data | No, learn it | |
| Spearman's coefficient | Ranks, no ties | Yes | |
| Mean rank for ties | Tied values | Ranking data | No, learn it |
| Two-tailed uses half the level | Reading tables | Any two-tailed test | No, learn it |
Reasoning
Proof workshop: Spearman's formula
The claim
For two rankings of items with no ties, the product moment coefficient of the ranks equals
Strategy
Both sets of ranks are the numbers 1 to in some order, so their sums and sums of squares are known exactly. That fixes and . Then express in terms of by expanding , and substitute into the formula for the product moment coefficient.
The key insight is that the two spreads are equal and known, so the only quantity that changes between rankings is .
The proof
The ranks have and , so
Since , the cross term is . Therefore
Checking every step
The sums of the first whole numbers and their squares are standard results. The expression for uses the fact that both rankings have the same mean, so the deviation form and the raw form agree. Dividing by and substituting its value gives the factor six.
A numerical check uses the students in worked example 7. With , , and gives . So , matching the formula.
The proof also explains why ties break the formula. With ties, the ranks are no longer exactly the numbers 1 to , so changes and the factor six is no longer exact. That is why the product moment coefficient of the ranks is used instead.
It is striking that a formula for any pair of rankings depends on only one number, the sum of squared differences. Everything else about the rankings is fixed by the fact that each one uses every rank exactly once. This is why Spearman's coefficient is so quick to calculate by hand.
Your turn
For , find for the ranks 1 to 5, and hence the value of when .
Show a model proof
Here , so and . The formula agrees: .
Practice
Practice ladder
Rung 1: Recall and fluency
Q1. Given , and , find to four decimal places.
Worked solution to Q1
Divide by the square root of the product of the other two: . This is very close to 1, so the points lie almost on a straight line.
Q2. With 10 pairs and , compute .
Worked solution to Q2
Substitute the sum of squared differences and the sample size into Spearman's formula with ten pairs: . A value this close to one means that the two rankings agree strongly.
Q3. Write down the critical value for a one-tailed test of at the 5% level with 12 pairs.
Worked solution to Q3
Reading the product moment table for twelve pairs in the 5% one-tailed column gives 0.4973. An observed coefficient at or above this would be significant.
Rung 2: Application
Q4. Rank the values 5, 3, 3, 8 and 1 from smallest, dealing with the tie.
Worked solution to Q4
In order the values are 1, 3, 3, 5 and 8, and the two 3s share ranks 2 and 3. Giving each the mean rank, the ranks in the original order are 4, 2.5, 2.5, 5 and 1.
Q5. Judge A ranks eight entries 1 to 8 and judge B ranks them 2, 1, 4, 3, 6, 5, 8, 7. Work out .
Worked solution to Q5
Judge B swaps each neighbouring pair, so every difference is 1 or and . Then , which shows close agreement between the two judges.
Q6. In Q5, test at the 5% level, one-tailed, whether the judges agree, given the critical value 0.6429.
Worked solution to Q6
The observed value 0.9048 exceeds the critical value 0.6429, so reject the null hypothesis. There is evidence that the two judges' rankings are positively associated.
Rung 3: Analysis
Q7. The marks in worked example 1 are coded by . Deduce the correlation between and the physics marks.
Worked solution to Q7
Coding by subtracting a constant and dividing by a positive number does not change the correlation. So the coefficient is still 0.9599, with no recalculation needed.
Q8. For 20 pairs, . Test at the 5% level whether there is any correlation, given the two-tailed critical value 0.4438.
Worked solution to Q8
This is a two-tailed test, so compare the size of the coefficient with the critical value. Since 0.5 exceeds 0.4438, reject the null hypothesis: there is evidence of correlation, which here is negative.
Q9. The x-values 5, 3, 3, 8, 1 are paired with y-values 4, 2, 3, 9, 1. Using the product moment coefficient of the ranks, find .
Worked solution to Q9
The -ranks are 4, 2.5, 2.5, 5, 1 and the -ranks are 4, 2, 3, 5, 1. The product moment coefficient of these ranks is 0.9747, showing very strong agreement in order.
Rung 4: Stretch
Q10. For four pairs ranked in exactly opposite orders, show that .
Worked solution to Q10
When the orders are reversed, the differences are 3, 1, and , so . Substituting gives , which is the most negative value the coefficient can take.
Q11. A Spearman coefficient of comes from 10 pairs. Decide at the 2.5% level, one-tailed, given the critical value 0.6485.
Worked solution to Q11
The observed value 0.6 is below the critical value 0.6485, so do not reject the null hypothesis. There is not enough evidence of positive association at this strict level.
Q12. For 10 pairs, find the value of that gives .
Worked solution to Q12
Setting gives . This is half of the largest possible value, 330, which comes from completely reversed rankings.
Exam practice
Exam technique and worked answer workshop
How these questions are marked
M1 marks go to the correct formula for or , correct ranking, and comparing with the right critical value. A1 marks go to correct values. B1 marks go to hypotheses, critical values, and conclusions in context without causal claims.
State both hypotheses using or in words. Say which table and column you used, especially for two-tailed tests, and finish with a sentence in context.
Exam question 1 (7 marks · Paper 4 · about 10 minutes)
For eight students, the maths marks and physics marks give , and . Calculate and test, at the 5% level, whether there is positive correlation between the marks. (7)
Mark scheme for exam question 1
Uses M1
A1
, B1
Critical value 0.6215 B1
Compares with the critical value M1
Reject A1
Evidence of positive correlation between the marks B1
Exam question 2 (6 marks · Paper 4 · about 8 minutes)
The maths ranks of eight students are 2, 4, 1, 7, 6, 8, 3, 5 and their physics ranks are 1, 5, 2, 7, 6, 8, 3, 4. Calculate Spearman's coefficient and test at the 5% level for positive association. (6)
Mark scheme for exam question 2
Finds the differences M1
A1
A1
Hypotheses in words about association B1
Critical value 0.6429 B1
Reject: evidence of positive association A1
Exam question 3 (6 marks · Paper 4 · about 8 minutes)
Show that, for two rankings of items with no ties, the product moment coefficient of the ranks is . (6)
Mark scheme for exam question 3
Uses and for ranks 1 to M1
A1
Expands M1
A1
Substitutes into M1
Obtains A1
Exam question 4 (6 marks · Paper 4 · about 8 minutes)
Data are coded by and , giving , and . Find the correlation between and , state the correlation between and , and explain your answer. (6)
Mark scheme for exam question 4
Uses M1
A1
B1
Subtracting constants leaves deviations unchanged B1
Positive scale factors cancel in the ratio M1
So coding does not change A1
Exam question 5 (6 marks · Paper 4 · about 8 minutes)
For a sample of 10 pairs from a bivariate normal distribution, . Test, at the 5% level, whether there is any correlation, stating your hypotheses and the critical value used. (6)
Mark scheme for exam question 5
B1
B1
Uses the two-tailed critical value M1
0.6319 A1
, so reject M1
Evidence of correlation, which is negative A1
Exam question 6 (6 marks · Paper 4 · about 8 minutes)
The -values 5, 3, 3, 8, 1 are paired with -values 4, 2, 3, 9, 1. Rank both sets, giving tied values the mean rank, and find Spearman's coefficient as the product moment coefficient of the ranks. Interpret the value. (6)
Mark scheme for exam question 6
Averages the ranks for the tie M1
-ranks 4, 2.5, 2.5, 5, 1 A1
-ranks 4, 2, 3, 5, 1 B1
Product moment coefficient of the ranks M1
A1
Very strong agreement in order B1
Exam question 7 (6 marks · Paper 4 · about 8 minutes)
Two judges rank eight entries; judge A ranks them 1 to 8 and judge B ranks them 3, 1, 2, 6, 4, 8, 5, 7. Explain why Spearman's coefficient is appropriate, calculate it, and test at the 5% level for positive association. (6)
Mark scheme for exam question 7
The data are ranks, so Spearman's coefficient suits them B1
M1
A1
Critical value 0.6429 B1
, so reject M1
Evidence that the judges tend to agree A1
Exam question 8 (5 marks · Paper 4 · about 7 minutes)
For eight days, temperature and drink sales give , and . Calculate , interpret it, and explain whether it proves that heat increases sales. (5)
Mark scheme for exam question 8
Substitutes into the formula M1
A1
Very strong positive linear correlation B1
Hotter days tend to have higher sales B1
Correlation alone does not prove causation B1
Annotated model answer: exam question 1
The coefficient is . M1. This gives . A1. The hypotheses are and . B1. For eight pairs at the 5% level, one-tailed, the critical value is 0.6215. B1.
Since , M1, reject . A1. There is evidence at the 5% level of positive correlation between maths and physics marks. B1.
Annotated model answer: exam question 7
The judges' placings are ranks, not measurements, so Spearman's coefficient is appropriate. B1. The differences are −2, 1, 1, −2, 1, −2, 2 and 1, so . M1. Then . A1.
From Spearman's table, the 5% one-tailed critical value for eight pairs is 0.6429. B1. Since , reject the null hypothesis of no association. M1. There is evidence that the two judges tend to rank the entries in a similar order. A1.
Connections
Synoptic link
Linear regression supplied the summary statistics used to calculate . Quality of tests explained the errors that any correlation test can make.
Hypothesis tests for Poisson and geometric models introduced critical regions in the same style. The t-distribution underlies the critical values used for the product moment test.
Synoptic question 1. Explain why the regression gradient and the correlation coefficient always have the same sign.
Answer to synoptic question 1
Both have in the numerator, and their denominators, and the square root of , are positive. So both take the sign of . For the students' marks, both are positive.
Recap
Recap and next step
- lies between and 1 and measures linear association.
- Linear coding leaves unchanged, apart from a sign change for a negative scale.
- Test with critical values; two-tailed tests use half the level.
- Spearman's uses ranks; ties get mean ranks.
- Spearman's test uses its own tables and needs no normal assumption.
- Correlation does not imply causation, and near zero can hide a curved relationship.
Next chapter: Combinations of normal random variables, which finds the distributions of sums and differences of independent normal variables.
For your exam board
This chapter covers Pearson Edexcel A Level Further Mathematics (9FM0) Further Statistics 2 section 3: the product moment correlation coefficient, Spearman's rank correlation coefficient including tied ranks, the effect of coding, and hypothesis tests for zero correlation. It is assessed on Paper 4B, Further Statistics 2. Similar content appears in AQA (7367) and OCR (H245) statistics options.