Wilcoxon Signed-Rank test (go to the calculator)

Wilcoxon Signed-Rank test Calculator

The Wilcoxon Signed-Rank test is a nonparametric test, it compares Interval scale data for a significant difference between two dependent groups. The test finds the differences 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 (usually zero).
When the two groups have a similar symmetrical distribution curve, the test will also check if the mean 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 or reasonably symmetric with sample size of at least 30, it is better to use the paired 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 to calculate discrete data it is better to use continuity correction.
P(X < a) => P(X < a - 0.5)
P(X > a) => P(X > a + 0.5)

As a result:
Right tail, or two tails with positive Z, (W- > μ) , Ccontinuity = -0.5 .
Left tail, or two tails with negative Z, (W- < μ) , Ccontinuity = 0.5 .
When we don't correct the 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$$

Effect Size

The standardized effect size $$r=\frac{Z}{\sqrt{n}}$$ The common language effect size is the probability that a random value from Group1 (like before) is greater than his dependent value from Group2 (like after).
$$ f=\frac{2W}{n(1+n)}$$

Example

In the following example, we check the number of questions answered correctly by the same subject, before and after performing 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)