Chi-squared test
Studying this course? Keep your progress in one place.
Key facts
- The chi-squared test checks whether observed counts fit an expected ratio, or differ by chance.
- Use whole-number counts of categories, never percentages. .
- Degrees of freedom = number of classes − 1.
- If is less than the critical value at p = 0.05, the difference is not significant: accept the null hypothesis.
- If it is greater, the difference is significant: reject the null hypothesis.
Why use the chi-squared test
Observed numbers rarely match expected ratios exactly, so χ² tests whether the differences are significant or due to chance.
In genetic crosses, observed numbers rarely match expected ratios exactly, because fertilisation is random.
The chi-squared (χ²) test compares the goodness of fit of observed phenotypic ratios with expected ratios. It tells you whether differences are significant or due to chance.
Use it for categorical data as whole-number counts (not percentages), with a large enough sample.
- Observed
- Expected
- Chi-squared testdo observed counts fit the expected ratio?
Which data can be used in a chi-squared test?
Null hypothesis and the formula
State a null hypothesis of no significant difference, then work out the expected numbers and sum (O − E)² ÷ E over all classes.
State a null hypothesis: there is no significant difference between observed and expected numbers (any difference is due to chance).
is the observed number and the expected number in each class. Work out by dividing the total by the ratio parts.
- 1
State the null hypothesis
no significant difference between observed and expected
- 2
Work out E for each class
total divided by the ratio parts
- 3
Calculate (O − E)² ÷ E
for every class
- 4
Add them to get χ²
e.g. 0.083 + 0.25 = 0.33
- Chi-squared
Worked example
A cross gives 295 round and 105 wrinkled seeds. A 3 : 1 ratio expects 300 and 100. Calculate χ².
- 1
Round: (295 − 300)² ÷ 300 = 25 ÷ 300 = 0.083.
- 2
Wrinkled: (105 − 100)² ÷ 100 = 25 ÷ 100 = 0.25.
- 3
Add them: 0.083 + 0.25.
In the formula, what does E stand for?
Degrees of freedom and critical values
Degrees of freedom are the number of classes minus 1. Compare χ² with the critical value at p = 0.05.
The degrees of freedom equal the number of classes − 1: 1 for a monohybrid cross with two phenotypes, 3 for a dihybrid cross with four.
Compare your calculated χ² with the critical value at p = 0.05, a 5% probability that the difference is due to chance.
Common critical values at 5%: 1 df = 3.84, 2 df = 5.99, 3 df = 7.82.
A dihybrid cross has four phenotype classes. How many degrees of freedom?
Drawing conclusions
If χ² is below the critical value, the difference is not significant; if it is above, the difference is significant and the expected ratio is wrong.
If χ² is less than the critical value, the difference is not significant (p > 0.05). Accept the null hypothesis: any difference is due to chance and the data fit the expected ratio.
If χ² is greater than the critical value, the difference is significant (p < 0.05). Reject the null hypothesis: the difference is unlikely to be due to chance.
Example: 40.4 > 7.82 shows genes are not assorting independently, suggesting linkage. The test shows whether a difference is significant; it does not explain why.
| χ² less than critical value | χ² greater than critical value | |
|---|---|---|
| Significance | Not significant (p > 0.05) | Significant (p < 0.05) |
| Null hypothesis | Accept: difference due to chance | Reject: expected ratio not correct |
χ² less than critical value
- Significance:
- Not significant (p > 0.05)
- Null hypothesis:
- Accept: difference due to chance
χ² greater than critical value
- Significance:
- Significant (p < 0.05)
- Null hypothesis:
- Reject: expected ratio not correct
χ² = 0.33 with 1 degree of freedom (critical value 3.84). What is the conclusion?
Using the test in genetics
Use χ² to test ratios such as 3 : 1, 1 : 2 : 1, 9 : 3 : 3 : 1, 1 : 1 : 1 : 1 or epistatic ratios, with expected numbers of at least 5.
A result that fits 9 : 3 : 3 : 1 supports independent assortment. A significant result for a test cross suggests the genes may be linked, or that other factors such as selection are involved.
Larger samples give more reliable results. If expected numbers are very small (below 5), the test is not reliable.
- 1
Choose the expected ratio
e.g. 3 : 1, 9 : 3 : 3 : 1, 1 : 1 : 1 : 1
- 2
Check expected numbers
each at least 5
- 3
Calculate χ² and compare with the critical value
at p = 0.05
- 4
Conclude
fits: supports independent assortment; does not fit: genes may be linked or selection involved
| Fits expected ratio | Does not fit | |
|---|---|---|
| Result | Not significant | Significant |
| Suggests | Supports independent assortment | Genes may be linked, or selection involved |
Fits expected ratio
- Result:
- Not significant
- Suggests:
- Supports independent assortment
Does not fit
- Result:
- Significant
- Suggests:
- Genes may be linked, or selection involved
A test cross is expected to give 1 : 1 : 1 : 1 but the χ² result is significant. What may this suggest?
Try an exam question
A student crossed two heterozygous plants and expected a 3 : 1 ratio. Of 160 offspring, 126 were dominant and 34 recessive. Calculate χ² and state the conclusion. Critical value at 5% for 1 degree of freedom = 3.84.
[4 marks]
- [1]Expected numbers: 120 dominant and 40 recessive.
- [1]Dominant: (126 − 120)² ÷ 120 = 0.30; recessive: (34 − 40)² ÷ 40 = 0.90.
- [1]χ² = 1.2.
- [1]1.2 is less than 3.84, so the difference is not significant: it is due to chance and the data fit 3 : 1.
That's the notes covered.
Carry on to the next subtopic.
Try a question
How many round seeds does she expect among the 400 seeds?
1 mark, marked against the mark scheme
How many round seeds does she expect among the 400 seeds?
1 mark, marked against the mark scheme