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.
Results
- 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
- T-test calculatorOne-sample, independent two-sample (Welch and pooled) and paired t-tests from raw data or summary statistics, with confidence intervals and Cohen’s d.
- Mann–Whitney U test calculatorWilcoxon rank-sum (Mann–Whitney U) test for two independent samples, exact for small samples without ties, with the rank-biserial effect size.
- Effect size calculatorCohen’s d, Hedges’ g and Glass’s Δ from group means, or odds ratio, risk ratio and risk difference from a 2×2 table, each with confidence intervals.
- Power and sample size calculatorStatistical power or the sample size needed for one-sample, paired and two-sample t-tests and for comparing two proportions.
- P-value calculatorFind the p-value and critical values for a z, t, chi-square or F test statistic, one- or two-tailed, accurate far into the tails.
- Standard deviation calculatorPaste data to get the standard deviation (sample and population), variance, mean, median, mode, quartiles with the method stated, IQR, outliers, skewness and kurtosis.