Runs Test for Randomness

Runs Test for Randomness
In any ordered sequence with two types of symbols, a run is defined as a
succession of one or more identical symbols, which are followed and preceded
by a different symbol or no symbol at all. For example, the males and females in
a line can have patterns such as
MFMFMFMF
and
M M M M F F F F,
which have 8 and 2 runs, respectively. Both the number of runs and their lengths
can be used as a measure of the randomness of the ordered symbol sequence.
Too few runs, too many runs, a run of excessive length, etc., are very rare in
truly random sequences, therefore they can serve as statistical criteria for the
rejection of H0.
Assumptions
a) The sample data are arranged according to some scheme.
b) The data falls into two separate categories (such as above and below a
specific value).
c) The runs test is based on the order in which the data occur.
1) n < 30
We take the data in the given order and mark with 1 the data greater than
the median, and with 2 the data less than the median. (Numbers equal to
the median are omitted.) We compare the number of runs with theoretical
numbers of runs which we can find in table with
- number of elements in the sequence with characteristic 1
- number of elements in the sequence with characteristic 2
2) n ≥ 30
̅
̅
where R – number of runs, ̅
, ̅
√
Example 1
A supervisor records the number of employees absent over a 30 day period. Test
for randomness.
27; 6; 19; 24; 18; 12; 15; 17; 18; 20;0; 9; 4; 12; 3; 2; 7; 7; 0; 5; 32; 16; 38; 31;
27; 15; 5; 9; 4; 10
Example 2
A sample of 15 elements is taken. Results with respect to same feature are:
530, 620, 560, 320, 480, 550, 490, 500, 460, 430, 380, 390, 360, 400, 370
Can we say that this is random sample?