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)
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)