In: Statistics and Probability
For the following sequence of sample nominal data (with two categories), conduct a runs test for randomness, using α = 0.05.
Y N Y N N Y N Y Y Y N Y N Y N Y Y Y N Y N Y N N Y Y Y Y N Y N Y N Y Y
Identify the value of the TEST STATISTIC used in this runs test.
GIVEN:
The following sequence of sample nominal data with two categories:
Y N Y N N Y N Y Y Y N Y N Y N Y Y Y N Y N Y N N Y Y Y Y N Y N Y N Y Y
Number of Y's 
Number of N's 
Y N Y N N Y N Y Y Y N Y N Y N Y Y Y N Y N Y N N Y Y Y Y N Y N Y N Y Y
Number of runs 
(A run is a sequence within a series in which one of the 2 alternatives occurs on consecutive trials.)
HYPOTHESIS:
The hypothesis is given by,
The sequence
is random.
The sequence
is not random.
LEVEL OF SIGNIFICANCE:

TEST STATISTIC:

which follows standard normal distribution
where
and

CALCULATION:
Let 



Let 



Now


CRITICAL VALUE:
The z critical value at significance
level
is
.
CONCLUSION:
Since the calculated z test statistic (2.58) is greater than the z critical value (1.96), we fail to reject null hypothesis and conclude that the sequence is random.