Hardy-Weinberg Equilibrium Calculator for 2 Alleles

Hardy-Weinberg equilibrium law states that allele and genotype frequencies in a population will remain constant from one generation to next generation in the absence of disturbing factors. In this calculator, Hardy-Weinberg equilibrium can be used to calculate the expected common homozygotes, expected heterozygotes, expected rare homozygotes and the frequency range of the 2 (p and q) alleles from the observed genotypes.

Common Homozygotes (Genotype)
Heterozygotes (Genotype)
Rare Homozygotes (Genotype)
Frequency Range
%
%

Hardy-Weinberg equilibrium law states that allele and genotype frequencies in a population will remain constant from one generation to next generation in the absence of disturbing factors. In this calculator, Hardy-Weinberg equilibrium can be used to calculate the expected common homozygotes, expected heterozygotes, expected rare homozygotes and the frequency range of the 2 (p and q) alleles from the observed genotypes.

Code to add this calci to your website  Formula:

pfreq = (CH + (0.5 * H)) / (CH + H + RH) qfreq = (RH + (0.5 * H)) / (CH + H + RH) ECH = pfreq * pfreq * (CH + H + RH) EH = 2 * pfreq * qfreq * (CH + H + RH) ERH = qfreq * qfreq * (CH + H + RH) chi1 = ((CH - ECH) * (CH - ECH)) / ECH chi2 = ((H - EH) * (H - EH)) / EH chi3 = ((RH - ERH) * (RH - ERH)) / ERH chi2 = chi1 + chi2 + chi3 Where, CH = Common Homozygotes H = Heterozygotes RH = Rare Homozygotes ECH = Expected Common Homozygotes EH = Expected Heterozygotes ERH = Expected Rare Homozygotes pfreq = p Allele Frequency pfreq = q Allele Frequency

It is also known as Hardy-Weinberg principle, model, theorem.

Example

If the observed common homozygotes is 21, heterozygotes is 10 and rare homozygotes is 2, then

Step 1 : p Allele Frequency

pfreq = (21 + (0.5 * 10)) / (21 +10 + 2)
pfreq = (21 + 5) / 33
pfreq = 0.7879

Step 2 : q Allele Frequency

qfreq = (2 + (0.5 * 10)) / (21 + 10 + 2)
qfreq = 7 / 33
qfreq = 0.2121

Step 3 : Expected CH

Expected CH = 0.78 * 0.2121 * (21 + 10 + 2)
Expected CH = 20.48

Step 4 : Expected H

Expected H = 2 * 0.78 * 0.2121 * (33)
Expected H = 11.03

Step 5 : Expected RH

Expected RH = 1.4848

Step 6 : Chi Square

chi1 = ((CH - ECH) * (CH - ECH)) / ECH
chi1 = ((21 - 20.4848) * (21- 20.4848)) / 20.4848
chi1=0.0129

chi2 = ((H - EH) * (H - EH)) / EH
chi2 = ((10 - 11.0303) * (10 - 11.0303)) / 11.0303
chi2 = 0.0962

chi3 = ((RH - ERH) * (RH - ERH)) / ERH
chi3 = ((2 - 1.4848) * (2 - 1.4848)) / 1.4848
chi3 = 0.1787

chi2 = chi1 + chi2 + chi3
chi2 = 0.0129+0.0962+0.1787
chi2 = 0.2879

Related Calculators:

Note :This statistics calculator is presented for your own personal use and is to be used as a guide only. Medical and other decisions should NOT be based on the results of this calculator. Although this calculator has been tested, we cannot guarantee the accuracy of its calculations or results.