Intermediatemendelian

Chi-Square Tests in Genetics

Overview

The chi-square goodness-of-fit test asks whether observed offspring counts deviate significantly from Mendelian expectations. Compute X^2 = sum((O-E)^2/E), compare to a critical value with df = (categories - 1), and reject the hypothesis if X^2 exceeds the 5% threshold (3.841 for df=1). It is how geneticists decide if a 2.8:1 ratio is 'close enough' to 3:1.

Learning objectives

  • Compute expected counts from a hypothesis
  • Calculate the chi-square statistic
  • Determine degrees of freedom
  • Interpret p-values and make conclusions

The formula and logic

For each phenotypic class: (observed - expected)^2 / expected; sum across classes. Large X^2 means poor fit. Example: 90 round : 30 wrinkled peas vs 3:1 expectation (90:30 exactly) gives X^2 = 0, a perfect fit. Observed 85:35 gives X^2 = (85-90)^2/90 + (35-30)^2/30 = 0.28 + 0.83 = 1.11.

X^2 = sum((O-E)^2/E)

Bigger values mean worse fit; zero means perfect agreement.

Degrees of freedom and critical values

df = number of classes - 1 - (parameters estimated). For a 3:1 test: df = 1, critical value 3.84 at p = 0.05. For 9:3:3:1: df = 3, critical 7.82. If X^2 > critical, reject the hypothesis (p < 0.05); the deviation is statistically significant.

Memorize 3.84 and 7.82

df=1 -> 3.84; df=3 -> 7.82 at the 5% level. These cover most genetics tests.

Worked dihybrid example

Mendel's 315:108:101:32 (n=556) vs 9:3:3:1 expects 312.75:104.25:104.25:34.75. X^2 = 0.016 + 0.135 + 0.101 + 0.218 = 0.47, df=3, far below 7.82: the data fit beautifully (p ~ 0.93). Fisher later noted Mendel's data fit suspiciously well, sparking the 'too good to be true' debate.

p > 0.05 means 'fail to reject'

A non-significant result supports (but never proves) the hypothesis; it may simply lack power.

Rules and pitfalls

Chi-square needs expected counts >= 5 per class (pool rare classes if needed) and independent observations. Never run it on percentages; always on raw counts. A significant result rejects the SPECIFIC hypothesis tested, not Mendelian genetics itself; try linkage, lethality, or epistasis models next.

Counts, not percentages

X^2 on percentages gives nonsense; convert to observed numbers first.

Key points

  • X^2 = sum((O-E)^2/E); compare to critical value at df = classes - 1
  • df=1 critical 3.84; df=3 critical 7.82 (p = 0.05)
  • X^2 > critical means reject the hypothesized ratio
  • Use raw counts (>= 5 expected per class), never percentages

Common misconceptions

✗ Myth: A non-significant chi-square proves the hypothesis.

✓ Truth: It only fails to reject it. Small samples often 'fit' bad hypotheses through low power.

✗ Myth: Chi-square can be negative.

✓ Truth: It is a sum of squares divided by positive expectations: always >= 0.

Practice questions

Q1. For a 3:1 test with X^2 = 1.11 (df=1), the conclusion at p=0.05 is
  1. Reject 3:1
  2. Fail to reject 3:1
  3. Prove 3:1
  4. Degrees of freedom are wrong
Answer: B.

1.11 < 3.84, so the deviation is not significant; the data are consistent with 3:1.

Q2. Degrees of freedom for testing a 9:3:3:1 ratio equal
  1. 1
  2. 2
  3. 3
  4. 4
Answer: C.

df = 4 classes - 1 = 3 for the 9:3:3:1 test; the critical value at p = 0.05 is 7.82.

Q3. Chi-square tests require
  1. Percentages
  2. Raw counts with expected >= 5 per class
  3. Negative values
  4. Only two classes
Answer: B.

The approximation needs counts, and small expectations distort the statistic.

Click a question to reveal the answer and explanation.

Frequently asked questions

Why subtract 1 for degrees of freedom?

The total count is fixed, removing one independent piece of information; each additional estimated parameter removes another.

What if expected counts are below 5?

Pool adjacent classes or use Fisher's exact test; chi-square's approximation breaks down.

Did Mendel fudge his data?

Fisher (1936) showed the fit was improbably good (p ~ 0.99993 across experiments), but whether from bias, assistance, or selective reporting remains debated.