536 Chapter 12:Nonparametric Hypothesis Tests
and, similarly,
PH 0 {R≥r}≈ 1 −
(
r−μ
σ
)
Hence, for largenandm, thep-value of the runs test for randomness is approximately
given by
p-value≈2 min
{
(
r−μ
σ
)
,1−
(
r−μ
σ
)}
whereμandσare given by Equation 12.5.2 andris the observed number of runs.
EXAMPLE 12.5c Suppose that a sequence of sixty 1’s and sixty 0’s resulted in 75 runs. Since
μ=61 and σ=
√
3,540
119
=5.454
we see that the approximatep-value is
p-value≈2 min{ (2.567), 1− (2.567)}
= 2 ×(1−.9949)
=.0102
On the other hand, by running Program 12.5 we obtain that the exactp-value is
p-value=.0130
If the number of runs was equal to 70 rather than 75, then the approximatep-value would
be
p-value≈ 2 [ 1 − (1.650)]=.0990
as opposed to the exact value of
p-value=.1189 ■