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.
Understanding Wilcoxon Signed-Rank Test Walkthrough
The key idea is that pairing removes person-to-person variation. Suppose a teacher measures each student’s score before and after a study routine. Some students usually score higher than others for reasons unrelated to the routine.
Looking at the change within each student is fairer than comparing two unrelated class averages. The same logic appears in medical studies, product tests, repeated sensor measurements, and surveys taken before and after an event.
Each pair must truly belong together. A score from one student cannot be paired with a score from a different student just because the two scores seem similar.
Ranks give more weight to larger changes without trusting the exact numerical gaps too much. A change of one point is weaker evidence than a change of ten points, so it receives a lower rank. Yet the method does not treat a ten point change as exactly ten times as important.
This makes the test less sensitive to a few extreme differences than a paired t test. The signs then show whether the larger changes mostly point in one direction.
If positive and negative ranks balance closely, the data fit the idea of no typical shift. If one sign collects most of the rank total, the evidence points toward a shift in that direction.
The symmetry condition deserves careful attention. It applies to the distribution of the paired differences, not to the original before values or after values separately. Differences can be centered near zero with a roughly even spread above and below zero.
A long tail on only one side can cause trouble because the signed-rank method relies on positive and negative changes being comparable in shape. A histogram or dot plot of the differences can help reveal this.
With very small samples, plots are limited, so students should use knowledge of the setting too. If differences are strongly skewed, the sign test may be a safer choice, though it usually has less power because it ignores change sizes.
Software output can differ slightly across programs for valid reasons. Programs may use an exact distribution for small samples, a normal approximation for larger samples, or corrections for tied ranks and zero differences. A continuity correction can alter the reported normal score and p value a little.
Students should identify whether the reported statistic is the positive rank sum or the smaller of the two rank sums before comparing results to a table. The p value measures how unusual the observed rank imbalance would be if there were no median change. It does not measure the size or importance of the change.
Report a direction, an effect size, and the actual changes in context. A statistically detectable one point increase may still matter very little in a real classroom or clinic.