Wilcoxon Signed-Rank Test Calculator

Input

          


Output

Statistic 30.0
p-value 0.15668

What is the Wilcoxon signed rank test?


When you assume the population behind the sample is not normally distributed, you use a non parametric test. Wilcoxon signed rank test is a non parametric test used to compare two related samples, to assess whether their population mean ranks differ. In other words it is a non parametric test for pairwise observations.

To find the test statistic you first need take the difference between method A and method B. Then you rank the differences from lowest to highest. Assign any tied values the average of the ranks they would have received had they not been tied. Then you assign a "+" sign to positive differences and a "-" sign to negative differences. Differences that are equal to 0 are removed from the test.
T+ = Rank sum for all the positive differences
T- = Rank sum for all the negative differences

The test statistic is the smallest value of T+ or T-. In order to find the p-value you need a table made for the Wilcoxon signed rank test; however, if the sample size is large T is approximately normally distributed with the expected value n(n+1)/4 and STD (n(n-1)(2n+1)/24)^0.5.

Example, Bob wants to test if there is any difference in efficiency of two learning methods, the data is not normally distributed so a non parametric pairwise test would be the best fit here. The data tests exam scores using method A and then method B to see which one gives the highest exam scores.

Method A = [21 18 16 27 20 21 20 19 25 19 26 29 20 24 16]
Method B = [17 18 18 20 25 18 16 18 20 23 24 26 23 18 15]

Example data set

Student Method A score Method B score diff Rank Sign
1 21 17 4 9 +
2 18 18 0
3 16 18 -2 3.5 -
4 27 20 7 14 +
5 20 25 -5 11.5 -
6 21 18 3 6 +
7 20 16 4 9 +
8 19 18 1 1.5 +
9 25 20 5 11.5 +
10 19 23 -4 9 -
11 26 24 2 3.5 +
12 29 26 3 6 +
13 20 23 -3 6 -
14 24 18 6 13 +
15 16 15 1 1.5 +


hypothesis 0: No difference between the methods
hypothesis 1: There is a difference between the methods

The sum of ranks for all positive differences T+ is equal to 75
The sum of ranks for all negative differences T- is equal to 30
Since T- is the smallest of the two differences we use this as our statstic. The p-value can be found using a wilcoxon signed rank test table for sample sizes under 50, else use a normal approximation.

Since the p-value is 0.15 we can't reject the null hypothesis.