Wilcoxon signed-rank test

From Wikipedia, the free encyclopedia - View original article

Jump to: navigation, search

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]

The Wilcoxon signed-rank test is not the same as the Wilcoxon rank-sum test, although both are nonparametric and involve summation of ranks.


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 Sidney Siegel (1956)[3] in his influential text book on non-parametric statistics. Siegel used the symbol T for a value related to, but not the same as, W. In consequence, the test is sometimes referred to as the Wilcoxon T test, and the test statistic is reported as a value of T.


  1. Data are paired and come from the same population.
  2. Each pair is chosen randomly and independently.
  3. The data are measured at least on an ordinal scale, but need not be normal.

Test procedure[edit]

Let N be the sample size, the number of pairs. Thus, there are a total of 2N data points. For i = 1, ..., N, let x_{1,i} and x_{2,i} denote the measurements.

H0: median difference between the pairs is zero
H1: median difference is not zero.
  1. For i = 1, ..., N, calculate |x_{2,i} - x_{1,i}| and \sgn(x_{2,i} - x_{1,i}), where \sgn is the sign function.
  2. Exclude pairs with |x_{2,i} - x_{1,i}| = 0. Let N_r be the reduced sample size.
  3. Order the remaining N_r pairs from smallest absolute difference to largest absolute difference, |x_{2,i} - x_{1,i}|.
  4. Rank the pairs, starting with the smallest as 1. Ties receive a rank equal to the average of the ranks they span. Let R_i denote the rank.
  5. Calculate the test statistic W
    W = |\sum_{i=1}^{N_r} [\sgn(x_{2,i} - x_{1,i}) \cdot R_i]|, the absolute value of the sum of the signed ranks.
  6. As N_r increases, the sampling distribution of W converges to a normal distribution. Thus,
    For N_r \ge 10, a z-score can be calculated as z = \frac{W - 0.5}{\sigma_W}, \sigma_W = \sqrt{\frac{N_r(N_r + 1)(2N_r + 1)}{6}}.
    If z > z_{critical} then reject H_0

    For N_r < 10, W is compared to a critical value from a reference table.[1]

    If W \ge W_{critical, N_r} then reject H_0

    Alternatively, a p-value can be calculated from enumeration of all possible combinations of W given N_r.

The T statistic used by Siegel is the smaller of two sums of ranks of given sign; in the example given below, therefore, T would equal 3+4+5+6=18. Low values of T are required for significance. As will be obvious from the example below, T is easier to calculate by hand than W.

Excluding zeros is not a statistically justified method and such an approach can lead to enormous calculation errors. A more stable method is:[4]


   x_{2,i} - x_{1,i}
2115122 –17
5140140 0
6115124 –19
8125137 –112
10135145 –110
order by absolute difference
   x_{2,i} - x_{1,i}
i_{}x_{2,i}x_{1,i}\sgn\text{abs}R_i\sgn \cdot R_i
5140140 0  
2115122 –173 –3
6115124 –194 –4
10135145 –1105 –5
8125137 –1126 –6
sgn is the sign function, \text{abs} is the absolute value, and R_i 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.
N_r = 10 - 1 = 9, W = |1.5+1.5-3-4-5-6+7+8+9| = 9.
W < W_{\alpha = 0.05, 9} = 39  \therefore \text{fail to reject } H_0.

See also[edit]


  1. ^ a b Lowry, Richard. "Concepts & Applications of Inferential Statistics". Retrieved 24 March 2011. 
  2. ^ Wilcoxon, Frank (Dec 1945). "Individual comparisons by ranking methods". Biometrics Bulletin 1 (6): 80–83. 
  3. ^ Siegel, Sidney (1956). Non-parametric statistics for the behavioral sciences. New York: McGraw-Hill. pp. 75–83. 
  4. ^ Ikewelugo Cyprian Anaene Oyeka (Apr 2012). "Modified Wilcoxon Signed-Rank Test". Open Journal of Statistics: 172–176. 

External links[edit]