The Wilcoxon signed-rank test is a non-parametric statistical hypothesis test used when comparing two related samples, matched samples, or repeated measurements on a single sample to assess whether their population mean ranks differ (i.e. it is a paired difference test). It can be used as an alternative to the paired Student's t-test, t-test for matched pairs, or the t-test for dependent samples when the population cannot be assumed to be normally distributed.[1]
History[edit]
The test is named for Frank Wilcoxon (1892–1965) who, in a single paper, proposed both it and the rank-sum test for two independent samples (Wilcoxon, 1945).[2] The test was popularized by Siegel (1956)[3] in his influential text book on non-parametric statistics. Siegel used the symbol T for the value defined below as
. In consequence, the test is sometimes referred to as the Wilcoxon T test, and the test statistic is reported as a value of T. Other names may include the "t-test for matched pairs" or the "t-test for dependent samples".
Assumptions[edit]
- Data are paired and come from the same population.
- Each pair is chosen randomly and independent.
- The data are measured at least on an ordinal scale, but need not be normal.
Test procedure[edit]
Let
be the sample size, the number of pairs. Thus, there are a total of 2N data points. For
, let
and
denote the measurements.
- H0: median difference between the pairs is zero
- H1: median difference is not zero.
- For
, calculate
and
, where
is the sign function.
- Exclude pairs with
. Let
be the reduced sample size.
- Order the remaining
pairs from smallest absolute difference to largest absolute difference,
.
- Rank the pairs, starting with the smallest as 1. Ties receive a rank equal to the average of the ranks they span. Let
denote the rank.
- Calculate the test statistic
, the absolute value of the sum of the signed ranks.
- As
increases, the sampling distribution of
converges to a normal distribution. Thus,
- For
, a z-score can be calculated as
.
- If
then reject 
- For
,
is compared to a critical value from a reference table.[1]
- If
then reject 
- Alternatively, a p-value can be calculated from enumeration of all possible combinations of
given
.
Example[edit]
| |
|
|
 |
 |
 |
 |
 |
 |
| 1 |
125 |
110 |
1 |
15 |
| 2 |
115 |
122 |
–1 |
7 |
| 3 |
130 |
125 |
1 |
5 |
| 4 |
140 |
120 |
1 |
20 |
| 5 |
140 |
140 |
|
0 |
| 6 |
115 |
124 |
–1 |
9 |
| 7 |
140 |
123 |
1 |
17 |
| 8 |
125 |
137 |
–1 |
12 |
| 9 |
140 |
135 |
1 |
5 |
| 10 |
135 |
145 |
–1 |
10 |
|
order by absolute difference |
| |
|
|
 |
 |
 |
 |
 |
 |
 |
 |
| 5 |
140 |
140 |
|
0 |
|
|
| 3 |
130 |
125 |
1 |
5 |
1.5 |
1.5 |
| 9 |
140 |
135 |
1 |
5 |
1.5 |
1.5 |
| 2 |
115 |
122 |
–1 |
7 |
3 |
–3 |
| 6 |
115 |
124 |
–1 |
9 |
4 |
–4 |
| 10 |
135 |
145 |
–1 |
10 |
5 |
–5 |
| 8 |
125 |
137 |
–1 |
12 |
6 |
–6 |
| 1 |
125 |
110 |
1 |
15 |
7 |
7 |
| 7 |
140 |
123 |
1 |
17 |
8 |
8 |
| 4 |
140 |
120 |
1 |
20 |
9 |
9 |
|
is the sign function,
is the absolute value, and
is the rank. Notice that pairs 3 and 9 are tied in absolute value. They would be ranked 1 and 2, so each gets the average of those ranks, 1.5.


See also[edit]
- Mann-Whitney-Wilcoxon test (the variant for two independent samples)
- Sign test (Like Wilcoxon test, but without the assumption of symmetric distribution of the differences around the median, and without using the magnitude of the difference)
References[edit]
External links[edit]
Implementations[edit]
- ALGLIB includes implementation of the Wilcoxon signed-rank test in C++, C#, Delphi, Visual Basic, etc.
- The free statistical software R includes an implementation of the test as
wilcox.test(x,y, paired=TRUE), where x and y are vectors of equal length.
- GNU Octave implements various one-tailed and two-tailed versions of the test in the
wilcoxon_test function.
- SciPy includes an implementation of the Wilcoxon signed-rank test in Python