The chi-square goodness of fit test has a wide range of applications. It is the type of test that compares expected counts of categorical variables with actual counts.

For a hands-on illustration of the chi-square goodness of fit test, an activity involving M&Ms can be used. This is a fun activity because students can not only learn about a topic in statistics, but they can also eat candy after they are done with the activity.

**Time:** 20-30 minutes**Materials:** One snack size bag of standard milk chocolate M&Ms for each student.**Level:** High school to college

### The Setup

Begin by asking if anyone has ever wondered about the colors of M&Ms. A standard bag of milk chocolate M&Ms has six colors: red, orange, yellow, green, blue and brown. Ask, "Do these colors occur in equal proportion, or are there more of one color than the others?"

Solicit responses from the class on what they think, and ask for reasons each guess. A common response is that a certain color is more prevalent, but this will likely be due to a student's perception from eating bags of M&Ms. The evidence will be anecdotal. Many of the students may not have thought about this and will think that all of the colors are evenly distributed.

Tell the students that rather than relying on intuition, the statistical method of a chi-square goodness of fit test can be used to test the hypothesis that M&Ms are equally distributed among the six colors.

### The Activity

Outline the chi-square goodness of fit test. This is appropriate in this situation because we are comparing a population with a theoretical model. In this case, our model is that all colors occur with the same proportion.

Have students count how many of each color there are in their bags of M&Ms. If the candies were evenly distributed among the six colors, the 1/6 of the candies would be each of the six colors. Thus we have an observed count to compare with an expected count.

Have each student tabulate the observed and expected counts. Then have them calculate the chi-square statistic for these observed and expected counts. Using a table or chi-square functions in Excel, determine the p-value for this chi-square statistic. What is the conclusion that students reach?

Compare the p-values across the room. As a class pool together all of the counts and, conduct the goodness of fit test. Does this change the conclusion?

### Extensions

There are a variety of extensions that could be made with this activity:

- A valuable discussion would focus on the issues surrounding sampling. Does this procedure produce a simple random sample? What is the population being studied?
- A follow-up analysis could focus on a single color. What is a confidence interval for the proportion of, say, blue candies?
- A similar activity could look at proportions of colors for a different type of candy, such as Skittles.