logo

Wilcoxon Signed-Rank Test 📂Statistical Test

Wilcoxon Signed-Rank Test

Hypothesis testing

$n$ random samples (see random sample) are given as $\left\{ \left( X_{k} , Y_{k} \right) \right\}_{k=1}^{n}$ in the form of ordered pairs. The random variable defined by their differences $Z_{k} = X_{k} - Y_{k}$ follows a continuous probability distribution whose unique population mean and population median is $\theta$, and its probability density function $f(z)$ is assumed to be a function symmetric (see symmetry) about $z = \theta$12. The following hypothesis test for $\theta$ is called the Wilcoxon signed-rank test.

  • $H_{0} : \theta = 0$, there is no difference between the two populations.
  • $H_{1} : \theta \ne 0$, there is a difference between the two populations.

Test statistic 3

For the indicator function (see indicator function) $I$, the minimum (see minimum) $\min$ and $Z_{k}$, and the absolute value $\left\{ \left| Z_{k} \right| \right\}_{k=1}^{n}$ and the rank $R$ at those values, define the following test statistic $T$. $$ \begin{align*} T^{+} &= \sum_{k=1}^{n} I \left( Z_{k} > 0 \right) R \left( \left| Z_{k} \right| \right) \\ T^{-} &= \sum_{k=1}^{n} I \left( Z_{k} < 0 \right) R \left( \left| Z_{k} \right| \right) \\ T =& \min \left( T^{+} , T^{-} \right) \end{align*} $$

Explanation

The definition of the test statistic may look somewhat complicated, but if you consider the procedure, it is not difficult:

  1. For every $k = 1 , \cdots , n$ compute the difference between $X_{k}$ and $Y_{k}$.
  2. Take $\left| Z_{k} \right| = \left| X_{k} - Y_{k} \right|$ and assign ranks.
  3. Split into the group with positive differences and the group with negative differences and compute $T^{+}$ and $T^{-}$.
  4. Choose the smaller of the two as $T$.

The computation can be seen as a mixture of the Mann–Whitney test and the sign test. In particular, depending on the sign of $Z_{k}$ it splits the $n = n_{1} + n_{2}$ samples that were originally indistinguishable and computes the sum of their ranks. In practice, the hypothesis test also uses separate tables similar to those for the Mann–Whitney test.

Depending on the textbook or paper, the criterion for choosing between $T^{+}$ and $T^{-}$ may differ, and some sources compute only $T^{+}$; however, algebraically they satisfy $T^{+} + T^{-} = n \left( n + 1 \right) / 2$, so knowing one essentially gives you the other. The choice affects which table is used, but there is no essential difference.


  1. Taheri, S.M., Hesamian, G. A generalization of the Wilcoxon signed-rank test and its applications. Stat Papers 54, 457–470 (2013). https://doi.org/10.1007/s00362-012-0443-4 ↩︎

  2. Gwowen Shieh , Show-Li Jan & Ronald H. Randles (2007) Power and sample size determinations for the Wilcoxon signed-rank test, Journal of Statistical Computation and Simulation, 77:8, 717-724, DOI: 10.1080/10629360600635245 ↩︎

  3. Mendenhall. (2012). Introduction to Probability and Statistics (13th Edition): p646. ↩︎