Advanced BiologyData and Experiments

Chi-Square Goodness of Fit

χ² = Σ (observed − expected)² / expected. Compare it with the critical value for (categories − 1) degrees of freedom at p = 0.05: larger means reject the expected ratio.

Not started Jump to practice

In Dihybrid Crosses you predicted a 9 : 3 : 3 : 1 ratio. Real offspring never match a ratio exactly. Is a small miss just chance, or a sign that the genes do not behave as you assumed? The chi-square ($\chi^2$) goodness-of-fit test answers that, using the null hypothesis that the data fit the expected ratio.

Key idea

$$\chi^2 = \sum \frac{(o - e)^2}{e}$$ with $o$ the observed count and $e$ the expected count in each category. Degrees of freedom = categories − 1. If $\chi^2$ is larger than the critical value for $p = 0.05$, reject the expected ratio.
Critical values of chi-square at p = 0.05 (from the AP Biology formula sheet).
Degrees of freedom12345
Critical value (p = 0.05)3.845.997.819.4911.07

Why it works

Each term asks how far a category missed, compared with what we expected there. Squaring makes every miss count as positive. Dividing by $e$ scales the miss: being off by 10 matters a lot when you expected 20, and little when you expected 2,000. Why one less than the number of categories? Once the total is fixed, the last category is decided by the others, so only $k - 1$ categories are free to vary.

Worked examples

Worked example: Two categories

A cross of two heterozygous pea plants gives 400 offspring: 290 purple and 110 white. Do they fit 3 : 1?
  1. Expected: 3/4 of 400 = 300 purple; 1/4 of 400 = 100 white.
  2. Purple: $(290 - 300)^2/300 = 100/300 = 0.33$.
  3. White: $(110 - 100)^2/100 = 100/100 = 1.00$.
  4. $\chi^2 = 0.33 + 1.00 = 1.33$, with 2 − 1 = 1 degree of freedom.
  5. 1.33 < 3.84.

Answer: Fail to reject: the data fit 3 : 1. The difference is small enough to be chance.

Worked example: A dihybrid cross

A dihybrid cross gives 160 offspring: 78, 36, 34 and 12 in the four phenotype classes. Test the 9 : 3 : 3 : 1 ratio.
  1. Expected: 160 × 9/16 = 90, 160 × 3/16 = 30, 30, and 160 × 1/16 = 10.
  2. $(78-90)^2/90 = 144/90 = 1.60$
  3. $(36-30)^2/30 = 36/30 = 1.20$ and $(34-30)^2/30 = 16/30 = 0.53$
  4. $(12-10)^2/10 = 4/10 = 0.40$
  5. $\chi^2 = 1.60 + 1.20 + 0.53 + 0.40 = 3.73$, with 4 − 1 = 3 degrees of freedom.
  6. 3.73 < 7.81.

Answer: Fail to reject: the data are consistent with independent assortment (9 : 3 : 3 : 1).

Observed and expected counts for the dihybrid example.
Where 9 : 3 : 3 : 1 comes from.

Common mistake

Three common slips. Using percentages instead of counts (the test needs counts; 10% of 1,000 is far stronger evidence than 10% of 10). Dividing by the observed count instead of the expected one. And using the number of categories as the degrees of freedom instead of one less. Check: your expected counts must add up to the same total as the observed ones.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • College Board, AP Biology Course and Exam Description (science practices and the AP Biology Equations and Formulas sheet)
  • OpenStax, Biology 2e, 12.3 Laws of Inheritance
  • OpenStax, Biology 2e, 13.1 Chromosomal Theory of Inheritance and Genetic Linkage
@teddyrookbook GitHub