## Goodness of Fit

In the experiment on pea breeding Mendel's theory predicts the probabilities of occurrence associated with the types of progeny, say ``round yellow'', ``wrinkled yellow'', ``round green'', and ``wrinkled green.'' Here we want to test whether the data from observation is consistent with his theory--goodness of fit.

The model probabilities

`Probability`or

`Percentage`) for

*k*categories or ``cells.'' Out of the total size

*n*each observation is classified into one of the

*k*cells, and the expected cell frequencies

The observed cell frequencies

Under the null hypothesis (that is, assuming that the model probabilities are correct), the distribution of Pearson's chi-square is approximated by the chi-square distribution with degrees of freedom. Therefore, we can reject the null hypothesis if you observe that and , casting doubt on the validity of the model. Or equivalently, by computing the -value

with a random variable having the chi-square distribution with degrees of freedom, we can find that the null hypothesis is rejected if .