11.2 Chi-Square Goodness of Fit
In probability, you calculated probabilities using both experimental and theoretical methods. There are times when it is important to determine how well the experimental values match the theoretical values. An example of this is if you wish to verify if a die is fair. To determine if observed values fit the expected values, you want to see if the difference between observed values and expected values is large enough to say that the test statistic is unlikely to happen if you assume that the observed values fit the expected values. The test statistic in this case is also the chi-square. The process is the same as for the chi-square test for independence.
Hypothesis Test for Goodness of Fit Test
- State the null and alternative hypotheses and the level of significance
: The data are consistent with a specific distribution
: The data are not consistent with a specific distribution
Also, state your level here. - State and check the assumptions for the hypothesis test
- A random sample is taken.
- Expected frequencies for each cell are greater than or equal to 5 (The expected frequencies, E, will be calculated later, and this assumption means ).
- Find the test statistic and p-value
Finding the test statistic involves several steps. First the data is collected and counted, and then it is organized into a table (in a table each entry is called a cell). These values are known as the observed frequencies, which the symbol for an observed frequency is O. The table is made up of k entries. The total number of observed frequencies is n. The expected frequencies are calculated by multiplying the probability of each entry, p, times n.
Test Statistic:
where O is the observed frequency and E is the expected frequency.
Again, the test statistic involves squaring the differences, so the test statistics are all positive. Thus a chi-squared test for goodness of fit is always right tailed.
p-value:
Using the TI-83/84:
Using R:
Where the degrees of freedom is df = k - 1
4. Conclusion
This is where you write reject or fail to reject . The rule is: if the p-value < , then reject . If the p-value , then fail to reject ,
5. Interpretation
This is where you interpret in real world terms the conclusion to the test. The conclusion for a hypothesis test is that you either have enough evidence to show is true, or you do not have enough evidence to show is true.