Introduction to the Wilcoxon Rank-Sum Test

In your Statistics journey, you have likely met the Independent Samples t-test. That test is great, but it has a catch: it only works if your data follows a Normal distribution (that classic bell-shaped curve). But what if your data is messy, skewed, or you just don't know the underlying distribution?

That is where the Wilcoxon Rank-Sum Test (also known as the Mann-Whitney Test) comes in! This is a non-parametric test, meaning it doesn't assume your data follows a specific distribution. Instead of looking at the actual values (like \(10.5\) seconds or \(50\) grams), it looks at the positions or ranks of the data points when they are all lined up in order.

Note: This chapter focuses on two independent samples. If you are dealing with paired data (like "before and after" scores for the same person), you should look at the Wilcoxon Signed-Rank Test instead!

When to Use This Test

Before you start calculating, you must ensure this test is the right tool for the job. You use the Wilcoxon Rank-Sum test when:

  • You have two independent samples (Group A and Group B are entirely different people or objects).
  • The data is at least ordinal (you can rank it from smallest to largest).
  • You cannot assume the populations follow a Normal distribution.
  • The two samples have a similar shape (even if that shape isn't Normal).

Setting Up Your Hypotheses

In this test, we are usually checking if the two populations are essentially the same or if one "tends to be larger" than the other. We often frame this in terms of the median.

The Null Hypothesis \(H_0\): There is no difference between the distributions of the two populations (the medians are equal).
The Alternative Hypothesis \(H_1\): There is a difference between the distributions (two-tailed), or one population is greater than the other (one-tailed).

The Step-by-Step Procedure

Don't worry if this seems like a lot of steps; once you do it once, it becomes a very logical pattern. Here is the process used for the Pearson Edexcel specification:

Step 1: Rank the combined data.
Combine both samples into one big list. Sort them from smallest to largest. Give the smallest value a rank of \(1\), the next smallest a rank of \(2\), and so on. Keep track of which group each value belongs to!

Step 2: Handle any "Ties."
If two or more values are exactly the same, give them the average of the ranks they would have taken. For example, if the \(4th\) and \(5th\) values are identical, they both get the rank \(4.5\).

Step 3: Sum the ranks.
Calculate the sum of the ranks for each group. Let \(n_1\) be the number of items in Sample 1, and \(n_2\) be the number of items in Sample 2. We call the sum of ranks \(R_1\) and \(R_2\).

Step 4: Identify the test statistic.
In the Pearson Edexcel Statistical Formulae and Tables booklet, the table for the Wilcoxon Rank-Sum test provides critical values for the rank sum of the smaller sample size. Let's call the smaller sample size \(m\) and the larger sample size \(n\). Your test statistic is the sum of ranks for the sample of size \(m\).

Step 5: Compare with the Critical Value.
Look up the critical value in your tables using your sample sizes (\(m\) and \(n\)) and your significance level (usually \(5\%\)).

Decision Rule

In many statistical tests, we reject \(H_0\) if our value is "too big." However, for the Wilcoxon Rank-Sum test, the table usually gives two critical values (a lower and an upper bound).

If your rank sum is less than or equal to the lower critical value, or greater than or equal to the upper critical value, you reject \(H_0\).

A Practical Example

Imagine we are testing two different types of batteries (Brand A and Brand B) to see if one lasts longer. We have \(4\) batteries of Brand A and \(5\) of Brand B.

Sample A (hours): \(12, 15, 19, 21\)
Sample B (hours): \(14, 17, 20, 23, 25\)

1. Combine and Rank:
\(12 (A)\): Rank \(1\)
\(14 (B)\): Rank \(2\)
\(15 (A)\): Rank \(3\)
\(17 (B)\): Rank \(4\)
\(19 (A)\): Rank \(5\)
\(20 (B)\): Rank \(6\)
\(21 (A)\): Rank \(7\)
\(23 (B)\): Rank \(8\)
\(25 (B)\): Rank \(9\)

2. Calculate Rank Sums:
Sum for A (\(R_A\)): \(1 + 3 + 5 + 7 = 16\)
Sum for B (\(R_B\)): \(2 + 4 + 6 + 8 + 9 = 29\)

3. Check the Statistic:
Our smaller sample size is \(m = 4\) (Brand A). Our larger is \(n = 5\) (Brand B). Our test statistic is \(16\).

4. Conclusion:
You would then check the tables for \(m=4, n=5\) at your chosen significance level. If \(16\) falls into the critical region defined by the table, you would reject the idea that the batteries last the same amount of time.

Common Mistakes to Avoid

  • Mixing up the tests: Don't use this for paired data! If the same person is measured twice, use the Wilcoxon Signed-Rank test. This Rank-Sum test is for independent groups.
  • Forgetting to rank combined data: You must rank all numbers together as one big group, not each group separately.
  • Incorrect Tie Handling: Always use the midpoint. If three values are tied for ranks \(2, 3, 4\), they all get rank \(3\) (\(\frac{2+3+4}{3} = 3\)).
  • Losing track of groups: A common error is summing the ranks of the wrong group. Double-check which rank belongs to which sample.

Quick Review

What is it? A non-parametric test for comparing the medians of two independent samples.
Why use it? When you can't assume a Normal distribution.
Key Stat: The sum of ranks for one of the groups (usually the smaller sample).
Critical Region: Reject \(H_0\) if the rank sum is "extreme" (very low or very high compared to the table values).
Formulae: You don't need to memorize the tables; they are provided in the Statistical Formulae and Tables booklet for the exam!

Did you know? Even though this test doesn't use the actual data values, it is surprisingly powerful. It is almost as good as a t-test even when the data IS Normal, and much better when the data ISN'T!