Geoscience Reference
In-Depth Information
V1 = ismember(data,data1)
V2 = ismember(data,data2)
which yields
V1 =
Columns 1 through 8
1 1 1 0 0 0 0 1
Columns 9 through 16
1 0 0 0 1 1 1 0
V2 =
Columns 1 through 8
0 0 0 1 1 1 1 0
Columns 9 through 16
0 1 1 1 0 0 0 1
h en we create a linearly-spaced vector L ranging from 1 to length(data) .
L = 1 : length(data);
We then calculate the test static An of the Ansari-Bradley test by typing
An = sum(((n+1)/2 - abs(L - (n+1)/2)).* V1)
which yields
An =
31
According to Table 1 in Ansari and Bradley (1960), the critical value for n1 =8
and n2 =8 is 45 at a signii cance level of 5%. Alternatively, we can use the
function ansaribradley to perform the Ansari-Bradley test by typing
[h,p,stats] = ansaribradley(data1,data2)
which yields
h =
0
p =
0.3507
stats =
W: 31
Wstar: -1.0564
h eresult h=0 means that we cannot reject the null hypothesis without another
cause at a 5% signii cance level. h e p -value of 0.3507 or ~35% (which is
greater than the signii cance level) means that the chances of observing
Search WWH ::




Custom Search