#note Population Genetics A Concise Guide (8)

Page 16

Problem 1.6 Perform a Chi-squared test for agreement of the data in Table 1.2 with the predictions of the Hardy-Weinberg law.

Note:

Table 1.2 see #note Population Genetics A Concise Guide (4)

    \[\chi ^{2}=\sum \frac{(O_{ij}-E_{ij})^{2}}{E_{ij}}=\frac{(114-135.9872)^{2}}{135.9872}+\frac{(111-116.4324)^{2}}{116.4324}+\frac{(28-24.9332)^{2}}{24.9332}\]

    \[+\frac{(32-36.5532)^{2}}{36.5532}+\frac{(15-15.6372)^{2}}{15.6372}+\frac{(5-2.4568)^{2}}{2.4568}=4.04122\]

Run Chi-squared test in Python:

from scipy.stats import chisquare
chisquare([141, 111, 28, 32, 15, 5], 
          f_exp=[0.4096*332, 0.3507*332, 0.0751*332, 0.1101*332, 0.0471*332, 0.0074*332])

Output:

Power_divergenceResult(statistic=4.041228787425606, pvalue=0.5434954248911733)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top