Chalk−1

Biology · Introductory biology · Worked example

Test Hardy–Weinberg equilibrium with chi-square

A sample of 100 individuals has 45 AA, 30 Aa and 25 aa. Test at α=0.05 whether the genotypes fit Hardy–Weinberg proportions.

Estimate p from the sample

The 200 gene copies include 2⁢(45)+30=120 A copies, so p=0.6 and q=0.4.

2⁢(45)+30200=0.6

Find the expected counts

Hardy–Weinberg proportions are p2=0.36, 2⁢p⁢q=0.48 and q2=0.16. Multiply each by the 100 individuals.

100⁢(0.36)=36100⁢(0.48)=48100⁢(0.16)=16

Compute χ2

Each genotype contributes (observed−expected)2/⁢expected. The differences are 9, −18 and 9.

9236+18248+9216=14.0625
9236+18248+9216=14.0625

Count the degrees of freedom

Three genotype classes give 3−1=2, and estimating p from the same data uses up one more, which leaves 1 degree of freedom.

3−1−1=1

Find the p-value and decide

With 1 degree of freedom, P⁢(χ2≥14.06)≈0.0002, computed in Statistics. That is far below 0.05, so the data give convincing evidence that this sample departs from Hardy–Weinberg proportions.

Read the pattern

The sample has 30 heterozygotes where 48 were expected, and more homozygotes than expected. A heterozygote deficit is what inbreeding, or pooling two separate subpopulations into one sample, produces. The test shows that some condition fails. It does not name which one.

Result

χ2≈14.06 with 1 degree of freedom and p≈0.0002. The data give convincing evidence that the sample departs from Hardy–Weinberg proportions, with too few heterozygotes.

Your turn

1. One like the example

Test the fish sample from the first example, 90 AA, 80 Aa and 30 aa, against its expected counts 84.5, 91 and 24.5.

Show the answer and explanation

χ2≈2.92 with 1 degree of freedom and p≈0.087. The data do not give convincing evidence of a departure at α=0.05.

The differences are 5.5, −11 and 5.5, so χ2=5.52/84.5+112/91 +5.52/24.5 ≈0.358+1.330+1.235. A p-value above 0.05 is no evidence of a departure, which is not proof of equilibrium.

5.5284.5+11291+5.5224.5≈2.92
5.5284.5+11291+5.5224.5≈2.92

2. A variation

A sample of 100 individuals has 20 AA, 70 Aa and 10 aa. Find p, the expected counts and χ2. Which way does the sample depart?

Show the answer and explanation

p=0.55, expected 30.25, 49.5 and 20.25, and χ2≈17.15 with 1 degree of freedom, p-value below 0.0001. There are too many heterozygotes.

The 200 copies include 2⁢(20)+70=110 A copies, so p=0.55 and q=0.45. The differences are −10.25, 20.5 and −10.25. The heterozygote excess is the opposite of the inbreeding pattern, as when heterozygotes survive better or mates are chosen for being unlike.

2⁢(20)+70200=0.55100⁢(0.55)2=30.25100⁢(2)⁢(0.55)⁢(0.45)=49.5100⁢(0.45)2=20.2510.25230.25+20.5249.5+10.25220.25≈17.15
2⁢(20)+70200=0.55100⁢(0.55)2=30.25100⁢(2)⁢(0.55)⁢(0.45)=49.5100⁢(0.45)2=20.2510.25230.25+20.5249.5+10.25220.25≈17.15

3. Somewhere new

Two ponds of fish never mix. Each is in Hardy–Weinberg equilibrium, one with p=0.9 and the other with p=0.1. A sample takes equal numbers from both. What heterozygote fraction does the pooled p predict, and what is really there?

Show the answer and explanation

The pooled p of 0.5 predicts 0.5 heterozygotes, but only 0.18 are there.

Each pond has 2⁢(0.9)⁢(0.1)=0.18 heterozygotes. Pooled, p=(0.9+0.1)⁢/2=0.5, which predicts 2⁢(0.5)⁢(0.5)=0.5. The pooled sample shows a large heterozygote deficit though neither pond departs, which is why a deficit alone does not prove inbreeding.

2⁢(0.9)⁢(0.1)=0.180.9+0.12=0.52⁢(0.5)⁢(0.5)=0.5

Keep exploring

In Statistics, Distributions shows the right-tail probability for χ2=14.0625 with 1 degree of freedom, about 0.00018. The Hardy–Weinberg tool reaches the same test through Send to… from the counts 45, 30 and 25.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Find the p-value in Statistics Open the Hardy–Weinberg tool Study the 12 key terms Open worked example on a board Hardy–Weinberg equation in Biology Reference

Your existing work stays on this device. Examples open as editable copies.