Summary
The Wilcoxon Signed Rank Test is a non-parametric statistical test used to compare two related (paired) measurements when the differences are not normally distributed. In extension and survey research, it helps a researcher judge whether a training, demonstration or programme has produced a real change, for example in farmers’ knowledge, attitude, adoption score or yield, by comparing the same respondents before and after. Because it works on the ranks of the differences rather than the raw values, it suits small samples, skewed data and measurements where the size of a difference can be meaningfully ranked. (For single Likert items, where differences are coarse and heavily tied, the sign test is the better choice.) This blog gives a simple explanation of the concept, the methodology, a solved example with interpretation, and a demonstration of the test in Agri Analyze.
1. Introduction
The Wilcoxon Signed Rank Test was proposed by Frank Wilcoxon in 1945. It is the non-parametric alternative to the paired t-test. Instead of using the actual size of the differences between paired observations, it ranks the absolute differences and then compares the sum of ranks of positive differences with the sum of ranks of negative differences. If a treatment has no effect, positive and negative changes should be roughly balanced; a large imbalance indicates a real shift.
Many situations in agricultural extension involve paired data: the same farmers are assessed before and after a training programme, the same plots are measured with and without an intervention, or the same respondents rate two practices. The paired t-test assumes that the differences are normally distributed, which is often not true for small samples or for rating scales. The Wilcoxon test relaxes this assumption.
The test helps researchers answer:
- Did the central value (median) of the paired differences change after the intervention?
- Is the observed change large enough to be unlikely due to chance?
- How strong is the effect?
How is it different from the paired t-test?
Paired t-test
- Uses the mean of the differences.
- Assumes the differences are approximately normally distributed.
- Sensitive to outliers.
- Needs interval or ratio data.
Wilcoxon Signed Rank Test
- Uses the ranks of the differences (both direction and relative size).
- Needs only that the differences can be ranked and are roughly symmetric around their center.
- Robust to outliers and skewness.
- Suits ordinal data only when the size of the differences is meaningful, for example summed or averaged scale scores. For single Likert items, use the sign test instead.
2. Popular Use Cases for Extension and Survey Research
(a) Agricultural Extension
- Knowledge scores of farmers before and after training
- Change in adoption score after a demonstration or field day
- Impact of an ICT or mobile advisory service on awareness
- Before and after comparison of income or yield under a project
(b) Survey Research
- Change in attitude or perception after exposure to a campaign
- Comparison of two ratings given by the same respondent (for example, satisfaction with two services)
- Pre and post evaluation of development programmes
(c) Biometrical and Agronomic Studies
- Paired plot comparison of two varieties or treatments
- Before and after soil or crop parameter measurements on the same unit
(d) Social Sciences
- Change in empowerment, confidence or behavioral scores after an intervention.
3. Assumptions of the Test
- The data are paired, i.e. two measurements on the same subject or matched units.
- The dependent variable is measured on at least an ordinal scale, and the size of each difference can be meaningfully ranked. Single Likert items give very coarse, heavily tied differences; use the sign test for them. Summed or averaged Likert scale scores are fine.
- The pairs are independent of each other.
- The distribution of the differences is approximately symmetric around its center (it need not be normal).
4. Methodology of the Wilcoxon Signed Rank Test
Step 1: Formulate the Hypotheses
- : The median of the paired differences is zero (no change after the intervention).
- : The median of the paired differences is not zero (two-tailed), or is greater or less than zero (one-tailed).
Strictly, is a statement about the median only when the distribution of the differences is symmetric. Otherwise it is a statement about the pseudomedian, which is the Hodges–Lehmann location estimate (the median of all pairwise averages of the differences).
Step 2: Compute the Differences
For each pair, calculate
Discard pairs where and reduce accordingly. From here on, is the number of non-zero differences.
Step 3: Rank the Absolute Differences
Ignore the signs and rank from smallest (rank 1) to largest. If two or more values tie, assign each the average of the ranks they occupy.
Step 4: Attach Signs to the Ranks
Give each rank the sign of its original difference. Then compute
where is the rank of . Check:
Step 5: Test Statistic
Note on conventions: textbooks and critical-value tables use , whereas statistical software (R, and Agri Analyze) reports . Both conventions lead to the same two-sided p-value, because and are mirror images around .
For small samples (up to about ), is compared with the critical value from the Wilcoxon table, and is rejected if critical value. For larger samples, a normal approximation is used:
- Mean:
- Variance: , where the second term is the tie correction and is the number of tied values in each group
- , or with continuity correction
Step 6: Effect Size
Here is the number of non-zero pairs. Some texts divide by , where is the total number of observations, which gives a smaller ; always state which one you used. Following Cohen (1988), is a small, a medium and or more a large effect.
Step 7: Decision and Interpretation
If is less than or equal to the critical value (small samples), or the p-value is less than the chosen significance level (usually 0.05), reject and conclude that there is a significant change. Report the direction of change using the median difference (and the Hodges–Lehmann estimate), along with the effect size.
5. Solved Example (Manual Calculation)
In an extension study, the knowledge score of 10 farmers about integrated pest management was recorded before and after a training programme.
| Farmer | Before | After | | | Rank of | Signed Rank |
|---|
| 1 | 45 | 58 | 13 | 13 | 8.5 | +8.5 |
| 2 | 52 | 60 | 8 | 8 | 4 | +4 |
| 3 | 38 | 50 | 12 | 12 | 6 | +6 |
| 4 | 60 | 66 | 6 | 6 | 2.5 | +2.5 |
| 5 | 48 | 47 | −1 | 1 | 1 | −1 |
| 6 | 55 | 70 | 15 | 15 | 10 | +10 |
| 7 | 42 | 55 | 13 | 13 | 8.5 | +8.5 |
| 8 | 50 | 62 | 12 | 12 | 6 | +6 |
| 9 | 58 | 64 | 6 | 6 | 2.5 | +2.5 |
| 10 | 40 | 52 | 12 | 12 | 6 | +6 |
5.1 Why the Wilcoxon test for these data?
The ten differences are −1, 6, 6, 8, 12, 12, 12, 13, 13 and 15 (mean 9.6, median 12, SD 4.84). A Shapiro–Wilk test on the differences gives , , so normality is not rejected. This should not be read as proof of normality: with only 10 pairs the Shapiro–Wilk test has little power, and the differences are visibly left-skewed because one farmer (−1) is discordant. A paired t-test would also reach the same conclusion here (, df = 9, ). We use the Wilcoxon test because it does not depend on normality and because this small example is a convenient way to show every step by hand. If the differences were clearly normal, the paired t-test would be slightly more powerful. For a dataset where normality is clearly rejected, see the milk-yield example in our Paired t-test [Video: https://www.youtube.com/watch?v=NEAEITu3lkQ&t=102s].
One caution: the test assumes roughly symmetric differences, and these are mildly left-skewed. We return to this when interpreting the Hodges–Lehmann estimate in Section 8.2.
5.2 Hypothesis
- : Training has no effect on knowledge score (median difference ).
- : Training changes the knowledge score (median difference ).
5.3 Ranking with Ties
Sorted absolute differences: 1, 6, 6, 8, 12, 12, 12, 13, 13, 15.
- 1 takes rank 1.
- The two 6s share ranks 2 and 3, so each gets 2.5.
- 8 takes rank 4.
- The three 12s share ranks 5, 6 and 7, so each gets 6.
- The two 13s share ranks 8 and 9, so each gets 8.5.
- 15 takes rank 10.
5.4 Sum of Signed Ranks
- (only farmer 5 had a decrease)
- Check: ✔
Test statistic: . Statistical software reports .
5.5 Decision Using the Critical-Value Table
Because is small, the critical-value table is the decision rule. For and a two-tailed , the critical value is 8. Since , is rejected. (The critical value at is 3, so the result is significant at the 1% level as well.)
5.6 Large-Sample Illustration: Normal Approximation and p-value
The normal approximation is not needed for , but it is what statistical software uses when ties are present, so it is shown here to reconcile with the software output.
- before tie correction
- Tie correction
- , so
- Without continuity correction:
- With continuity correction: , i.e.
The two-tailed p-value from the normal approximation with tie and continuity corrections is . This is the p-value we report, and it is the one the software gives. (As a cross-check, an exact permutation test that respects the ties gives ; the exact value is smaller, so the normal approximation is the more conservative of the two.)
5.7 Effect Size
, a large effect by Cohen’s benchmarks. If the total number of observations is used instead (), , which is still large.
5.8 Final Result Table
| Statistic | Value |
|---|
| (non-zero pairs) | 10 |
| (reported by software as ) | 54 |
| 1 |
| 1 |
| Critical value (, , two-tailed) | 8 |
| (tie and continuity corrected) | −2.66 |
| p-value (two-tailed, normal approximation with tie and continuity corrections) | 0.0078 |
| Median of the differences | 12 |
| Hodges–Lehmann estimate | 10 |
| Effect size () | 0.84 |
5.9 Interpretation
- Decision: Since (and ), is rejected. There is a statistically significant change in knowledge score after the training.
- Direction: Nine of the ten farmers improved, and only one showed a small decline of 1 point. The positive ranks () dominate the negative ranks ().
- Magnitude: The median improvement is 12 points, and the effect size indicates a large effect.
- Practical meaning: Within this small group, knowledge scores were clearly higher after the training than before.
- Caution: With only 10 farmers and no comparison group, the result should be confirmed with a larger sample. A significant result shows a change, not necessarily that the training alone caused it, unless the design controls for other factors.
6. How to Report the Result
A Wilcoxon signed rank test showed a significant increase in farmers’ knowledge scores after the training programme (, , , , ). The median difference was 12 points (Hodges–Lehmann estimate = 10).
7. Steps to Perform the Wilcoxon Signed Rank Test using Agri Analyze
Agri Analyze is a tool that helps researchers perform non-parametric tests online without any software installation
Step 1: Open the tool. Open the Wilcoxon Signed Rank Test page of Agri Analyze: https://www.agrianalyze.com/WilcoxonSignedRankTest. For first-time users, free registration is mandatory.
Step 2: Prepare the CSV file. Create a CSV file with one column for the before (pre) measurement and one column for the after (post) measurement. Each row is one respondent. Sample layout (the data of our solved example):
| Farmer | Knowledge Score Before | Knowledge Score After |
|---|
| 1 | 45 | 58 |
| 2 | 52 | 60 |
| 3 | 38 | 50 |
| 4 | 60 | 66 |
| 5 | 48 | 47 |
| 6 | 55 | 70 |
| 7 | 42 | 55 |
| 8 | 50 | 62 |
| 9 | 58 | 64 |
| 10 | 40 | 52 |
Step 3: Upload the file and set the options. Upload the CSV file, select the Before and After columns, and set the options: the significance level (, usually 0.05), the hypothesized median (0 for testing paired differences), and the alternative hypothesis (two-sided, greater or less).

Step 4: Submit and download the report. Click submit, pay the nominal fee, and download the output report with detailed interpretation. Output report for this example:
Video tutorial: https://www.youtube.com/watch?v=NEAEITu3lkQ&t=102s
Descriptive Statistics of Data
| Statistics | Knowledge_Score_Before | Knowledge_Score_After | Difference |
|---|
| Mean | 48.8 | 58.4 | 9.6 |
| Median | 49.0000 | 59.0000 | 12.0000 |
| Variance | 57.2889 | 54.7111 | 23.3778 |
| Standard Deviation | 7.5689 | 7.3967 | 4.8351 |
| Coefficient of variation | 15.5101 | 12.6656 | 50.3652 |
| Inter-quartile range | 11.5 | 10.75 | 6.25 |
| Skewness | 0.0335 | -0.0369 | -0.8943 |
| Kurtosis | -1.5852 | -1.4539 | -0.4046 |
Box plot

Distribution of the differences (solid line = 0, dashed line = median; check for symmetry)

Positive vs negative ranks (signed-rank distribution)

Additional Plot (non-parametric)

Shapiro-Wilk test on the differences (used to justify a non-parametric test)
Null hypothesis (Ho): The differences are normally distributed
Alternative Hypothesis (Ha): The differences are not normally distributed
Results: Shapiro-Wilk statistic: 0.8629 and P-value: 0.0824
Interpretation: The p value 0.0824 is greater than alpha ( 0.05 ). The differences appear normally distributed, so a paired t-test would be slightly more powerful; the Wilcoxon test remains valid and conservative.
Ranks
| Ranks | N | Mean Rank | Sum of Ranks |
|---|
| Negative Ranks | 1 | 1.0000 | 1.0000 |
| Positive Ranks | 9 | 6.0000 | 54.0000 |
| Ties | 0 | | |
| Total | 10 | | |
a. Negative Ranks: Knowledge_Score_After < Knowledge_Score_Before
b. Positive Ranks: Knowledge_Score_After > Knowledge_Score_Before
c. Ties: Knowledge_Score_After = Knowledge_Score_Before
Results of the Wilcoxon signed-rank test
Ho: median of the differences in Knowledge Score (Knowledge.Score.After − Knowledge.Score.Before) = 0
Ha: median of the differences in Knowledge Score (Knowledge.Score.After − Knowledge.Score.Before) ≠ 0
| Particulars | Value |
|---|
| Hypothesized median (mu, by user) | 0 |
| V statistic (sum of positive ranks, W+) | 54.0000 |
| Sum of negative ranks (W-) | 1.0000 |
| Effective n (non-zero differences) | 10 |
| Zero differences dropped | 0 |
| Tied absolute-difference groups | 3 |
| Z (normal approximation, tie and continuity corrected) | 2.6606 |
| P value | 0.0078 |
| Hodges-Lehmann estimate (median difference) | 10.0000 |
| Lower limit of Conf. interval | 6.0000 |
| Upper limit of Conf. interval | 13.0000 |
Interpretation: The p value 0.0078 was less than alpha (0.05). The result is significant and we reject the null hypothesis. The median of the differences in Knowledge Score is significantly different from 0; knowledge scores were higher after the training (Hodges–Lehmann estimate = 10, 95% CI 6 to 13).
Symmetry check: skewness of the differences is -0.8943, a mild left skew driven by the one farmer whose score fell by 1 point. The signed-rank test assumes roughly symmetric differences, so report the median difference alongside the Hodges–Lehmann estimate; if the asymmetry were strong, the sign test would be a more conservative alternative.
8. Reconciling the Report with the Hand Calculation
8.1 Test Statistic, Z and p-value
| Statistic | Value |
|---|
| () | 54 |
| −2.66 (sign depends on the software’s convention) |
| p-value (two-tailed) | 0.0078 |
is the sum of positive ranks, the same we found by hand; the hand-calculated is the same test seen from the other tail, so both give the same p-value. The p-value is below 0.05, so is rejected. The hand-calculated with tie and continuity corrections () and agree with the report.
8.2 Hodges–Lehmann Estimate and Confidence Interval
| Statistic | Value |
|---|
| Hodges–Lehmann estimate (pseudomedian) | 10 |
| 95% confidence interval | approximately 6 to 13 |
The Hodges–Lehmann estimate is the median of all 55 pairwise averages with (the Walsh averages). The interval does not contain zero, which agrees with the rejection of . We estimate that training raised the knowledge score by about 10 points, with the plausible range being roughly 6 to 13 points.
Why 10 and not 12? The median of the observed differences is 12, the middle of the ten raw differences. The Hodges–Lehmann estimate uses every pair of differences, so the one discordant value () pulls many of the 55 averages down and the estimate falls to 10. The two answer slightly different questions: the median describes the typical farmer in this sample, while the Hodges–Lehmann estimate is the shift that corresponds to the Wilcoxon test and comes with a confidence interval. Because the differences are mildly left-skewed, the gap between the two is a useful reminder to report both. When the differences are symmetric, the two will be close.
9. Quick Tips for Researchers
- Use the Wilcoxon test only for paired data. For two independent groups, use the Mann-Whitney U test instead.
- For more than two related measurements (for example, pre, mid and post), use the Friedman test. For more than two independent groups, use the Kruskal-Wallis test.
- For single Likert items, use the sign test rather than the Wilcoxon test.
- Check the normality of the differences (not of the raw before and after scores) when deciding between the paired t-test and the Wilcoxon test.
- Always report the median, the Hodges–Lehmann estimate and the effect size along with the p-value, and say which method you used for the p-value.
- Report how many pairs were dropped because of zero differences.
- If the differences are strongly asymmetric, consider the sign test as a more conservative option.
References
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.
Hodges, J. L., & Lehmann, E. L. (1963). Estimates of location based on rank tests. The Annals of Mathematical Statistics, 34(2), 598–611.
Hollander, M., Wolfe, D. A., & Chicken, E. (2014). Nonparametric Statistical Methods (3rd ed.). John Wiley & Sons.
Panse, V. G., & Sukhatme, P. V. (1985). Statistical Methods for Agricultural Workers (4th ed.). Indian Council of Agricultural Research, New Delhi.
Siegel, S., & Castellan, N. J. (1988). Nonparametric Statistics for the Behavioral Sciences (2nd ed.). McGraw-Hill.
Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83.
Written by
Tejas S
PhD Scholar, Department of Agricultural Statistics, BA College of Agriculture, Anand Agricultural University, Anand
Connect with Tejas S on LinkedIn