Biology › Scientific method and quantitative biology › Choosing, carrying out and concluding a statistical test

Choosing, carrying out and concluding a statistical test

Three statistical tests cover almost every A-level investigation: chi-squared, Student's t-test and Spearman's rank correlation. You choose between them by the type of data you have. Each test then follows the same steps. You calculate a value from your readings, read a critical value from a table, and compare the two to decide what you can conclude.

Specification: AQA 3.6.1.1 (taxes and kineses), 3.7.1 (chi-squared against a predicted ratio), MS 1.2, MS 1.3, MS 1.5-1.7, MS 1.9-1.11 · OCR A Module 1.1.4; mathematical requirements (statistics) · CAIE 16.2 (chi-squared), 17.1 (the t-test), 18.2 (Spearman and Pearson), Paper 5 (analysis, conclusions and evaluation) · Edexcel A Mathematical skills appendix (statistics) · Edexcel B 8.2 vi, 10.1 vi

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.

Key terms Every definition in scientific method and quantitative biology, lesson by lesson

Before this Standard deviation · Averages, spread and the null hypothesis

COMMON MISCONCEPTION

The claim:

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

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.

Describe the drawing

A single box at the top asking what kind of question is being asked, with three arrows fanning out to three cards below. Each card names one test and lists in three short lines the kind of data it takes: counts in categories against a predicted ratio, two means from scattered measurements, and two different quantities measured on each individual, each ranked on its own.

Work from the data you collected, not from the topic. Counts in categories, two separate means, or two quantities asked whether they rise and fall together: those three questions separate the tests.
You haveYou want to knowTest
Counts of individuals in categories, and a ratio you predictedWhether the counts differ from the prediction more than chance would explainChi-squared
Two sets of measurements, each scattered about a meanWhether the two means differStudent's t-test
Two different quantities measured on each of the same individuals or quadratsWhether they rise and fall togetherSpearman'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.

A normal distribution is symmetrical and bell-shaped: the mean, median and mode coincide, and about 95% of values lie within two standard deviations of the mean. The heights of plants of one species usually look like this. A non-normal distribution is lopsided, as the number of parasites per host is. Most hosts carry few or none and a handful carry a great many, so the mean sits well above the median. A test that assumes normality should not be used on it.

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. OCR A provides its formula and can set it; the other specifications do not name it. On any board, before-and-after data call for the differences rather than a correlation: work out each individual's difference and apply the formula below to those differences.

t = d̄√n ÷ sdd̄ is the mean of the n differences and sd their standard deviation; degrees of freedom = n − 1

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.

Describe the drawing

Two number lines, one above the other. On the first the critical value of 7.81 is marked with an upright tick and everything beyond it is shaded as the rejection region; the calculated chi-squared of 3.87 sits well short of the tick, so the null hypothesis is not rejected. On the second the critical value is 2.10 and the calculated t of 2.96 sits inside the shaded region beyond it, so the null hypothesis is rejected. The two thresholds are at different places because each test has its own.

The step all three tests end on, drawn for the two worked examples below. The threshold differs for every test and every number of degrees of freedom; the decision is made by which side of it the calculated value falls on.

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, 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. 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 gives the squared rank differences 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. 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. They differ in what they work 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. 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. That covers data that are ranks or scores, an obviously skewed distribution, and a small sample. It also covers outliers a straight line would be dragged about by, and a scatter that rises steadily but along a curve instead of a line.

Describe the drawing

Three scatter graphs side by side, each holding forty points and each with two coefficients printed beneath it. In the first the points lie along a rising straight line with a little scatter, and Pearson's and Spearman's coefficients agree at about zero point nine five. In the second the points rise along a curve that flattens at the left and steepens sharply at the right, and Spearman's coefficient is exactly one while Pearson's is far below it. The third repeats the first with a single point moved far above the others, drawn in coral; Spearman's coefficient has barely moved while Pearson's has roughly halved.

Look closely at the middle panel. Nothing about that relationship is a straight line, and Spearman still comes out at a flat 1.00, because every point is where it belongs in the order even though none of them is where a line would put it.

Pearson is preferred where it is allowed because 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. Spearman assumes almost nothing, so 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 (on these specifications, Pearson's r and the t-test), and a test that does not is non-parametric (Spearman's rank and chi-squared).

Two warnings apply to both. A coefficient near zero means no linear association for Pearson and no consistent rise or fall for Spearman. 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. The conclusion says that the two quantities are associated, 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 partWhat 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 can easily miss a real but small difference. 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 reached or 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, not privet, and no statistics repair a sample drawn badly.

In the exam

Check yourself

Woodlice are placed in 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

Written to the command words the boards use. Try them on paper before opening a scheme: the marks go to points made, not to length.

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
  1. M1 expected values are 400 × 3/4 = 300 tall and 400 × 1/4 = 100 dwarf, both comfortably above 5
  2. M1 (280 − 300)² ÷ 300 = 1.33 and (120 − 100)² ÷ 100 = 4.00
  3. A1 chi-squared = 1.33 + 4.00 = 5.33
  4. 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
  5. 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
  1. M1 s1²/n1 = 3.0² ÷ 10 = 0.900 and s2²/n2 = 3.5² ÷ 10 = 1.225
  2. M1 adds the two: 0.900 + 1.225 = 2.125, then takes the square root: √2.125 = 1.46
  3. A1 the means differ by 28.0 − 24.0 = 4.0 mm, so t = 4.0 ÷ 1.46 = 2.74
  4. 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
  5. 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
  1. 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
  2. B1 a t-test asks whether the two means differ, whereas Spearman's asks whether the two variables vary together
  3. 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
  4. 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

All 15 questions with mark schemes, the other 12 set out in full on the question page.

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

Practise choosing, carrying out and concluding a statistical test with 15 original questions and point-by-point mark schemes

Flashcards on this topic · Flashcards for this unit

WORKBOOK

The questions from this topic, on paper with room to work, and a separate book of mark schemes. Free to use; please do not redistribute or sell.

Used later in Dihybrid inheritance, linkage, epistasis and the chi-squared test · Succession and environmental change