Wilcoxon Signed Rank Calculator
Run the Wilcoxon signed-rank test on paired before and after data, the non-parametric alternative to the paired t-test.
Wilcoxon Signed Rank Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: W = min(W⁺, W⁻)
Worked example — W = 0, W+ = 15, W- = 0, n = 5 | One-sided significant (p = 0.031), two-sided borderline (p = 0.063)
Formula
W = min(W⁺, W⁻)
Non-parametric alternative to paired t-test. Ranks absolute differences, sums positive and negative ranks.
Worked Examples
Example 1: Blood pressure before and after
Problem:Before: 125, 130, 140, 132, 128 | After: 110, 125, 135, 128, 120
Solution:Differences (before - after): 15, 5, 5, 4, 8. None is zero, so n = 5 pairs are used. Rank the absolute differences from smallest to largest: 4 gets rank 1, the two 5s take ranks 2 and 3, 8 gets rank 4, 15 gets rank 5. Every difference is positive, so W+ = 1 + 2 + 3 + 4 + 5 = 15 and W- = 0. W = min(15, 0) = 0, the most extreme value obtainable with 5 pairs. With n = 5 the exact two-sided p-value for W = 0 is 2/32 = 0.0625, just above 0.05; the one-sided p is 0.03125.
Result:W = 0, W+ = 15, W- = 0, n = 5 | One-sided significant (p = 0.031), two-sided borderline (p = 0.063)
Example 2: Mixed-direction differences (no ties)
Problem:Before: 10, 20, 30, 40, 50, 60 | After: 9, 22, 27, 36, 55, 54
Solution:Differences (before - after): 1, -2, 3, 4, -5, 6. All six are non-zero, so n = 6. The absolute differences 1, 2, 3, 4, 5, 6 are all distinct, so the ranks are simply 1, 2, 3, 4, 5, 6 with no tie correction needed. Positive differences 1, 3, 4 and 6 carry ranks 1, 3, 4 and 6: W+ = 14. Negative differences -2 and -5 carry ranks 2 and 5: W- = 7. Check: 14 + 7 = 21 = 6 x 7 / 2, so every rank is accounted for. W = min(14, 7) = 7. The two-sided 5 percent critical value for n = 6 is 0, and 7 is far above it.
Result:W = 7, W+ = 14, W- = 7, n = 6 | Above the critical value 0, so no significant shift
Frequently Asked Questions
What does the Wilcoxon signed-rank test measure?
The Wilcoxon signed-rank test assesses whether the median difference between paired observations is significantly different from zero. Unlike the paired t-test it considers both the direction and magnitude of differences by ranking absolute differences and summing the ranks for positive and negative differences separately.
How do you interpret W⁺, W⁻, and the W statistic?
W⁺ is the sum of ranks for positive differences (before > after) and W⁻ is the sum of ranks for negative differences. The test statistic W = min(W⁺, W⁻). Compare W to a critical value table for your sample size n (count of non-zero differences). If W is less than or equal to the critical value at your chosen α, reject the null hypothesis that the median difference equals zero.
When should I use Wilcoxon signed-rank instead of a paired t-test?
Use the Wilcoxon signed-rank test when paired differences are clearly non-normal — especially with small samples (n < 30), skewed distributions, or significant outliers. The paired t-test is preferred when normality holds because it is more statistically powerful. For very small samples (n < 10), consult exact critical value tables rather than relying on normal approximations.
What are the assumptions of the Wilcoxon signed-rank test?
Observations must be paired and each pair must be independent of other pairs; the differences must come from a continuous symmetric distribution (symmetry around the median, not necessarily normal); and the measurement scale must be at least interval (so that differences are meaningful and rankable). Zero differences are excluded from the analysis, and tied ranks are averaged using the standard mid-rank method.
How are tied absolute differences ranked?
Ties take mid-ranks, meaning every value in the tied block receives the average of the ranks that block occupies. Three differences tied across ranks 2, 3 and 4 each become rank 3, so the overall rank total is preserved. Heavy tying deflates the variance used by the large-sample normal approximation, so a tie correction should be applied before a Z value is computed.
Why are zero differences discarded, and what does that do to n?
A pair that shows no change carries no directional information, so the original procedure drops it and reduces n to the count of non-zero differences, which is the n Wilcoxon Signed Rank Calculator reports. Ranking then restarts from 1. Because discarding pairs costs power, some analysts prefer Pratt's method, which ranks the zeros along with everything else but leaves them out of the two rank sums.
How is W converted into a Z-score for larger samples?
Under the null hypothesis W⁺ has mean n(n+1)/4 and standard deviation equal to the square root of n(n+1)(2n+1)/24, where n counts the non-zero differences. Subtracting the mean and dividing by that standard deviation gives a Z value read against the standard normal distribution. The approximation becomes reasonable once n reaches roughly twenty; below that, use exact critical-value tables.
What is the relationship between W⁺, W⁻ and n?
The ranks 1 through n are shared out between the two sums, so W⁺ + W⁻ = n(n+1)/2 always holds. With eight non-zero differences the total is 36, so a W⁺ of 30 forces W⁻ to be 6 and therefore W = 6. A large imbalance between the two sums is exactly the signal the test looks for; a near-even split means changes go both ways with similar magnitudes.
What effect size should I report with the test?
Use the matched-pairs rank-biserial correlation: the difference W⁺ − W⁻ divided by n(n+1)/2. It runs from −1 to +1, where +1 means every non-zero difference went the positive way and 0 means the positive and negative ranks balance exactly. It turns the rank sums into a scale-free measure of how one-sided the change is, which W on its own does not convey.
How does the signed-rank test differ from the sign test?
The sign test counts only how many differences are positive versus negative and ignores their size, so it needs no symmetry assumption but throws away information. The signed-rank test also ranks the magnitudes, which makes it more powerful when the distribution of differences is roughly symmetric about its median. If that symmetry is clearly violated, the plainer sign test is the safer choice.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator · Editorial policy
Related Calculators
🧮Matrix Rank Calculator
Calculate matrix rank with inputs, formulas, and instant results.
🧮Annulus Area Calculator
Calculate annulus area with inputs, formulas, and instant results.
🧮Area Calculator
Calculate area with inputs, formulas, and instant results.
🧮Area of a Rectangle Calculator
Calculate the area, perimeter, and diagonal of a rectangle. Find missing sides from known area. Convert between metric and imperial area units.
🧮Area of Crescent Calculator
Calculate area of crescent with inputs, formulas, and instant results.
🧮Center of Mass Calculator
Calculate center of mass with inputs, formulas, and instant results.
🧮Centroid Calculator
Calculate centroid with inputs, formulas, and instant results.
🧮Chord Length Calculator
Calculate chord length with inputs, formulas, and instant results.