How to Calculate the Mann-Whitney U Test
- 1). Rank all the data from smallest to largest, keeping track of which sample each value comes from. For example, if group A has values of 3, 4, 22 and 101, and group B has values of 1, 2 and 90, then these 7 points get ranks 3, 4, 5, 7, 1, 2 and 6, respectively.
- 2). Multiply the sizes of the two samples. In the example, group A has four subjects and group B has three, so 4*3 = 12.
- 3). Calculate N*(N+1)/2, where N is the number of subjects in either group. Group A has four subjects, so 4*5/2 = 10.
- 4). Add up the ranks of the group used in Step 3. Group A's ranks are 3, 4, 5 and 7, which totals 19.
- 5). Add the result in Step 2 to the result in Step 3, and subtract the result in Step 4. In the example, 12 + 10 - 19 = 3. This is the Mann Whitney U.
Source...