Null and Alternative Hypotheses: N or n/6. in Fact, For This Example, The Expected Number of Candies For Each
Null and Alternative Hypotheses: N or n/6. in Fact, For This Example, The Expected Number of Candies For Each
Null and Alternative Hypotheses: N or n/6. in Fact, For This Example, The Expected Number of Candies For Each
The null and alternative hypotheses for our goodness of fit test reflect the
assumption that we are making about the population. Since we are testing
whether the colors occur in equal proportions, our null hypothesis will be that all
colors occur in the same proportion. More formally, if p1 is the population
proportion of red candies, p2 is the population proportion of orange candies, and
so on, then the null hypothesis is that p1 = p2 = . . . = p6 = 1/6.
The alternative hypothesis is that at least one of the population proportions is not
equal to 1/6.
If the null hypothesis were true, then the expected counts for each of these colors
would be (1/6) x 600 = 100. We now use this in our calculation of the chi-square
statistic.
We calculate the contribution to our statistic from each of the colors. Each is of
the form (Actual – Expected)2/Expected.:
We then total all of these contributions and determine that our chi-square
statistic is 125.44 + 22.09 + 0.09 + 25 +29.16 + 33.64 =235.42.
Degrees of Freedom
The number of degrees of freedom for a goodness of fit test is simply one less
than the number of levels of our variable. Since there were six colors, we have 6 –
1 = 5 degrees of freedom.
Microsoft’s Excel can be used for this calculation. We find that our test statistic
with five degrees of freedom has a p-value of 7.29 x 10-49. This is an extremely
small p-value.
Decision Rule
We make our decision on whether to reject the null hypothesis based on the size
of the p-value. Since we have a very miniscule p-value, we reject the null
hypothesis. We conclude that M&Ms are not evenly distributed among the six
different colors. A follow-up analysis could be used to determine a confidence
interval for the population proportion of one particular color.