Performed on a set of numbers and labels of size N. There must be two specific labels. Label 1 must be 1 and label 2 must be 2. There can also be any other labels that will be ignored.
Wilcoxon statistic
Sort the combined values in ascending order and assign numerical ranks starting with 1.
For a tie, assign all tied values the average rank. For example: tied 2nd and 3rd values would recieve a rank of 2.5 each; tied 5th, 6th, and 7th values would receive a rank of 6 each.
Sum the ranks for each group.
n1 = size of the smaller group
n2 = size of the larger group
sum1 = rank sum of the smaller group
sum2 = rank sum of the larger group
n = n1 + n2
The statistic is the sum of the smaller group or the smaller sum if the groups are of equal size.
If n1 < n2, sum1
If n1 = n2, least of sum1 and sum2
Wilcoxon probability
Variance (Var): where = how many values are tied in each tie