532 Chapter 12:Nonparametric Hypothesis Tests
Simulation Approximation to the p-value in Rank Sum Test
Enter the size of sample 1:
Enter the size of sample 2:
Enter the sum of the ranks
Enter the desired number
5
6
21
10000
The p-value is 0.125
Start
Quit
This program approximates the p-value for the two sample rank sum test
by a simulation study.
of the first sample:
of simulation runs:
FIGURE 12.4
Simulation Approximation to the p-value in Rank Sum Test
Enter the size of sample 1:
Enter the size of sample 2:
Enter the sum of the ranks
Enter the desired number
9
13
72
10000
The p-value is 0.0356
Start
Quit
This program approximates the p-value for the two sample rank sum test
by a simulation study.
of the first sample:
of simulation runs:
FIGURE 12.5
EXAMPLE 12.4f Running the text disk program on the data of Example 12.4c yields
Figure 12.4, which is quite close to the exact value of .1225. Running the program using
the data of Example 12.4d yields Figure 12.5, which is again quite close to the exact value
of .0364. ■
Both of the approximation methods work quite well. The normal approximation, when
nandmboth exceed 7, is usually quite accurate and requires almost no computational time.