Wilcoxon Signed-Rank test (Go To The Calculator)

The Wilcoxon Signed-Rank test is a nonparametric test, it checks continuous or ordinal data for a significant difference between two dependent groups. The test finds the deltas of the two groups. Then, it sorts the pairs by the absolute value of the deltas.

When to use?

The test usually comes as a failsafe option to a paired t-test when the test doesn't meet the normality assumption, or contains many outliers.
A paired t-test compares the means of the two groups, while a Wilcoxon Signed-Rank test compares the entire distributions. If the two groups have a similar distribution curve, the test will also check if the median of the deltas is the expected value.
A paired t-test is slightly stronger than a Wilcoxon Signed-Rank Test. A Wilcoxon Signed-Rank Test has 95% efficiency in comparison to a paired t-test. If the population is similar to a normal distribution and reasonably symmetric, it is better to use a pair t-test.

Assumptions

Calculate W

Critical Value

When n is small, the tool will use the exact value from tables, the exact critical value is accurate (for common significant levels ), while the p-value is usually interpolated from two values in the table. The tool uses log interpolation which is more accurate with small p-values and less accurate with bigger p-values. (the common significant levels are small: 0.05, 0.01).
There is no consensus about what is a small n. When Method="automatic" the tool uses the Exact method when n ≤ 40, and normal approximation when n > 40.
When Method="z approximation" the tool uses only the normal approximation.

Statistical tables

Calculated the critical W from a statistic table.

Corrected normal approximation

To get more accurate results, the tool uses continuity correction and ties correction. ties is a group of observations with the same value. $$ z = \frac { W_- - \mu_w + C_{continuity}} {\sigma_w}\\ \mu= \frac {n(n+1)} {4}\\ \sigma^2= \frac {n(n+1)(2n+1)} {24} - C_{ties}$$

Continuity correction

When using Continuous distribution for a discrete data. it is better to use the continuity correction.
If  W > μ , Ccontinuity = - 0.5
If  W < μ , Ccontinuity = 0.5
When using a continuous data, Ccontinuity = 0.

Ties correction

$$C_{ties} = \sum_{i=1}^{t}{\frac{f_t^3-f_t}{48}}$$ t - group number of ties
f_t - number of values in group t

example: [1,2,2,2,3,4,5,5,5,5,6,7,8,8,8,8,8,8,9,10]
$$group_1: [2,2,2], \quad f_1=3\\ group_2: [5,5,5,5], \quad f_2=4\\ group_3: [8,8,8,8,8,8], \quad f_3=6$$

Example

In the following example, we check the number of questions answered correctly by the same subject, before and after performing a training.
The significant level (α) is 0.05;

Statistical tables

Two tailed (H0: Before = After)

Left tail (H0: Before ≥ After)

Right tail (H0: Before < After)

Corrected normal approximation

Two tailed (H0: Before = After)

Left tail (H0: Before ≥ After)

Right tail (H0: Before < After)