492 Chapter 11:Goodness of Fit Tests and Categorical Data Analysis
eachnpi≥1 and at least 80 percent of thenpiexceed 5 — does not apply, thus raising
the possibility that it is rather conservative. ■
Program 11.2.2 can be utilized to determine thep-value.
To obtain more information as to how well the chi-square approximation performs,
consider the following example.
EXAMPLE 11.2d Consider an experiment having six possible outcomes whose prob-
abilities are hypothesized to be .1, .1, .05, .4, .2, and .15. This is to be tested by performing
40 independent replications of the experiment. If the resultant number of times that each
of the six outcomes occurs is 3, 3, 5, 18, 4, 7, should the hypothesis be accepted?
SOLUTION A direct computation, or the use of Program 11.2.1, yields that the value of the
test statistic is 7.4167. Utilizing Program 5.8.1a gives the result that
P{χ 52 ≤7.4167}=.8088and so
p-value≈.1912To check the foregoing approximation, we ran Program 11.2.2, using 10,000 simulation
runs, and obtained an estimate of thep-value equal to .1843 (see Figure 11.1).
The estimate of the p-value is 0.1843Simulation Approximation to the p-Value in Goodness of FitStartQuitEnter sample size:
Enter desired number
of simulation runs:
Enter the value of the
test statistic:40Enter value for p: .15Add This Point To ListRemove Selected Point From ListProbabilitiesClear ListThis program uses simulation to approximate
the p-value in the goodness of fit test.0.1
0.1
0.05
0.4
0.2
0.15100007.416667FIGURE 11.1