# Chi-squared test in genetics

> Biology · CIE A-Level
> Source: https://www.owlsprep.com/study/cie-9700-u17-chi-squared-test-in-genetics/

This module covers the full chi-squared goodness of fit test workflow for genetic data, including hypothesis setup, calculation, critical value comparison, and CIE-aligned conclusion writing.

**Prerequisites:** [Monohybrid and dihybrid phenotypic ratio predictions](https://www.owlsprep.com/study/cie-9700-u17-mendelian-inheritance-ratios/); [Basic probability rules for genetic crosses](https://www.owlsprep.com/study/cie-9700-u17-genetic-probability-basics/)

## Learning objectives

- Explain the purpose of the chi-squared test for validating genetic inheritance hypotheses
- Calculate chi-squared statistics correctly from observed and expected phenotypic counts
- Apply degrees of freedom and 5% critical values to accept or reject a null hypothesis
- Identify valid and invalid use cases for the chi-squared test with genetics data

## Core Principles of Chi-squared Test for Genetics

The chi-squared test is the only statistical method CIE expects you to use to check if offspring phenotypic counts from a genetic cross match a predicted Mendelian ratio. It quantifies whether differences between your real experimental counts and theoretical expected counts are caused by random chance, or a real violation of the inheritance model (e.g. linkage, epistasis).

**Chi-squared ($\chi^2$) goodness of fit test** — A non-parametric statistical test used to assess whether there is a statistically significant difference between observed categorical data counts and counts predicted by a theoretical genetic model.

*Notation:* $\chi^2$

*Example:* Testing if 87 tall and 33 short pea plant offspring match an expected 3:1 monohybrid ratio

> **Valid Data Check**
>
> This test only works for discrete, categorical phenotypic classes. You cannot use it for continuous data like plant height measured in cm.

**Check your understanding**

Test your baseline understanding of test eligibility

1. Which of the following datasets is appropriate for a chi-squared test?

   - A) Difference in average height between two plant groups
   - B) Difference between observed and expected counts of purple vs white flower offspring
   - C) Correlation between leaf size and sunlight exposure
   - D) Rate of enzyme reaction at different temperatures

   *Why:* Chi-squared only applies to discrete, categorical count data, not continuous measurements or correlation analysis.

## Step-by-Step Calculation Workflow

$$\chi^2 = \sum \frac{(O-E)^2}{E}$$

1. State a clear null hypothesis that no significant difference exists between observed and expected phenotypic counts
2. Record all observed counts from your genetic cross experiment
3. Calculate expected counts for each phenotypic class using your predicted Mendelian ratio, ensuring total expected counts equal total observed counts
4. Compute the $(O-E)$ term for each class, square it, divide by the expected value for that class
5. Sum all resulting values to get your final $\chi^2$ statistic

**Worked example:** A monohybrid cross of two heterozygous pea plants for flower colour produces 24 purple and 6 white offspring. Test against an expected 3:1 ratio.

1. Step 1: Total offspring = 24 + 6 = 30. Null hypothesis: No significant difference between observed counts and 3:1 expected ratio.
2. Step 2: Expected counts: 3/4 * 30 = 22.5 purple, 1/4 * 30 = 7.5 white.
3. $$$(24 - 22.5)^2 / 22.5 = 2.25 / 22.5 = 0.1$$$
4. $$$(6 - 7.5)^2 / 7.5 = 2.25 / 7.5 = 0.3$$$
5. $$Sum = 0.1 + 0.3 = 0.4, so $\chi^2 = 0.4$$$

> **Exam tip:** CIE awards 1 dedicated mark for ensuring your total expected counts exactly match total observed counts, do not skip this verification step.

## Degrees of Freedom and Hypothesis Conclusion

Degrees of freedom (df) for a chi-squared test in genetics is calculated as the number of phenotypic classes minus 1. For a standard 3:1 monohybrid ratio, df = 2 - 1 = 1. For a 9:3:3:1 dihybrid ratio, df = 4 - 1 = 3. CIE almost always uses the standard 5% (0.05) significance level as the threshold for conclusions.

**Critical value** — The pre-determined threshold value for a given degrees of freedom at the 5% significance level. If your calculated $\chi^2$ is lower than the critical value, you accept the null hypothesis; if higher, you reject it.

