The \(\chi^<2>\) goodness-of-fit test can be used to test the distribution of three or more proportions within a single population.2>
An instructor claims that their students’ grade distribution is different than the department’s grade distribution. The department’s grades have the following proportion of students who get A’s is 35%, B’s is 23%, C’s is 25%, D’s is 10% and F’s is 7% in introductory statistics courses. For a sample of 250 introductory statistics students with this instructor, there were 80 A’s, 50 B’s, 58 C’s, 38 D’s, and 24 F’s. Test the instructor’s claim at the 5% level of significance.
This is a test for three or more proportions within a single population, so use the goodness-of-fit test. We will always use a right-tailed χ 2 -test. The hypotheses for this example would be:
\(H_:\) At least one proportion is different.
Even though there is an inequality in \(H_\), the goodness-of-fit test is always a right-tailed test. This is because we are testing to see if there is a large variation between the observed versus the expected values. If the variance between the observed and expected values is large, then there is a difference in the proportions.
There are \(k = 5\) categories that we are comparing: A’s, B’s, C’s, D’s and F’s.
The observed counts are the actual number of A’s, B’s, C’s, D’s and F’s from the sample.
We must compute the expected count for each of the five categories. Find the expected counts by multiplying the expected proportion of A’s, B’s, C’s, D’s and F’s by the sample size.
It will be helpful to make a table to organize the work.
The test statistic is the sum of this last row: \(\chi^=\sum \frac<(O-E)^>=0.6429+0.9783+0.324+6.76+2.4143=11.1195\)
The critical value for a right-tailed \(\chi^\)-test with \(\text = k - 1 = 5 - 1 = 4\) is found by finding the area in the \(\chi^\) -distribution using your calculator or Excel. Use \(\alpha = 0.05\) area in the right-tail, to get the critical value of \(\chi_^\) =CHISQ.INV.RT(0.05,4) = 9.4877. Draw and label the curve as shown in Figure 10-4.
The test statistic of \(\chi^ = 11.1195 > \chi_^ = 9.4877\) and is in the rejection area, so our decision is: Reject \(H_\).
There is sufficient evidence to support the claim that the proportion of students who get A’s, B’s, C’s, D’s and F’s in introductory statistics courses for this instructor is different than the department’s proportions of 35%, 23%, 25%, 10% and 7% respectively.
If we were asked to find the p-value, you would just find the area to right of the test statistic (always a right-tailed test) using your calculator or Excel =CHISQ.DIST.RT(11.1195,4) = 0.0253.
This gives a p-value = 0.0252 which is less than \(\alpha = 0.05\), therefore reject \(H_\).
You can use the GOF shortcut function on your calculator to get a p-value; see directions below. If you get the program from your instructor or the website for your TI-83, you can also have the calculator find the \(\frac>\) values. The TI-84 and 89 already does this.
TI-84: Note: For the TI-83 download a GOF program from http://MostlyHarmlessStatistics.com. Only newer TI-84 operating systems have a calculator shortcut key for GOF. Use the same GOF program as for the TI-83 if your 84 does not have the \(\chi^\) GOF-Test.
Before you start, write down your observed and expected values. Select Stat, then Calc. Type in the observed values into list 1, and the expected values into list 2. Select Stat, then Tests. Go down to option D: \(\chi^\) GOF-Test. Choose L1 for the Observed category and L2 for the Expected category, type in your degrees of freedom (\(\text = k-1\)), and then select Calculate. The calculator returns the \(\chi^\) -test statistic and the p-value. Use the right arrow to see the rest of the \(\frac<(O-E)^>\) values.
TI-89: Go to the [Apps] Stat/List Editor, then type in the observed values into list 1, and the expected values into list 2. Press [2 nd ] then F6 [Tests], then select 7: Chi-2GOF. Type in the list names and the degrees of freedom (\(\text = k-1\)). Then press the [ENTER] key to calculate. The calculator returns the \(\chi^\)-test statistic and the p-value. The \(\frac<(O-E)^>\) values are stored in the comp list.
A research company is looking to see if the proportion of consumers who purchase a cereal is different based on shelf placement. They have four locations: Bottom Shelf, Middle Shelf, Top Shelf, and Aisle End Shelf. Test to see whether there is a preference among the four shelf placements. Use the p-value method with \(\alpha=0.05\).
The hypotheses can be written as a sentence or as proportions. If you use proportions, note that there are no percentages given. We would expect that each shelf placement be the same if there was no preference. There are 4 categories, so \(p_ = \frac = 0.25\) or 25% for each placement.
It is also acceptable to write the hypotheses as a sentence.
Find the expected values. Total all the observed values to get the sample size: \(n = 45 + 67 + 55 + 73 = 240\). Then take the sample size and divide by 4 to get \(\frac = 60\). The expected value for each group is 60.
Compute the test statistic:
Check your work using technology and find the p-value. The degrees of freedom are the number of groups minus one: \(\text = k - 1 = 3\).
You can scroll right by selecting the right arrow button to see the rest of the contribution values.
In Excel the p-value is found by the formula =CHISQ.DIST.RT(7.8,3). On the TI-Calculator, use the \(\chi^\) GOF-Test shortcut. The p-value = 0.05033 which is larger than \(\alpha=0.05\); therefore, do not reject \(H_\).
There is not enough evidence to support the claim that cereal shelf placement makes a statistically significant difference in the proportion of sales at the 5% level of significance.
This page titled 10.2: Goodness of Fit Test is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Rachel Webb via source content that was edited to the style and standards of the LibreTexts platform.