OVERVIEW: A chi-square test goodnessof fit test is used to see if an observed sample distribution isdifferent from a hypothesized population distribution. In otherwords, it is used to see if what you got is statistically differentfrom what you expected to get.
The chi-square (x2
x2
= sum[(observed - expected) 2 /expected]
Properties of x2
Example #1:
A die is tossed 120 times with theresults displayed in the following table. Is there statisticalevidence to suggest that the die is "loaded"?
Up Face-->
1 2 3 4 5 6 Observed frequency
25 17 15 23 24 16 Expected frequency
20 20 20 20 20 20 In this situation, the degrees of freedom is 6 - 1= 5.
[Note that 5 of the categories are free to vary, but the sixthis not, since all categories have to add up to 120.]The calculated x2
is x
2 =(25-20)2/20+ (17-20)2/20 + (15-20) 2 /20 +(23-20)2/20+ (24-20)2/20 + (16-20) 2 /20 = 5.At the 5% level of significance, the criticalregion is x
2 > 11.1. Since ourcalculated x2is not in this region, we would not reject a nullhypothesis that says "The die is fair." Alternate approach:Using the TI-83, the P-value x2
cdf( 5,1E99,5) = .4158801852,which is approximately 41.6%. There is no evidence to suggest thatthe die is loaded.
Example #2:
Suppose I flip a coin 100 times andget 80 heads and 20 tails.
Number of HEADS
Number of TAILS
Observed
80 20 Expected
50 50 The x2
statistic for this experiment is x
2 =(80-50)2/50+ (20-50)2/50 = 18 + 18 = 36. The degrees of freedom is 2-1 = 1.
At the 1% level of significance, the criticalregion for x2
is x2 > 6.63. Our calculated value of 36 is well into thisregion. There is strong evidence to suggest that the coin is notfair. Alternate approach: Using the TI-83, the P-value is x2
cdf(36, 1E99,1) = .00000000197. This is the probabilitythat one would get 80 or more heads when flipping a fair coin 100times. This supports the previous statement suggesting that the coinis not fair.
The x2
In the examples above, these conditions weresatisfied.