Chi-square test for genetics
Test whether observed offspring counts fit a 3:1, 1:1, 1:2:1 or 9:3:3:1 Mendelian ratio: χ², degrees of freedom, critical value, p-value and verdict.
Your observed counts
Expected counts come from the chosen ratio and your total. Compare χ² with the α = 0.05 critical value for df = classes − 1. Use whole-number counts; the test is most reliable when every expected count is at least 5.
How the test works
Chi-square test for genetics: common questions
Wondering about the why? Start here.
How do you do a chi-square test for a Punnett square ratio?
Work out the expected count for each class from the ratio and the total, then add up (O − E)² / E across the classes. Mendel counted 705 purple and 224 white pea flowers, a total of 929; a 3 : 1 ratio predicts 696.75 and 232.25, so χ² = 0.098 + 0.293 = 0.391. That is below the critical value of 3.841 for 1 degree of freedom, so the data fit 3 : 1 and the hypothesis is not rejected.
Read: Mendelian inheritanceWhat does the critical value mean?
The critical value is the largest χ² that chance alone would produce 95% of the time when the hypothesis is true (α = 0.05). It depends on the degrees of freedom: 3.841 for df = 1, 5.991 for df = 2, and 7.815 for df = 3. If your χ² is at or below it, the deviation is what sampling could produce, so you do not reject the ratio; the tool also reports the exact p-value, 0.532 for Mendel’s flower data.
Predict the expected ratioWhat is a degree of freedom in a chi-square test?
Degrees of freedom equal the number of phenotype classes minus one, because once the total is fixed the last class count is not free to vary. A 3 : 1 or 1 : 1 test has df = 1, a 1 : 2 : 1 test has df = 2, and a 9 : 3 : 3 : 1 dihybrid test has df = 3. Mendel’s dihybrid counts of 315 : 108 : 101 : 32 give χ² = 0.47 against a critical value of 7.815 (p ≈ 0.93), an excellent fit; for reliable results every expected count should be at least 5.
Practice genetics statistics