**Exam command terms**

CIE uses very specific command terms for chi-squared conclusions, learn these cues to avoid losing marks:

- **Accept the null hypothesis** — State that observed data is consistent with the expected genetic ratio, differences are due to random chance *(Calculated $\chi^2$ = 0.4 < critical value 3.84, so we accept the null hypothesis)*

- **Reject the null hypothesis** — State that observed data is significantly different from expected ratio, the proposed inheritance model is not supported *(Calculated $\chi^2$ = 9.2 > critical value 7.82, so we reject the null hypothesis)*

> **warning**
>
> Never say 'prove the null hypothesis is true' — you only have evidence to support it, CIE deducts 1 full mark for this incorrect phrasing.

## Validity Rules for Chi-squared in Genetics

- All data must be raw counts of individuals in phenotypic classes, not percentages or ratios
- No expected count for any phenotypic class can be less than 5. If this happens, combine adjacent classes
- The data points must be independent: no individual organism can be counted in more than one class
- The sample size should ideally be greater than 20 total offspring to reduce random error

**Check your understanding**

Check your validity knowledge

1. You have 4 phenotypic classes, one of which has an expected count of 3. What should you do?

   - A) Proceed with the test anyway
   - B) Merge that class with the next smallest phenotypic class
   - C) Discard that data point
   - D) Use a different significance level

   *Why:* Combining adjacent classes to ensure all expected values are >5 is the standard accepted correction for chi-squared tests.

## Common pitfalls

- **Wrong:** Using percentages or ratios directly instead of raw counts in the chi-squared formula
  - Why it fails: The test is sensitive to absolute sample size, percentages will give an artificially low or incorrect chi-squared value
  - Correct: Always convert all values back to raw individual counts before calculation
- **Wrong:** Calculating degrees of freedom as total number of offspring minus 1
  - Why it fails: Degrees of freedom only refers to the number of independent phenotypic classes, not sample size
  - Correct: Use df = number of phenotypic categories - 1, no exceptions for genetic crosses
- **Wrong:** Comparing chi-squared value to the wrong critical value for their df
  - Why it fails: CIE provides a standard table, using df=1 critical value 3.84 for all monohybrid tests, df=3 critical value 7.82 for dihybrid 9:3:3:1 tests
  - Correct: Explicitly state your df value first, then pull the matching 0.05 critical value
- **Wrong:** Writing a conclusion that says 'the ratio is 3:1' instead of 'data is consistent with 3:1 ratio'
  - Why it fails: You can never prove a genetic model is 100% correct, only that the data does not contradict it
  - Correct: Frame conclusions to refer to acceptance or rejection of the null hypothesis, not absolute proof of the inheritance ratio
- **Wrong:** Using chi-squared test for continuous variation data like seed mass
  - Why it fails: Chi-squared is only designed for discrete categorical count data
  - Correct: Use a t-test for continuous data comparisons of means

## Cheatsheet

| Step | Action for CIE Exams | Typical Mark Allocation |
| --- | --- | --- |
| 1 | State null hypothesis clearly | 1 mark |
| 2 | Calculate expected counts matching total observed | 1 mark |
| 3 | Compute sum of $(O-E)^2/E$ | 2 marks |
| 4 | State degrees of freedom = classes - 1 | 1 mark |
| 5 | Compare to 0.05 critical value | 1 mark |
| 6 | Write valid conclusion referencing null hypothesis | 1 mark |

## What's next

Mastering the chi-squared test is a critical skill for both A2 theory papers and practical assessment questions in CIE 9700, as it is regularly paired with dihybrid inheritance, epistasis, and autosomal linkage scenarios. Understanding how non-Mendelian ratios produce chi-squared values above the critical threshold will help you explain why observed offspring counts deviate from expected 9:3:3:1 ratios in cross questions. This skill also transfers directly to population genetics topics where you test for Hardy-Weinberg equilibrium using similar goodness of fit logic. Practice full chi-squared responses to ensure you hit every mark scheme point to avoid losing easy marks in extended answer sections.

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/cie-9700-u17-chi-squared-test-in-genetics/
