Testing Hardy‐Weinberg Equilibrium
reference:Allele Frequencies and Hardy‐Weinberg Equilibrium,Summer Institute in Statistical Genetics 2013,Module 8,Topic 2,66
Why should we test HWE locus?
When a locus is not in HWE, then this suggests one or more of the Hardy-Weinberg assumptions is false.
Departure from HWE has been used to infer the existence of natural selection, argue for the existence of assortative(non‐random) mating, and infer genotyping errors.
Two popular way to test HWE
- Chi‐Square test
- Exact test
Chi-square test
Testing procedures:
Compares observed genotype counts with the values expected under Hardy‐Weinberg for a locus with two alleles, in which
<img src="C:\Users\pro\AppData\Roaming\Typora\typora-user-images\image-20210118210834145.png" alt="image-20210118210834145" style="zoom:50%;" />
the expected is calculated from:
'A'(p) | 'a'(q) | TOTAL | |
---|---|---|---|
'A'(p) | AA() | Aa(pq) | |
'a'(q) | Aa(pq) | aa() | |
n |
test statistic:
When to use?
- the expected count should be at least 5 in every cell.
- If allele frequencies are low, and/or sample size is small, and/or there are many alleles at a locus, this may be a problem.
Exact test
The Hardy‐Weinberg exact test is based on calculating probabilities P(genotype counts | allele counts) under HWE.
To get the p‐value, sum the probabilities of all configurations with probability equal to or less that the observed configuration.
Compare two tests
- The exact test is always conservative; the chi-square test can be either conservative or anticonservative.
- Exact Test should be preferred: smaller sample sizes and/or multiallelic loci, since the chi-square test is prima facie not valid in these cases
(rule of thumb: must expect at least 5 in each cell) - The coarseness of Exact Test means it is conservative.