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:

 data1 data2 60.83 59.22 63.24 65.09 72.33 71.45 62.21 72.33 66.59 74.71 61.64 68.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:

 m 8 n 6 totalPoints 14 U_statistic 18.5 Up_statistic 29.5 P_Value 0.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:

 m 8 n 6 totalPoints 14 U_statistic 5 Up_statistic 43 P_Value 0.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:

 data4 data5 63.65 64.86 58.99 50.22 57.45 59.33 61.18 59.86 58.79 60.35 63.49 59.71 56.52 59.22 59.44 59.39 60.77 64.95 64.34 56.42 59.55 59.56 63.76 54.82 63.62 60.74 51.23 60.23 61.69 60.95 64.41 61.6 54.59 64.9 57.84 59.73 57.33 60.36 57.14 60.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:

 n 20 Tp 96 Tm 114 P_lower_tail 0.378083 P_upper_tail 0.635747 P_two_tail 0.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. Forum Support Gallery