Statistics with Technology 2eXYZ Homework Edition

⇩ Download ▾

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

  1. State the null and alternative hypotheses and the level of significance
    HoH_{o}: The data are consistent with a specific distribution
    HAH_{A}: The data are not consistent with a specific distribution
    Also, state your α\alpha level here.
  2. State and check the assumptions for the hypothesis test
    1. A random sample is taken.
    2. Expected frequencies for each cell are greater than or equal to 5 (The expected frequencies, E, will be calculated later, and this assumption means E5E \geq 5).
  3. 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.

Expected frequency( entry  i ) = E = n * p \text{Expected frequency( entry }i )=E=n^{*} p

Test Statistic:

χ 2 = ( O E ) 2 E \chi^{2}=\sum \dfrac{(O-E)^{2}}{E}

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: χ cdf ( lower limit, 1E99,df)\chi \text { cdf }(\text { lower limit, } 1 \mathrm{E} 99, d f)

Using R: 1 pchisq (χ2,df)1-\text { pchisq }\left(\chi^{2}, d f\right)

Where the degrees of freedom is df = k - 1

4. Conclusion

This is where you write reject HoH_{o} or fail to reject HoH_{o}. The rule is: if the p-value < α\alpha, then reject HoH_{o}. If the p-value α\geq \alpha, then fail to reject HoH_{o},

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 HAH_{A} is true, or you do not have enough evidence to show HAH_{A} is true.

Homework

Adapted from Statistics with Technology, 2nd Edition, by Kathryn Kozak (Coconino Community College), © Kathryn Kozak, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.