# Chapter 1. Chi-square Goodness of Fit Test

## Introduction

Statistical Applets

Set the Bag Count n and the significance level (α) for your hypothesis test with the sliders, then click POUR NEW BAG to pour a bag of candies from the hopper (i.e. take a sample from the underlying population). The table on the right will show the number of candies for each color in the bag, along with the results of the chi-square goodness-of-fit test against the hypothesis that all colors are equally represented in the hopper. Click SHOW HOPPER VALUES to reveal the true population proportions, and click NEW HOPPER to start over with a new hopper (that has a new set of population proportions).

Click the "Quiz Me" button to complete the activity.

Suppose you have a large "hopper" of colored candies. You believe each of the 5 colors are represented equally often in the hopper (that is, you think the hopper contains 20% of each color), but you're not sure. To test this hypothesis, you can pour a "bag" of candies, count the number of each color in the bag, and perform a chi-square goodness-of-fit test on the resulting frequencies. The goodness-of-fit test can be used to test any null hypothesis about the underlying population frequencies; in this case we test against the null hypothesis that all 5 colors have the same likelihood of coming out of the hopper.

Try pouring a few bags from the hopper (controlling the size of each bag using the Bag Count slider) and observe the frequencies and the chi-square test for each bag. A rejected null hypothesis indicates evidence that the color proportions are not equal. After testing a few bags, click the SHOW HOPPER VALUES button to reveal the true population proportions for the hopper. You can then click to get a new hopper (with a new set of population proportions) and try again.

### Question 1.1

MhaNNWvg6iry8qqIak3rDqTnnXG3opkbRDYSsQmyLtjAb4jtRaGB5/zjvswgQl6CrYDTxE/aYNcf3VvMUD9O4O3eYluuBXNPzy+dbjLh4mAFBWonVNkBvTu6r3jsNhSTknCo4bMtC2dqUEzT4yUc+nuCGZlpoK+Lb8JyWsoyQoI9wTxwwFqMKuK7tnj6druf/363ndIoMLlv6mvt+jKeEEiwDAyq2dYfXG037e5l2r/JBosKmzMQ//TaBSW8mnSj0qIz7/G4MxzKrUNhsWswo83jvl4aQxcr79+9C3mqYx9GtPdiZO+yvzbuc2GjIXRXyvCsQg70Ip7cE27f42UH9GEc2Bvek9yIAlOLonjxVFM=
2
Correct.
Check the data and try again.
Incorrect.

### Question 1.2

Are the population proportions in this hopper truly equal? That is, if you draw a candy at random from the hopper, are each of the colors equally likely to come out? sjkhLuRCQ4SijoxQ

Incorrect. The proportions of colors in this hopper are not exactly equal to each other.
Correct. The proportions of colors in this hopper are not exactly equal to each other.

### Question 1.3

7ujuiAketm7UdNQ0qfikepo3uOiUFN4Bh5MgyTbxZQvmjeUBH7RNUa8fwKQZnPHDxziqKWszfRMzdCLocovM7Y1NZ6q/V79j0/lCDb0WQs0TTH/6CdC0srOYKvXvmPyEmpYjMz785G2oo91g9P6KjbjgVOU1RPX/R3PBcCFQ9F3CyssCoxmpoGnFFif6VGnkgtG6BMY86td02+9DfPoCSNIA1soNllcPIP4xw2TsNIkc3ZjS74UEwIEiTVaYHFkQCVcxyz6CJ/Llwc1S
3
Nice job.
To answer this question you must draw 5 bags of 20 candies each from the hopper, noting for each bag whether or no the null hypothesis is rejected.
Incorrect.