Statistics and research

Wilcoxon signed-rank test calculator

Wilcoxon signed-rank test for paired samples or one sample against a median, exact for small samples, with the matched-pairs rank-biserial correlation.

Runs in your browser. What you enter stays on this page and is not uploaded.

Separate values with spaces, commas, tabs or new lines (paste a spreadsheet column). Use a point for decimals.

Results

V (W⁺)40p-value0.03906Rank-biserial r0.7778
Sum of positive ranks V = W⁺ (R’s V)
40
Sum of negative ranks W⁻
5
Smaller sum T
5
Non-zero differences n
9
Zero differences dropped
0
Method
Exact distribution (n < 50, no ties or zeros)
Hypothesis
two-sided
p-value
0.03906
Conclusion
The median difference differs from 0 (significant at the 5% level).

Zero differences are dropped before ranking (Wilcoxon’s method, as R). The rank-biserial correlation is (W⁺ − W⁻) / (W⁺ + W⁻).

Method and limits

How to use it

For paired data (before and after, two treatments on the same subjects) paste both samples in the same order. For one sample, compare its median with a hypothesized value.

Formulas

  • Differences d = x₁ − x₂ − μ₀ (or x − μ₀); zero differences are dropped (Wilcoxon’s method, as R).
  • Rank |d| (average ranks for ties); V = W⁺ = sum of the ranks of positive differences.
  • Exact p-value from the distribution of V when n < 50 and there are no ties or zeros; otherwise z = (V − n(n + 1)/4 ∓ 0.5) / √(n(n + 1)(2n + 1)/24 − Σ(t³ − t)/48).
  • Matched-pairs rank-biserial r = (W⁺ − W⁻) / (W⁺ + W⁻).

Assumptions and limits

  • Pairs are independent of each other; the differences are symmetric about their median for it to be a test of the median.
  • Many zero or tied differences reduce power and force the normal approximation.

Worked example

R’s example (depression scale before and after therapy, 9 patients): V = 40, W⁻ = 5; exact two-sided p = 0.0391 (one-sided 0.0195, as in R’s documentation); rank-biserial r = 0.78.

References

Related tools

Share this page

Remind me to visit Contifield

Adds a repeating reminder to your calendar, titled “Contifield Reminder: Visit www.contifield.com”.