Geoscience Reference
In-Depth Information
dties =
3 5 8 13
kties =
2 4 2 3
We see that we have four dif erent tied values (
nties=4
), with the actual values
stored in
dties
(these being the values
3
,
5
,
8
and
13
, which occur
2
,
4
,
2
and
3
times in the data set, respectively). We now use
ismember
to locate the values
in
data1
and
data2
in
data
. h e i rst output from
ismember
for the sample in
data1
is
Lia1
, which contains
1
indicating that the statement that the data in
data1
are found in
data
is true, and the
Lia1
output of
ismember
for the sample
in
data1
contains
0
whenever
data1
is not a row in
data
. h e second output
from
ismember
is the column array
locb1
, which contains the lowest index
in
data
for each row in
data1
that is also a row in
data
. We now collect the
corresponding ranks in
icf
and sum them up to
R1
and
R2
.
[Lia1,locb1] = ismember(data1,data);
r1 = icf(locb1);
R1 = sum(r1)
[Lia2,locb2] = ismember(data2,data);
r2 = icf(locb2);
R2 = sum(r2)
which yields
R1 =
83.5000
R2 =
52.5000
We then calculate the test static
U
of the Mann-Whitney test, which is the
smaller of
U1
and
U2
U1 = n1*n2 + n1*(n1+1)/2 - R1
U2 = n1*n2 + n2*(n2+1)/2 - R2
U = min([U1 U2])
which yields
U1 =
16.5000
U2 =
47.5000
U =
16.5000