3.9 Ties in the Rank-Sum Test
As with the signed-rank test, tied observations are given average ranks and the variance must be reduced to match. Writing \(N = m + n\) for the combined sample size, \[\operatorname {var}(U) = \dfrac {mn}{12}\left [ (N + 1) - \dfrac {\sum _{p}\left (t_p^{3} - t_p\right )}{N(N-1)}\right ],\] where \(t_p\) is the size of the \(p\)-th group of tied values in the combined sample — both groups pooled, since ranking is done on the pooled data. With no ties the subtracted term is zero and the variance returns to \(\dfrac {mn(N+1)}{12}\).
A continuity correction of \(0.5\) may also be applied, replacing \(U\) by \(U \pm 0.5\) in the direction that moves \(Z\) towards zero.
Note 3.16. Ties are not a rare nuisance. Any measurement recorded to a coarse scale — whole kilograms, whole years, a Likert scale — will produce them in quantity, and it is exactly such data that non-parametric methods are chosen for in the first place. The tie correction is the normal case here, not the exception.
Since \(U\) assumes only integer values, a continuity correction of \(0.5\) may be used alternatively the
Wilcoxon-Mann-Whitney statistic is computed as follows.
We assume the 2 samples are drawn from a continuous distribution so that the probability of \(X_i=Y_j\) for
some \(i\hspace {0.3cm} \text {and}\hspace {0.3cm} j\) need not to be considered. If \(mn\) indicators random variables are defined as \[D_{ij}= \begin {cases} 1, &\text {if}\hspace {0.3cm} Y_j<X_i\\ 0, &\text {if}\hspace {0.3cm} Y_j>X_i\\ \end {cases} \] for \(i=1,2,\dots ,n\) and
\(j=1,2,\dots ,m\).
The \(U\) statistic is given by \(\displaystyle {U=\sum ^n_{i=1}\sum ^m_{j=1}D_{ij}}.\)
The logical rejection region \(R\), test statistic for 1-sided \(H_1\), that the \(Ys\) are stochastically lager than the
\(Xs\).
\[H_1:F_Y(x)\leq F_X(x)\]
strict equality for some \(x\). Would clearly be small values of \(U\).
Example 3.17. A researcher wants to know which of two positions is the more relaxing. Relaxation is measured by EMG biofeedback from the frontalis muscle. Eleven subjects are assigned at random, five to the supine position and six to sitting, so the two groups are independent and the Wilcoxon–Mann–Whitney test applies. Take \(\alpha =0.05\) and \[H_0:\text {the two positions give the same distribution of relaxation},\] \[H_a:\text {they differ}\hspace {0.4cm}(\text {two-sided}).\]
Solution. Rank the combined sample. All eleven readings are pooled and ranked from \(1\) to \(11\); the ranks are then returned to their groups.
| Supine | Rank | Sitting | Rank |
| 20 | 5 | 10 | 3 |
| 30 | 7 | 5 | 2 |
| 50 | 11 | 35 | 8 |
| 45 | 10 | 25 | 6 |
| 40 | 9 | 0 | 1 |
| 15 | 4 | ||
| \(R_1=42\) | \(R_2=24\) | ||
As a check, \(R_1+R_2=42+24=66=\dfrac {N(N+1)}{2}\) with \(N=11\), as it must be.
Compute \(U\). With \(n_1=5\) and \(n_2=6\), \[U_1=R_1-\dfrac {n_1\left (n_1+1\right )}{2}=42-15=27,\hspace {0.8cm} U_2=R_2-\dfrac {n_2\left (n_2+1\right )}{2}=24-21=3,\] and \(U_1+U_2=30=n_1n_2\), the second check. The statistic is the smaller, \[U=\min \left (U_1,U_2\right )=\min (27,3)=3 .\]
Decision rule. The critical value is a lower bound: small \(U\) means the two groups barely overlap, which is evidence against \(H_0\). So \[\text {reject } H_0 \text { when } U\leq U_{\text {crit}} ,\] and for \(n_1=5\), \(n_2=6\) at \(\alpha =0.05\) two-sided the table gives \(U_{\text {crit}}=3\).
Conclusion. \(U=3\leq 3\), so we reject \(H_0\) at the \(5\%\) level. There is evidence that the two positions differ in how relaxing they are, the supine readings being the higher.
Note 3.18. The rule is \(U\leq U_{\text {crit}}\), and the direction is easy to get backwards. Read it off the extreme case: if every supine reading exceeded every sitting reading — the strongest possible evidence — then \(U\) would be \(0\). Large \(U\) means the groups are interleaved, which is what \(H_0\) predicts. A rule that rejected for large \(U\) would reject precisely when the data agreed with \(H_0\).
Note also that \(U=3\) sits exactly on the boundary. Enumerating all \(\binom {11}{5}=462\) ways of splitting the ranks gives the exact two-sided value \[P(U\leq 3)=0.0303 ,\] against \(P(U\leq 4)=0.0520\), which is why the table stops at \(3\). The result is significant, but only just, and it rests on eleven observations.
Summary of the relations
\begin {align*} U_1 &=R_1-\frac {n_1(n_1+1)}{2}, \hspace {1cm}\text {the } X\text {'s}\\ U_2 &=R_2-\frac {n_2(n_2+1)}{2}, \hspace {1cm}\text {the } Y\text {'s}\\ R_1+R_2 &=\frac {N(N+1)}{2}, \hspace {1.55cm} N=n_1+n_2\\ U_1+U_2 &=n_1n_2, \hspace {2.1cm}\text {so } U_1=n_1n_2-U_2 \end {align*}
The last two identities are the arithmetic checks used above: if either fails, the ranking is wrong.
Generalised
The general sample-problem \((K>2)\). The natural extension of the two sample problem is the \(K\) sample
problem where observations are taken under a variate of independent conditions.
Assume that we have \(K\) independent observations, one from each of the \(K\) continuous population \(F_1(X_1), F_2(X_2),\dots , F_n(X_n)\) where
the \(i^{th}\) random sample is of size \(n\), \(n_i=1,\dots ,K\) and there are a total of \(N=\sum \limits ^K_{i=1}n_i\) observations.
Note that we assume the independence extensions across samples to within samples. The extension of
the two sample hypothesis to the \(K\) sample problems is that all \(K\) sample are drawn from the same
population
\[H_0:F_1(x)=F_2(x)=\dots =F_K(x)\hspace {0.4cm}\text {for all}\hspace {0.3cm} x\]
then the general alternative
\[H_a:F_1(x)\neq F(x)\]
The location made for the \(K\) sample problem for the cdf are
\[F_1(x-\theta _1), F_2(x-\theta _2),\dots , F_k(x-\theta _k)\]
respectively where \(\theta \) denotes a location parameter for the \(i^{th}\) parameter usually interpreted as the median
or treatment effect.
The null hypothesis are now written as \(H_0:\theta _1=\theta _2=\theta _3=\dots =\theta _k\hspace {0.2cm}\) and the general alternative is \(H_1:\theta _i\neq \theta _j\hspace {0.4cm}\text {for some}\hspace {0.4cm}i\neq j\)
Then non-parametric techniques which have been developed for this \(k\) sample problem requires no
assumptions beyond continuous populations and there application to any situation and thus involve
only simple calculations which cover here there extension of those sample problems, the Kruskal-Wallis
Anova test including comparisons with a control of standardisation.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.