The
MD_TEST
function
tests the
hypothesis that a sample population is random against the hypothesis that it is not random. The result is a two-element vector containing the nearly-normal test statistic *
Z*
and its associated probability. This two-tailed is an extension of the "Runs Test for Randomness" and is often referred to as the
Median Delta Test.

This routine is written in the IDL language. Its source code can be found in the file ```
md_test.pro
```

in the ```
lib
```

subdirectory of the IDL distribution.

Use this keyword to specify a named variable that will contain the number of sample population values greater than the median of *
X*
.

X = [ 2.00, 0.90, -1.44, -0.88, -0.24, 0.83, -0.84, -0.74, $

0.99, -0.82, -0.59, -1.88, -1.96, 0.77, -1.89, -0.56, $

Test the hypothesis that *
X*
represents a random population against the hypothesis that it does not represent a random population at the 0.05 significance level.

result = MD_TEST(X, MDC = mdc)

The computed probability (0.322949) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that *
X*
represents a random population.