2.10 - Wilcoxon Ranks Test
What is the Wilcoxon signed ranks test?
The Wilcoxon signed ranks test is a non-parametric statistical test used in psychology to determine whether there is a significant difference between two related sets of data. Non-parametric means it does not assume the data follows a normal distribution, making it suitable for ordinal data or when parametric assumptions cannot be met. This test ranks the differences between paired scores, taking into account both the size and direction of those differences.
This test is particularly useful in repeated measures designs, where the same participants are tested under two conditions, or in matched pairs designs, where participants are paired based on similar characteristics. For example, it could compare attitudes towards two study methods, such as cramming versus sustained revision, measured through a questionnaire.
When to use the Wilcoxon signed ranks test
Before applying any statistical test, it is essential to check if the data meets specific criteria to ensure the test is appropriate. The Wilcoxon signed ranks test has clear conditions for its use, which help researchers decide when it fits their study design.
Criteria for using the test
- Related data - The data must come from related samples, such as the same participants tested twice (repeated measures) or matched pairs.
- Ordinal level or higher - The data should be at least ordinal, meaning it can be ranked, but it does not need to be interval or ratio.
- Differences can be ranked - There must be calculable differences between the pairs that can be ordered by magnitude.
- Hypothesis testing - It is used to test for differences between two conditions, often with a directional (one-tailed) or non-directional (two-tailed) hypothesis.
If the data is unrelated or from independent groups, a different test like the Mann-Whitney U test would be more suitable. This test is chosen over parametric alternatives, such as the related t-test, when the data does not meet normality assumptions.
Step-by-step calculation of the Wilcoxon signed ranks test
Calculating the Wilcoxon signed ranks test involves a systematic process to transform raw data into a test statistic. This statistic, known as T, represents the smaller sum of ranks from positive or negative differences.
Steps in the calculation process
- Calculate differences - For each pair of scores (condition A and condition B), subtract one from the other (e.g., B - A) to find the difference.
- Rank the absolute differences - Ignore any zero differences and the signs (±). Assign ranks starting from the smallest absolute difference (rank 1) to the largest. If there are ties, assign the average rank (e.g., two differences tying for ranks 3 and 4 would both get 3.5).
- Sum the ranks by sign - Reattach the signs to the ranks. Separately add up the ranks for positive differences and for negative differences.
- Identify T - The observed value T is the smaller of the two rank sums (positive or negative).
- Determine n - This is the number of pairs with non-zero differences (exclude zeros from n).
- Compare to critical values - Using a table of critical values for the Wilcoxon test, find the critical value for your n, significance level (e.g., p < 0.05 or p < 0.01), and test type (one-tailed or two-tailed). The results are significant if T is less than or equal to the critical value.
Remember, a one-tailed test is used when the hypothesis predicts a direction of difference, while a two-tailed test is for non-directional hypotheses.
Worked example - Applying the Wilcoxon signed ranks test
A researcher investigates whether a new learning strategy (B) improves test scores compared to a standard strategy (A), using 10 participants. The test scores are as follows (higher scores indicate better performance):
| Participant | A: Standard Strategy | B: New Strategy | Difference (B - A) |
|---|---|---|---|
| 1 | 60 | 65 | 5 |
| 2 | 58 | 56 | -2 |
| 3 | 61 | 63 | 2 |
| 4 | 64 | 66 | 2 |
| 5 | 63 | 61 | -2 |
| 6 | 59 | 64 | 5 |
| 7 | 65 | 68 | 3 |
| 8 | 66 | 62 | -4 |
| 9 | 58 | 60 | 2 |
| 10 | 67 | 67 | 0 |
Calculate the Wilcoxon signed ranks test for a one-tailed hypothesis at p < 0.05, predicting higher scores with the new strategy.
Step 1: Calculate and rank differences
Ignore the zero difference (participant 10). Absolute differences: 5, 2, 2, 2, 2, 5, 3, 4, 2 Sorted absolute differences (non-zero): 2, 2, 2, 2, 2, 3, 4, 5, 5
Assign ranks, handling ties:
- Five differences of '2' occupy ranks 1, 2, 3, 4, 5. Average rank = (1+2+3+4+5)/5 = 3. So each '2' gets rank 3.
- One difference of '3' gets rank 6.
- One difference of '4' gets rank 7.
- Two differences of '5' occupy ranks 8, 9. Average rank = (8+9)/2 = 8.5. So each '5' gets rank 8.5.
Re-attach signs to ranks:
- P1: +5 (Rank 8.5)
- P2: -2 (Rank 3)
- P3: +2 (Rank 3)
- P4: +2 (Rank 3)
- P5: -2 (Rank 3)
- P6: +5 (Rank 8.5)
- P7: +3 (Rank 6)
- P8: -4 (Rank 7)
- P9: +2 (Rank 3)
Step 2: Sum ranks by sign
Positive ranks sum: 8.5 + 3 + 3 + 8.5 + 6 + 3 = 32
Negative ranks sum: 3 + 3 + 7 = 13
Step 3: Identify T and n
T = smaller sum = 13
n = 9 (number of pairs with non-zero differences)
Step 4: Compare to critical values
For n=9, one-tailed test at p < 0.05, the critical value is 8.
Since T=13 is greater than 8, the results are not significant at p < 0.05.
Step 5: Interpretation
The test shows no significant difference, so we retain the null hypothesis. There is no statistically significant evidence that the new learning strategy improves test scores compared to the standard strategy at the p < 0.05 level.
Interpreting results and significance
Once the Wilcoxon signed ranks test is calculated, the next step is to interpret what the results mean in the context of the research hypothesis. This involves comparing the observed T value to critical values and drawing conclusions about the data.
Key aspects of interpretation
- Significance levels - Common levels are p < 0.05 (5% chance of Type I error) and p < 0.01 (1% chance). If T ≤ critical value, reject the null hypothesis.
- Direction of difference - The sign of the larger rank sum indicates the direction (e.g., if positive ranks sum is larger, condition B tends to have higher scores).
- Limitations - The test only shows if a difference exists, not its size or cause. It is less powerful than parametric tests but robust for non-normal data.
- Reporting - State the T value, n, significance level, and whether it supports the hypothesis (e.g., "T=20, n=13, p<0.05, significant").
If results are not significant, the null hypothesis is retained, meaning no evidence of a difference between conditions. Always consider the test's assumptions and potential for ties or zeros, which reduce n and affect power.