Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
10.4. Mann–Whitney–Wilcoxon Procedure 601

ofXiandYjare continuous; hence, we treat the observations as distinct. Thus
R(Yj)=#i{Xi<Yj}+#i{Yi≤Yj}. This leads to

W=

∑n^2

j=1

R(Yj)=

∑n^2

j=1

#i{Xi<Yj}+

∑n^2

j=1

#i{Yi≤Yj}

=#i,j{Yj>Xi}+

n 2 (n 2 +1)
2

. (10.4.12)


LetU=#i,j{Yj>Xi};thenwehaveW=U+n 2 (n 2 +1)/2. Hence an equivalent
test for the hypotheses (10.4.4) is to rejectH 0 ifU≥c 2. It follows immediately
from Theorem 10.4.1 that, under H 0 ,U is distribution free with meann 1 n 2 / 2
and variance (10.4.10) and that it has an asymptotic normal distribution. The
symmetry of the null distribution of eitherUorW can now be easily obtained.
UnderH 0 ,bothXiandYjhave the same distribution, so the distributions ofU
andU′=#i,j{Xi>Yj}must be the same. Furthermore,U+U′=n 1 n 2 .This
leads to


PH 0

(
U−

n 1 n 2
2

=u

)
= PH 0

(
n 1 n 2 −U′−

n 1 n 2
2

=u

)

= PH 0

(
U′−

n 1 n 2
2

=−u

)

= PH 0

(
U−
n 1 n 2
2

=−u

)
,

which yields the desired symmetry result in Theorem 10.4.1.


Example 10.4.2(Water Wheel, Continued).For the R commands to compute the
Wilcoxon analysis, supposeyandxcontain the respective samples onY andX.
The R callwilcox.test(y,x)computes the Wilcoxon test. The form used is the
statisticU=#i,j{Yj >Xi}. For the data in Example 10.4.1, let the R vectors
grp1andgrp2contain the samples for group 1 and group 2, respectively. Then the
call and the results are:
wilcox.test(grp2,grp1); W = 61.5, p-value = 0.4053
Note that R uses the labelWforU.Asacheck,61.5 + 10(11)/2 = 116.5=



R(yj),
which agrees with the computation in Example 10.4.1. The Rp-value is exact in
the case that there are no ties and ifni<50,i=1,2. Otherwise it is based on the
asymptotic distribution. Notice that the asymptoticp-value differs a little from its
R computed value. The R functionpwilcox(u,n1,n2)computes the exact cdf of
U.

Note that ifG(x)=F(x−Δ), thenYj−Δ has the same distribution asXi.So
the process of interest here is

U(Δ) = #i,j{(Yj−Δ)>Xi}=#i,j{Yj−Xi>Δ)}. (10.4.13)

HenceU(Δ) is counting the number of differencesYj−Xithat exceed Δ. Let
D 1 <D 2 <···<Dn 1 n 2 denote then 1 n 2 ordered differences ofYj−Xi.Then
the graph ofU(Δ) is the same as that in Figure 10.2.2, except theDisareonthe

Free download pdf