Biology › Scientific method and quantitative biology › Choosing, carrying out and concluding a statistical test
Choosing, carrying out and concluding a statistical test
Three tests cover almost everything an A-level investigation produces, and choosing between them is a question about the shape of the data rather than about the biology. Each then runs the same way: a number worked out from the readings, a critical value read from a table, and a comparison that decides what conclusion can be drawn.
In two parts Statistics for biologists: spread, error bars and the three tests, part 2 of 2. Part 1 is Averages, spread and the null hypothesis.
Before this Standard deviation · Statistics
COMMON MISCONCEPTION
If the calculated value is below the critical value, the test has shown there is no difference.
If the calculated value does not reach the critical value, the null hypothesis is not rejected. The data do not provide sufficient evidence against it at the stated probability level. That is not the same as showing there is no difference or association, and a small sample can fail to detect a real one.
What you should be able to do
- Choose between chi-squared, a t-test and Spearman's rank for a given question, and find the degrees of freedom.
- Compare a calculated value with a critical value and write a conclusion containing all four required elements.
- Name the condition each test assumes, and say what to do when the data do not meet it.
- Choose between Spearman's rank and Pearson's linear correlation coefficient for a given set of paired data, and justify the choice.
Choosing the test
Three tests cover almost everything an A-level investigation produces, and choosing between them is a question about the shape of your data rather than about the biology.
| You have | You want to know | Test |
|---|---|---|
| Counts of individuals in categories, and a ratio you predicted | Whether the counts differ from the prediction more than chance would explain | Chi-squared |
| Two sets of measurements, each scattered about a mean | Whether the two means differ | Student's t-test |
| Two different quantities measured on each of the same individuals or quadrats | Whether they rise and fall together | Spearman's rank correlation, or Pearson's r where both quantities are normally distributed measurements and the scatter is a straight line |
Two conditions are worth checking first. Chi-squared needs raw counts, never percentages, and every expected value should be at least 5; combining categories or collecting more data is the fix when they are not. The t-test assumes measurements that are continuous and roughly normally distributed, which lengths, masses and volumes usually are and counts of individuals usually are not, and it assumes the two samples are about equally spread. That last condition is stated less often than the others, and the A-level formula depends on it, as the next section shows.
One distinction decides the choice here: 'two measurements per individual' does not automatically mean Spearman. Spearman asks whether two different quantities are associated, moisture against species count. Measuring the same quantity twice on each individual, before and after a treatment, is a difference question, and the tool built for it is the paired t-test, a variant A-level papers rarely set but which exists; if a question supplies before-and-after data, work with the differences rather than reaching for a correlation.
All three then work the same way. Calculate a number from your data, work out the degrees of freedom, look up the critical value at p = 0.05, and compare. For all three, a calculated value at or above the critical value means reject the null hypothesis. Spearman's is the one to watch, because its value runs from −1 to +1 and it is the size you compare: a correlation of −0.87 is exactly as significant as one of +0.87 and points the other way.
That threshold is not a number to learn. Chi-squared with 3 degrees of freedom needs 7.81, a t-test with 18 needs 2.10, and Spearman with ten pairs needs 0.648; all three come from a table the paper supplies, read against the conditions of your own investigation. What carries from one test to the next is the comparison, not the number.
The three tests, worked
The numbers below are constructed rather than collected, chosen so the arithmetic stays readable. The sequence of steps is identical every time.
chi-squared = Σ [ (O − E)² ÷ E ]O is the observed count, E the expected count, and the sum runs over every category
Chi-squared against a predicted ratio
A dihybrid cross is predicted to give offspring in the ratio 9:3:3:1. Of 320 offspring, the four phenotypes are counted as 168, 66, 70 and 16. Test whether the results differ significantly from the prediction.
Show the working
Null hypothesis: there is no significant difference between the observed numbers of each phenotype and the numbers expected from a 9:3:3:1 ratio.
Expected values. The ratio has 9 + 3 + 3 + 1 = 16 parts and 320 ÷ 16 = 20 offspring per part, so the expected counts are 180, 60, 60 and 20, every one well above 5.
The sum. (168 − 180)² ÷ 180 = 0.80; (66 − 60)² ÷ 60 = 0.60; (70 − 60)² ÷ 60 = 1.67; and (16 − 20)² ÷ 20 = 0.80. Adding them gives chi-squared = 3.87.
Degrees of freedom = number of categories − 1 = 4 − 1 = 3. The critical value at p = 0.05 with 3 degrees of freedom is 7.81.
Conclusion. 3.87 is less than 7.81, so the null hypothesis is not rejected. There is no significant difference between the observed results and a 9:3:3:1 ratio, and the differences that exist can be attributed to chance, a result consistent with two genes assorting independently.
Use the t-test formula and degrees-of-freedom rule supplied by the examination paper or data sheet. Cambridge International 9700 supplies a two-sample formula with n₁ + n₂ − 2 degrees of freedom for the data it sets. If the samples have very different spreads, identify this as a limitation of applying that model.
t = (x̄₁ − x̄₂) ÷ √( s₁²/n₁ + s₂²/n₂ )take the difference between the means as a positive number; degrees of freedom = n₁ + n₂ − 2, on samples whose standard deviations are of similar size
Beyond A level the two-sample case is handled by two named tests. Welch's t-test uses the denominator above but calculates its degrees of freedom from the two variances rather than from n₁ + n₂ − 2. The pooled Student t-test, to which n₁ + n₂ − 2 properly belongs, combines the two spreads into a single pooled estimate first. The A-level formula takes the denominator from one and the degrees of freedom from the other, which is a simplification that holds where the samples have similar spreads.
A t-test on two means
Limpet shell lengths are measured on a sheltered shore and on an exposed shore, ten from each. The sheltered sample has a mean of 22.0 mm with a standard deviation of 2.0 mm; the exposed sample has a mean of 19.0 mm with a standard deviation of 2.5 mm. Test whether the means differ significantly.
Show the working
Null hypothesis: there is no significant difference between the mean shell length of limpets on the sheltered shore and the mean shell length of limpets on the exposed shore.
Check the condition. The two standard deviations are 2.0 mm and 2.5 mm, close enough in size for the formula and its n₁ + n₂ − 2 degrees of freedom to belong together. Had one sample been five times as variable as the other, the test would still be the one to run and the evaluation would have to say that the result is approximate.
The denominator first. s₁²/n₁ = 4.0 ÷ 10 = 0.400 and s₂²/n₂ = 6.25 ÷ 10 = 0.625, totalling 1.025, and √1.025 = 1.012.
The statistic. The means differ by 22.0 − 19.0 = 3.0 mm, so t = 3.0 ÷ 1.012 = 2.96.
Degrees of freedom = 10 + 10 − 2 = 18, and the critical value at p = 0.05 is 2.10.
Conclusion. 2.96 is greater than 2.10, so the null hypothesis is rejected. There is a significant difference between the means: limpets on the sheltered shore have shells 3.0 mm longer on average, and a difference this large would arise in fewer than 5 samples in 100 if the two shores really held the same population.
rs = 1 − [ 6 Σd² ÷ n(n² − 1) ]d is the difference between the two ranks of one individual, and n is the number of individuals, not the number of measurements
Spearman's rank on ten quadrats
Soil moisture and the number of plant species are recorded in each of ten quadrats. Ranking each variable from 1 to 10 and taking the difference in rank for each quadrat gives squared differences of 1, 4, 4, 1, 1, 4, 4, 1, 1 and 1. Test for a correlation.
Show the working
The example provides the paired ranks directly. Spearman's rank coefficient is calculated from the rank differences, so the original measurements are not required for this calculation.
Null hypothesis: there is no significant correlation between soil moisture content and the number of plant species per quadrat.
The statistic. Σd² = 22, and with n = 10, n(n² − 1) = 10 × 99 = 990. So rs = 1 − (6 × 22) ÷ 990 = 1 − 0.133 = 0.87.
The critical value for n = 10 at p = 0.05 is 0.648. Spearman uses n, the number of pairs, rather than a degrees-of-freedom figure.
Conclusion. 0.87 is greater than 0.648, so the null hypothesis is rejected: there is a significant positive correlation between soil moisture and the number of plant species. It is positive because rs is positive, and being significant does not make it causal, because both could be responding to something else about where the quadrats fell.
Ranking has one detail that gets tested: equal readings take the mean of the positions they occupy. Values of 3, 7, 7 and 9 rank as 1, 2.5, 2.5 and 4, because the two sevens would have held positions 2 and 3, and the next value still takes position 4.
There is a fourth test on the Cambridge International list, and it is Spearman's partner rather than a separate topic. Pearson's linear correlation coefficient, written r, answers the same question about two quantities measured on the same individuals, and it also comes out between −1 and +1 with the sign giving the direction. The difference is what it works on. Spearman throws the measurements away and keeps their order; Pearson uses the measurements themselves, and asks how well a straight line fits them.
r = Σ[(x − x̄)(y − ȳ)] ÷ √( Σ(x − x̄)² × Σ(y − ȳ)² )x and y are the two measurements on one individual and x̄ and ȳ are their means; the critical value is read for n − 2 degrees of freedom, where n is the number of pairs
That difference decides which one to use, and the rule is worth learning as a sequence rather than as a slogan. Plot the scatter graph first, before choosing anything. Use Pearson's r when both variables are continuous measurements, when each is roughly normally distributed, and when the scatter looks like a straight line with the points spread evenly along it. Use Spearman's rank when any of those fails: when the data are ranks or scores rather than measurements, when a distribution is obviously skewed, when the sample is small, when there are outliers a straight line would be dragged about by, or when the scatter rises steadily but along a curve rather than a line.
The reason for preferring Pearson where it is allowed is that it uses more of the information: it knows how far apart the readings are and not merely which came first, so with data that meet its conditions it detects a real association from a smaller sample. The reason for reaching for Spearman is that it assumes almost nothing, which is why it is the test A-level fieldwork usually needs. The two names for that distinction are examinable: a test that assumes a distribution is parametric, and Pearson's r and the t-test are the parametric tests on these specifications, while a test that does not is non-parametric, and Spearman's rank and chi-squared are the non-parametric ones.
Two warnings apply to both. A coefficient near zero means no linear association for Pearson and no consistent rise or fall for Spearman, and neither of those means no relationship: a variable that rises and then falls again can give an r of almost nothing while being strongly related to the other. And a significant correlation of either kind is still a correlation, so the conclusion says that the two quantities are associated and not that one causes the other.
Writing the conclusion
Report four elements in the conclusion: the calculated and critical values, the probability level and degrees of freedom or sample size used, the decision about the null hypothesis, and the biological interpretation.
| The part | What it looks like |
|---|---|
| The comparison | 'The calculated value of 2.96 is greater than the critical value of 2.10…' |
| The conditions | '…at p = 0.05 with 18 degrees of freedom.' |
| The decision | 'The null hypothesis is therefore rejected.' |
| The biology | 'There is a significant difference between the mean shell lengths on the two shores.' |
If the calculated value does not reach the critical value, state that the null hypothesis is not rejected. This means that the data do not provide sufficient evidence against it; it does not show that the null hypothesis is true. The alternative wording, that the null hypothesis is accepted, is widely used and accepted at A level, but it asserts more than the test supports, since a small sample fails to reject almost any null hypothesis. In an evaluation, 'a larger sample might have detected a difference this one could not' is the clause to add.
Reserve 'significant' for the outcome of a test. In ordinary use it means important; here it means the calculated value exceeded the critical value at the stated probability. A difference is not significant unless a test says so, and a significant difference is not necessarily a large one.
TRY IT: Reading a result properly
A student compares the mean number of stomata per square millimetre on the upper and lower surfaces of privet leaves, twelve leaves of each. The calculated value of t is 1.84 and the critical value at p = 0.05 with 22 degrees of freedom is 2.07. Write the conclusion, and say what the student should do next.
Check your answer
The calculated value of 1.84 is less than the critical value of 2.07 at p = 0.05 with 22 degrees of freedom, so the null hypothesis is not rejected. There is no significant difference between the mean number of stomata per square millimetre on the two surfaces of the leaves sampled.
The student must not write that the two surfaces have the same stomatal density. Failing to detect a difference is not the same as showing there is none, and twelve leaves per surface gives the test limited power to detect a small one.
What to do next is plan a larger study, its size decided in advance: a larger sample raises the degrees of freedom, lowers the critical value and shrinks the standard error of each mean. Plan it as a fresh investigation rather than topping up this data set until the answer changes, because stopping when a result appears inflates the chance of a false positive. The sampling is worth checking too. Twelve leaves from one plant describe that plant rather than privet, and no statistics repair a sample drawn badly.
In the exam
- Quote the critical value with its conditions: the probability level and either the degrees of freedom or n. A comparison with an unlabelled number is not a comparison.
- Degrees of freedom differ by test. Chi-squared against a predicted ratio (goodness of fit) uses categories − 1; a chi-squared association table uses (rows − 1)(columns − 1); the t-test uses n₁ + n₂ − 2; and Spearman uses n itself.
- Use the t-test formula the paper or the board's data sheet supplies, with the degrees of freedom that go with it. More than one two-sample t-test exists and they differ in exactly those two places.
- Where a conclusion goes the other way, 'the null hypothesis is not rejected' is the safer sentence. 'Accepted' is widely credited, but nothing in the test shows a null hypothesis to be true.
- Chi-squared needs raw counts, never percentages, and its expected values must be at least 5 for the result to be trusted.
- For a correlation, plot the scatter before choosing the test. Pearson's r needs normally distributed measurements and a straight-line scatter; Spearman's rank needs neither and is the safe choice for fieldwork.
- Do not write that a test proves anything. It supports rejecting or retaining a null hypothesis at a stated probability, and that is the strongest verb available.
Check yourself
Two groups of woodlice are given a choice chamber, one half humid and one half dry. Of 80 woodlice, 58 are found on the humid side and 22 on the dry side after ten minutes. State a null hypothesis, choose and carry out a suitable test, and write the conclusion. The critical value of chi-squared at p = 0.05 with 1 degree of freedom is 3.84.
Answer
Test: chi-squared, because the data are counts of individuals in two categories against a ratio that can be predicted, since with no effect of humidity the woodlice would be spread 1:1.
Null hypothesis: there is no significant difference between the observed numbers of woodlice on the humid and dry sides and the numbers expected if humidity had no effect on their distribution.
Calculation: the expected values are 80 ÷ 2 = 40 on each side, both well above 5. Then (58 − 40)² ÷ 40 = 8.10 and (22 − 40)² ÷ 40 = 8.10, so chi-squared = 16.2. Degrees of freedom = 2 categories − 1 = 1, and the critical value is 3.84.
Conclusion: 16.2 is far greater than 3.84 at p = 0.05 with 1 degree of freedom, so the null hypothesis is rejected. Significantly more woodlice were found on the humid side than an even distribution would give.
Worth adding in an evaluation: the test shows the distribution was uneven, not why. Separating a kinesis, in which woodlice simply move less once they reach damp air and so accumulate, from a taxis, in which they move towards it directionally, needs individual paths tracked rather than a headcount at the end.
Questions
Question 15 marks
Two heterozygous pea plants are crossed and the offspring are expected in a ratio of 3 tall to 1 dwarf. Of 400 offspring, 280 are tall and 120 are dwarf. Calculate chi-squared and use it to reach a conclusion. The critical value at p = 0.05 with 1 degree of freedom is 3.84.
Mark scheme
- M1 expected values are 400 × 3/4 = 300 tall and 400 × 1/4 = 100 dwarf, both comfortably above 5
- M1 (280 − 300)² ÷ 300 = 1.33 and (120 − 100)² ÷ 100 = 4.00
- A1 chi-squared = 1.33 + 4.00 = 5.33
- B1 degrees of freedom = 2 categories − 1 = 1, and the calculated value of 5.33 is greater than the critical value of 3.84 at p = 0.05
- B1 the null hypothesis is rejected: there is a significant difference between the observed numbers and a 3:1 ratio, so the difference is unlikely to have arisen by chance alone
Question 25 marks
Two samples of ten daisy flower heads are measured for diameter: the population growing in full sun has a mean diameter of 28.0 mm with a standard deviation of 3.0 mm, and the population growing in shade has a mean diameter of 24.0 mm with a standard deviation of 3.5 mm. Calculate Student's t, and use it to reach a conclusion. The critical value at p = 0.05 with 18 degrees of freedom is 2.10.
Mark scheme
- M1 s1²/n1 = 3.0² ÷ 10 = 0.900 and s2²/n2 = 3.5² ÷ 10 = 1.225
- M1 adds the two: 0.900 + 1.225 = 2.125, then takes the square root: √2.125 = 1.46
- A1 the means differ by 28.0 − 24.0 = 4.0 mm, so t = 4.0 ÷ 1.46 = 2.74
- B1 degrees of freedom = 10 + 10 − 2 = 18, and the critical value at p = 0.05 is 2.10; the calculated value of 2.74 is greater than 2.10
- B1 the null hypothesis is rejected: there is a significant difference between the mean flower diameters, with daisies in full sun significantly larger than those in shade
Question 34 marks
Compare Student's t-test with Spearman's rank correlation, referring to the data each one needs and the question each one answers.
Mark scheme
- B1 a t-test needs two separate sets of measurements each scattered about a mean, whereas Spearman's needs two different quantities measured on each of the same individuals or quadrats
- B1 a t-test asks whether the two means differ, whereas Spearman's asks whether the two variables vary together
- B1 the t-test uses the measurements themselves and assumes they are continuous and roughly normally distributed, whereas Spearman's replaces every measurement by its rank and never sees the values
- B1 degrees of freedom for the t-test are n₁ + n₂ − 2, whereas Spearman's critical value is read against n, the number of pairs; for both, a calculated value at or above the critical value means the null hypothesis is rejected
Question 43 marks
Compare Pearson's linear correlation coefficient with Spearman's rank correlation coefficient.
Mark scheme
- B1 both test whether two quantities measured on the same individuals are associated, and both give a value between −1 and +1 whose sign shows the direction
- B1 Pearson uses the measurements themselves and tests how well a straight line fits them, whereas Spearman replaces each measurement by its rank and tests only whether the two rise or fall together
- B1 Pearson is parametric, so it assumes each variable is roughly normally distributed and the relationship is linear, whereas Spearman is non-parametric and assumes neither
Question 53 marks
A student records soil moisture and the number of plant species in each of twelve quadrats. The scatter graph rises steadily but curves, and two quadrats have moisture readings far above the rest. Suggest which correlation test the student should use, and justify the choice.
Mark scheme
- B1 Spearman's rank correlation coefficient
- B1 Pearson's r assumes the relationship is linear and here the scatter is a curve, so a straight line does not describe the data
- B1 the two extreme readings would have a large effect on Pearson's r, whereas Spearman uses only the order of the values, so an extreme reading counts as one rank and nothing more
Question 62 marks
A biologist calculates Pearson's r for two variables and obtains a value of 0.04. Explain why this does not show that the two variables are unrelated.
Mark scheme
- B1 Pearson's r measures how well a straight line fits the data, so a value near zero shows only that there is no linear association
- B1 a variable that rises and then falls again, or that is related in any other curved way, can give a value near zero while still being strongly related, which is why the scatter graph is plotted before the test is chosen
Worth remembering
- Counts against a predicted ratio go to chi-squared, two means to a t-test, two different quantities measured on each individual to Spearman's rank. The same quantity measured before and after on each individual is a difference question, and belongs to the paired t-test.
- The A-level t-test formula assumes two samples of roughly equal spread, and its n₁ + n₂ − 2 degrees of freedom belong to that assumption.
- Calculated value at or above the critical value means reject the null hypothesis; below it means the data give no reason to.
- Significant means unlikely to have arisen by chance under the null hypothesis. It does not mean large, and it does not mean proved.
- Pearson's r and Spearman's rank both run from −1 to +1 and both test for association. Pearson uses the measurements and assumes a normal distribution and a linear relationship; Spearman uses the ranks and assumes neither.
- Parametric tests assume a distribution, and Pearson's r and the t-test are the parametric ones here. Spearman's rank and chi-squared are non-parametric.
CHECK YOUR PROGRESS
Rate how confident you are with each objective for this lesson. Ratings are saved in this browser, on this device, unless you sign in.
- Choose between chi-squared, a t-test and Spearman's rank for a given question, and find the degrees of freedom.
- Compare a calculated value with a critical value and write a conclusion containing all four required elements.
- Name the condition each test assumes, and say what to do when the data do not meet it.
- Choose between Spearman's rank and Pearson's linear correlation coefficient for a given set of paired data, and justify the choice.
Open the full revision checklist to see every objective in the curriculum in one place.
Practise this lesson
All 15 questions for this topic, with point-by-point mark schemes, cover both parts and are filed under the first, which is where their printed codes point.
WORKBOOK
The same questions as the player, on paper with room to work, and a separate book of mark schemes. Free to use; please do not redistribute or sell.