# Wilcoxon Signed-Rank Calculator

Perform the Wilcoxon signed-rank test for paired data. Enter two matched samples and get the T statistic, z-score, and p-value.

## What this calculates

Enter paired measurements (before/after, treatment A/B) to perform the Wilcoxon signed-rank test, the non-parametric alternative to the paired t-test.

## Inputs

- **Sample 1 (Before / Treatment A)** — Comma-separated values for the first measurement (up to 20 values).
- **Sample 2 (After / Treatment B)** — Comma-separated values for the second measurement (same number of values).

## Outputs

- **T Statistic** — The smaller of the positive and negative rank sums.
- **W+ (Positive Rank Sum)** — Sum of ranks where differences are positive.
- **W- (Negative Rank Sum)** — Sum of ranks where differences are negative.
- **Z-Score (Normal Approx.)** — Z-score for large-sample normal approximation.
- **Approximate P-Value (two-tailed)** — Two-tailed p-value from normal approximation.
- **Significant at α = 0.05?** — formatted as text — Whether the result is statistically significant.
- **Effective Pairs (n)** — Number of non-zero differences used in the test.
- **Calculation** — formatted as text — Step-by-step computation details.

## Details

**What is the Wilcoxon Signed-Rank Test?**

The Wilcoxon signed-rank test is a non-parametric test for comparing two related samples. Unlike the paired t-test, it does not assume the differences are normally distributed. It tests whether the median difference between pairs is zero.

**How it works:**

1. Calculate the difference for each pair (Sample 1 - Sample 2)
2. Discard pairs with zero difference
3. Rank the absolute differences (average ranks for ties)
4. Sum the ranks of positive differences (W+) and negative differences (W-)
5. T = min(W+, W-)
6. Compare T to the sampling distribution (or use the normal approximation for n > 10)

**Normal Approximation (n > 10):**

- E(T) = n(n+1)/4
- SD(T) = sqrt(n(n+1)(2n+1)/24)
- z = (T - E(T)) / SD(T)

**When to use Wilcoxon:**

- Paired or matched data (before/after, pre/post)
- Data that is ordinal or not normally distributed
- Small samples where normality is difficult to check
- You want to test the median difference rather than the mean

## Frequently Asked Questions

**Q: How is the Wilcoxon signed-rank test different from the paired t-test?**

A: The paired t-test assumes the differences between pairs are normally distributed and tests the mean difference. The Wilcoxon signed-rank test makes no normality assumption and effectively tests the median difference. Use Wilcoxon when your data is ordinal, skewed, has outliers, or when sample size is too small to verify normality.

**Q: What happens with tied differences?**

A: Zero differences (tied pairs) are excluded from the analysis, reducing the effective sample size. Tied non-zero absolute differences receive the average of the ranks they span. For example, if two absolute differences tie for ranks 3 and 4, both get rank 3.5.

**Q: How many pairs do I need for the Wilcoxon test?**

A: You need at least 5-6 non-zero difference pairs for the test to have reasonable power. The normal approximation used here works well for 10 or more effective pairs. For very small samples (under 10), exact tables should be consulted, as the normal approximation may be imprecise.

---

Source: https://vastcalc.com/calculators/statistics/wilcoxon
Category: Statistics
Last updated: 2026-04-08
