Wilcoxon Tests Demo

The WilcoxonRankTest operation supports the non-parametric Wilcoxon-Mann-Whitney two sample rank test and the Wilcoxon Signed-Rank test.

1. Wilcoxon-Mann-Whitney two sample rank test

In this test the ranks of the data are used to determine if there is any difference between the samples. The data we for the first test are given in the waves data1 and data2:

data1data2
60.8359.22
63.2465.09
72.3371.45
62.2172.33
66.5974.71
61.6468.42
73.68
70.19

To run the rank test execute:

StatsWilcoxonRankTest/T=1/Q/TAIL=4 data1,data2

The results are displayed in the Mann-Whitney Wilcoxon Test table:

m8
n6
totalPoints14
U_statistic18.5
Up_statistic29.5
P_Value0.512821

In this case the P-value is greater than the significance (0.05 by default) so H0: there is no difference between the results in data1 and data2 must be accepted. The P-value in this case is computed by:

P(U'<=18.5|8,6)+P(U>=29.5|8,6)= 0.512821

Comparing instead data1 to data3 where data3 is given by:

data3
77.81
67.08
71.55
75.46
74.46
74.61

we execute execute the command:

StatsWilcoxonRankTest/T=1/Q/TAIL=4 data1,data3

The results are displayed in the Mann-Whitney Wilcoxon Test table:

m8
n6
totalPoints14
U_statistic5
Up_statistic43
P_Value0.012654

Here the P-value is smaller than the significance and H0 must be rejected.

Note that in these examples the size of the waves was relatively small so there was no need to use the approximations for the P-values.

2. Wilcoxon Signed-Rank test

This non-parametric test is used for paired samples. The test is based on the ranks of the absolute difference in the values of each pair. The following two waves represent paired measurements:

data4data5
63.6564.86
58.9950.22
57.4559.33
61.1859.86
58.7960.35
63.4959.71
56.5259.22
59.4459.39
60.7764.95
64.3456.42
59.5559.56
63.7654.82
63.6260.74
51.2360.23
61.6960.95
64.4161.6
54.5964.9
57.8459.73
57.3360.36
57.1460.12

To run the Signed-Rank test on the waves data4 and data5 execute the command:

StatsWilcoxonRankTest/T=1/Q/WSRT data4,data5

The results are displayed in the Wilcoxon Signed Rank Test table:

n20
Tp96
Tm114
P_lower_tail0.378083
P_upper_tail0.635747
P_two_tail0.756166

Since the P-value for the two-tail hypothesis is much larger than the significance, we conclude that the two members of the pairs in data4 and data5 are the same.