AP Biology · Unit 5 lecture · Part 7 of 12 · 9 min

5.3 to 5.4 Testing ratios with chi-squareIs it chance, or is it real?

Mrs. Otero
Real counts never land exactly on 3 : 1. So when you get 412 to 148, is that 'close enough', or is something else going on? The chi-square test turns that gut feeling into a decision you can defend. It's on almost every AP Biology exam.

Start with a null hypothesis: a statement that there is no real difference between what you observed and what your model predicts, so any difference is due to random chance. In genetics, the model is usually a Mendelian ratio. The null hypothesis might be: there is no statistically significant difference between the observed counts and the counts expected from a 3 : 1 ratio.

?Wait, what's a null hypothesis again?
It's the 'nothing special is happening' hypothesis that a statistical test tries to find evidence against. You never prove it. You either reject it (the data are too far from the prediction to blame on chance) or fail to reject it (the data are close enough).

The test has four parts. First, use the predicted ratio and the total number of offspring to get the expected count (e) for each category. Second, compute $\chi^2 = \sum \frac{(o - e)^2}{e}$, one term for each category, where o is the observed count. Third, find the degrees of freedom: df = number of categories − 1. Fourth, compare $\chi^2$ to the critical value for that df at p = 0.05 from the formula sheet.

pdf 1df 2df 3df 4df 5
0.053.845.997.819.4911.07
0.016.639.2111.3413.2815.09
Critical values from the AP Biology formula sheet. Use the p = 0.05 row unless the question says otherwise.

The decision rule: if $\chi^2$ is greater than the critical value, reject the null hypothesis; the difference is statistically significant and probably not due to chance alone. If $\chi^2$ is less than or equal to the critical value, fail to reject the null hypothesis; the data are consistent with the predicted ratio. A bigger $\chi^2$ means a bigger gap between data and prediction.

?Wait, what does p = 0.05 mean?
It's the cutoff for 'too unlikely to be chance'. If the null hypothesis were true, a chi-square value as big as the critical value or bigger would show up only 5% of the time. Data that far off are strong enough evidence to reject the null.
observed412purple148yellowexpected (3:1)420purple140yellow
Observed counts from an ear-of-corn cross next to the counts expected from 3 : 1. The bars look close, but chi-square makes that judgment exact.
A full chi-square test
Two corn plants heterozygous for kernel color (purple P dominant to yellow p) are crossed. You count 412 purple and 148 yellow kernels. (a) State the null hypothesis. (b) Calculate chi-square. (c) Give the degrees of freedom and critical value. (d) State and explain your conclusion.
Phenotypeoe(o - e)² / e
purple41242064 / 420 = 0.15
yellow14814064 / 140 = 0.46
total560560χ² = 0.61
  1. (a) Null: there is no statistically significant difference between the observed counts and those expected from a 3 : 1 ratio (Pp × Pp). Any difference is due to chance.
    Why?
    Write the null as "no significant difference". Writing the alternative instead is a classic lost point.
  2. (b) Total = 412 + 148 = 560. Expected: 3/4 × 560 = 420 purple and 1/4 × 560 = 140 yellow.
    Why?
    Expected values are counts, never percentages or ratios.
  3. $\chi^2 = \frac{(412 - 420)^2}{420} + \frac{(148 - 140)^2}{140} = \frac{64}{420} + \frac{64}{140} = 0.15 + 0.46 = 0.61$.
    Why?
    Square each difference before dividing, so the minus sign disappears.
  4. (c) Two categories, so df = 2 − 1 = 1. Critical value at p = 0.05: 3.84.
  5. (d) 0.61 < 3.84, so fail to reject the null hypothesis. The data are consistent with a 3 : 1 ratio, which supports both parents being heterozygous with purple dominant.
    Why?
    Conclusions need the comparison, the decision and what it means for the biology.

Answer: χ² = 0.61, df = 1, critical value 3.84. 0.61 < 3.84, so fail to reject the null: the data fit 3 : 1.

Stuck? Get a hint
  1. Expected = fraction from the ratio × the total count.
  2. One (o − e)² / e term per category, then add.
  3. df = categories − 1. Compare χ² to the table value, not to 0.05.
Pause and think
A different cross gives χ² = 5.2 with two categories. Do you reject the null? What if the same χ² came from four categories?
I thought about it. Show me
With two categories, df = 1 and the critical value is 3.84; 5.2 > 3.84, so reject. With four categories, df = 3 and the critical value is 7.81; 5.2 < 7.81, so fail to reject. The same χ² can lead to different conclusions, which is why df matters.

Mendel's own numbers make a nice test. In his dihybrid cross of round yellow peas, he counted 315 round yellow, 108 round green, 101 wrinkled yellow and 32 wrinkled green seeds. Are those consistent with 9 : 3 : 3 : 1?

Test Mendel's data
Mendel's dihybrid F2: 315 round yellow, 108 round green, 101 wrinkled yellow, 32 wrinkled green. Test the hypothesis that the two genes assort independently (9 : 3 : 3 : 1).
Seed typeoe (9:3:3:1)(o - e)² / e
round, yellow315312.750.016
round, green108104.250.135
wrinkled, yellow101104.250.101
wrinkled, green3234.750.218
total556556χ² = 0.470
  1. Null: no significant difference between the observed counts and those expected from 9 : 3 : 3 : 1.
  2. Total = 556. Expected: 9/16 × 556 = 312.75, 3/16 × 556 = 104.25 (twice), 1/16 × 556 = 34.75.
    Why?
    Expected counts can be decimals. Don't round them to whole numbers before you calculate.
  3. Terms: 0.016 + 0.135 + 0.101 + 0.218, so χ² = 0.470.
  4. Four categories: df = 3, critical value 7.81. 0.470 < 7.81, so fail to reject the null. The data are consistent with independent assortment.

Answer: χ² = 0.470 < 7.81 (df = 3): fail to reject. The genes for seed shape and color assort independently.

Stuck? Get a hint
  1. The four expected fractions are 9/16, 3/16, 3/16 and 1/16.
  2. Keep the decimals in the expected counts.
  3. Four categories gives df = 3.
Check yourself
Pink snapdragons (Rr) are crossed with each other. The offspring: 72 red, 160 pink and 88 white. The expected ratio is 1 : 2 : 1. Which conclusion is correct at p = 0.05?
  1. Aχ² = 1.6, which is less than 5.99, so fail to reject the null.
  2. Bχ² = 1.6, which is less than 3.84, so reject the null.
  3. Cχ² = 1.6, which is greater than 0.05, so reject the null.
  4. Dχ² = 3.2, which is greater than 3.84, so reject the null.
Show the answer

A. Expected: 80, 160, 80. χ² = 64/80 + 0/160 + 64/80 = 1.6. Three categories give df = 2 and a critical value of 5.99, and 1.6 < 5.99, so fail to reject. Comparing χ² to 0.05 is the top trap: 0.05 only tells you which row of the table to read.

Exam tip from Mrs. O

Never write "accept the null" or "the null is proven". Write "fail to reject the null hypothesis". And when the question asks for the null, start with "There is no statistically significant difference between..." so you can't write the alternative by accident.

  • Null hypothesis: no significant difference between observed and expected; differences are due to chance.
  • χ² = Σ (o − e)² / e, using counts. df = categories − 1. Critical value at p = 0.05 from the sheet.
  • χ² > critical value: reject the null. χ² ≤ critical value: fail to reject.
  • State the conclusion in biology words: the data do or do not support the proposed inheritance pattern.