Hardy-Weinberg Equilibrium Calculator
Calculate expected genotype frequencies and test whether a population is in Hardy-Weinberg Equilibrium (HWE) given observed genotype counts or allele frequencies.
Formulas
Allele frequencies (from observed counts):
p = (2·NAA + NAa) / (2·N) q = 1 − p
Expected genotype frequencies under HWE:
f(AA) = p² f(Aa) = 2pq f(aa) = q²
Chi-square goodness-of-fit test:
χ² = Σ (Oi − Ei)² / Ei df = 1
Inbreeding coefficient:
F = 1 − (Hobs / Hexp) = 1 − (NAa/N) / (2pq)
Assumptions & References
- Hardy-Weinberg Equilibrium assumes: (1) large population size, (2) random mating, (3) no mutation, (4) no migration, (5) no natural selection.
- Allele frequencies are estimated from observed genotype counts using the maximum-likelihood estimator p̂ = (2NAA + NAa) / 2N.
- The chi-square test uses 1 degree of freedom (3 genotype classes − 1 constraint on total − 1 estimated parameter p).
- A p-value < 0.05 suggests significant deviation from HWE; this may indicate inbreeding, selection, population stratification, or genotyping error.
- The inbreeding coefficient F ranges from −1 (all heterozygotes) to +1 (all homozygotes); F = 0 indicates random mating.
- Hardy, G.H. (1908). Mendelian proportions in a mixed population. Science, 28(706), 49–50.
- Weinberg, W. (1908). Über den Nachweis der Vererbung beim Menschen. Jahreshefte des Vereins für vaterländische Naturkunde in Württemberg, 64, 368–382.
- Wigginton, J.E., Cutler, D.J., & Abecasis, G.R. (2005). A note on exact tests of Hardy-Weinberg equilibrium. American Journal of Human Genetics, 76(5), 887–893.