RS_TEST

RS_TEST

The RS_TEST function tests the hypothesis that two sample populations X and Y have the same median of distribution against the hypothesis that they differ. X and Y may be of different lengths. This type of test is often referred to as the “Wilcoxon Rank-Sum Test” or the “Mann-Whitney U-Test.”

The Mann-Whitney statistics for X and Y are defined as follows:

where Nx and Ny are the number of elements in X and Y, respectively, and Wx and Wy are the rank sums for X and Y, respectively. The test statistic Z, which closely follows a normal distribution for sample sizes exceeding 10 elements, is defined as follows:

This routine is written in the IDL language. Its source code can be found in the file rs_test.pro in the lib subdirectory of the IDL distribution.