The Wilcoxon signed-rank test compares two paired conditions or one sample against a hypothesized median when a test is not appropriate. It is useful when differences are ordinal, nonnormal, or affected by outliers, as long as the distribution of differences is roughly symmetric. This cheat sheet helps students follow the full workflow from hypotheses to ranks, test statistic, and conclusion.
It is especially helpful for checking hand calculations and interpreting software output.
The test begins by forming paired differences , removing zero differences, ranking , and attaching the sign of each original difference. The positive rank sum is , the negative rank sum is , and a common two-sided statistic is . For larger samples, can be converted to a normal score using and .
The decision is based on the -value, the significance level , and the direction of the alternative hypothesis.
Key Facts
- Use the Wilcoxon signed-rank test for paired data when the median difference is being tested and the paired differences are roughly symmetric.
- For each pair, compute the difference as or , but keep the same direction throughout the test.
- Remove all observations with before ranking, and let be the number of remaining nonzero differences.
- Rank the absolute differences from smallest to largest, using average ranks for ties.
- Compute the positive rank sum for all and the negative rank sum for all .
- For a two-sided small-sample test, the test statistic is often , with unusually small giving evidence against .
- For a large-sample approximation, use , where and when there are no ties.
- A common effect size is , where larger values of indicate stronger practical evidence.
Vocabulary
- Paired difference
- A paired difference is the value computed from two related measurements on the same subject or matched pair.
- Signed rank
- A signed rank is the rank of with the positive or negative sign of the original difference attached.
- Positive rank sum
- The positive rank sum is the total of the ranks whose original differences satisfy .
- Negative rank sum
- The negative rank sum is the total of the ranks whose original differences satisfy .
- Null hypothesis
- For the signed-rank test, the null hypothesis usually states that the population median difference is .
- Normal approximation
- The normal approximation uses to estimate a -value when the sample size is large enough.
Common Mistakes to Avoid
- Keeping zero differences in the ranking is wrong because values with give no direction and must be removed before computing .
- Ranking the signed differences instead of is wrong because the Wilcoxon method ranks magnitudes first and adds signs afterward.
- Changing the subtraction order halfway through is wrong because reversing changes which ranks count as positive and negative.
- Using the signed-rank test for independent groups is wrong because the method assumes paired or matched observations, not two unrelated samples.
- Ignoring ties in is wrong because tied absolute differences must receive average ranks, which can change , , and the -value.
Practice Questions
- 1 For paired differences , remove zeros, rank the absolute differences, and compute , , and .
- 2 A study has nonzero paired differences with signed ranks , , , , , and . Find , , and the two-sided statistic .
- 3 For a large-sample signed-rank test with and , compute , , and the approximate score using .
- 4 Explain why the Wilcoxon signed-rank test may be preferred over a paired test when paired differences contain outliers but remain roughly symmetric.