The Wilcoxon Signed-Rank Test is designed to compare two related groups or repeated measurements when your data doesn't follow a normal distribution. It tests whether the differences between pairs of observations are symmetrically distributed around zero. It is a non-parametric alternative to the paired t-test. Common applications include analyzing before-and-after measurements like patient recovery scores, treatment outcomes, or paired observations of any kind. This calculator performs the complete analysis, including hypothesis testing, effect sizes, and descriptive statistics, while generating publication-ready reports. To see how it works, .
Different statistical software packages report the Wilcoxon Signed-Rank test statistic in distinct ways:
wilcox.test): Reports , which is the sum of all positive ranks.scipy.stats.wilcoxon): Reports , where:Wilcoxon Signed Rank Test is a non-parametric alternative to the paired t-test. It tests the null hypothesis that the differences between pairs of observations come from a distribution with zero median, without requiring normality.
Test Statistic:
Where:
For small sample sizes, the test statistic is compared to a critical value from the Wilcoxon Signed Rank table:
For larger samples (typically n > 20), a z-approximation is used:
Where n is the number of pairs with non-zero differences.
Weight measurements before and after treatment (kg):
| Subject | Before | After | Difference | Absolute Difference | Rank | Signed Rank |
|---|---|---|---|---|---|---|
| 1 | 70 | 68 | +2 | 2 | 3 | +3 |
| 2 | 80 | 78 | +2 | 2 | 3 | +3 |
| 3 | 90 | 91 | -1 | 1 | 1 | -1 |
| 4 | 60 | 58 | +2 | 2 | 3 | +3 |
| 5 | 85 | 85 | 0 (ignored) | 0 | - | - |
wilcox.test)scipy.stats.wilcoxon for a two-sided test)Both refer to the same test and yield the same p-value; only the displayed statistic differs by software convention. For comparison against a Wilcoxon Signed-Rank critical-value table, we use .
The critical value for a two-tailed test at with (remove 1 tie in the difference) is 0 by using the Wilcoxon Signed Rank Table.
The test statistic is greater than the critical value, , we fail to reject the null hypothesis. There is not enough evidence to suggest that the median difference between the two groups is different from zero.
# Sample data
before <- c(70, 80, 90, 60, 85)
after <- c(68, 78, 91, 58, 85)
# Perform the test using the same asymptotic method as the calculator
result <- wilcox.test(
before,
after,
paired = TRUE,
correct = TRUE,
exact = FALSE
)
# Print results
print(result)from scipy.stats import wilcoxon
# Sample data
before = [70, 80, 90, 60, 85]
after = [68, 78, 91, 58, 85]
# Calculate the test using the same asymptotic method as the calculator
stat, p_value = wilcoxon(
before,
after,
correction=True,
method="asymptotic",
)
# Print results
print(f"Wilcoxon Signed Rank Test Statistic: {stat}")
print(f"P-value: {p_value}")Consider these alternatives: