TITLE:
Calculation of Two-Tailed Exact Probability in the Wald-Wolfowitz One-Sample Runs Test
AUTHORS:
José Moral De La Rubia
KEYWORDS:
Randomness, Nonparametric Test, Exact Probability, Small Samples, Quantiles
JOURNAL NAME:
Journal of Data Analysis and Information Processing,
Vol.12 No.1,
February
22,
2024
ABSTRACT: The objectives of this paper are to demonstrate the algorithms employed
by three statistical software programs (R, Real Statistics using Excel, and
SPSS) for calculating the exact two-tailed probability of the Wald-Wolfowitz
one-sample runs test for randomness, to present a novel approach for computing
this probability, and to compare the four procedures by generating samples of 10
and 11 data points, varying the parameters n0 (number of zeros) and n1 (number of ones), as well as
the number of runs. Fifty-nine samples are created to replicate the behavior of
the distribution of the number of runs with 10 and 11 data points. The exact
two-tailed probabilities for the four procedures were compared using Friedman’s
test. Given the significant difference in
central tendency, post-hoc comparisons were conducted using Conover’s test
with Benjamini-Yekutielli correction. It is concluded that the procedures of
Real Statistics using Excel and R exhibit some inadequacies in the calculation
of the exact two-tailed probability, whereas the new proposal and the SPSS
procedure are deemed more suitable. The proposed robust algorithm has a more transparent rationale than the
SPSS one, albeit being somewhat more conservative. We recommend its
implementation for this test and its application to others, such as the
binomial and sign test.