Geoscience Reference
In-Depth Information
We u s e
U
to calculate the measured
z
-value, corrected for tied values, by
typing
t = 0;
S = n1 + n2;
for i = 1 : nties
t(i) = (kties(i)^3 - kties(i)) / 12;
end
T = sum(t);
zcal = abs(U - n1*n2/2) / ...
sqrt( (n1*n2/(S*(S-1))) * ((S^3-S)/12 - T))
which yields
zcalc =
1.6473
h is is a two-tailed Mann-Whitney test, i.e., the alternative hypothesis is
that the medians are not equal, no matter which is larger. Computing the
two-tailed critical
zcrit
value using the function
norminv
for the standard
normal distribution (with a mean of zero and a standard deviation of one) by
entering 1-0.05/2 yields the upper (positive)
zcrit
value, which we compare
with the calculated
zcalc
value
zcrit = norminv(1-0.05/2,0,1)
which yields
zcrit =
1.9600
Since the absolute measured
zcalc
value is 1.6473, which is smaller than
the critical
zcrit
value of 1.9600, we cannot reject the null hypothesis. We
can therefore conclude that our samples come from the same population.
Alternatively, we can use the function
ranksum
to perform a Mann-Whitney
test on the same samples:
[p,h,stats] = ranksum(data1,data2)
which yields
P =
0.1071
H =
0
STATS =
ranksum: 83.5000