Geoscience Reference
In-Depth Information
j = 1;
for i = 1 : length(ia)
f = find(ic==i);
if length(f) > 1
dties(j) = max(data(f));
nties = nties+1;
j = j + 1;
end
icf(f) = mean(L(f));
end
icf
which yields
icf =
Columns 1 through 4
1.5000 1.5000 3.0000 5.5000
Columns 5 through 8
5.5000 5.5000 5.5000 8.5000
Columns 9 through 12
8.5000 10.0000 11.0000 13.0000
Columns 13 through 16
13.0000 13.0000 15.0000 16.0000
As we can see, instead of ranks 1 and 2, the averaged ranks 1.5 and 1.5 are
used for the two duplicate values of 3 in the data set. Similarly, the averaged
rank 5.5 is used for the value of 5, which occurs four times in the data set,
instead of the ranks 4, 5, 6 and 7. h e averaged rank 8.5 is used for the value
of 8 instead of ranks 8 and 9 and the averaged rank 13 is used for the value of
13 instead of ranks 12, 13 and 14. Instead of using the above code MATLAB
provides the function tiedrank to compute ranks adjusted for tied values:
icf = tiedrank(data);
h e result obtained using tiedrank is icf , which is identical to that obtained
previously. h en we count the repetitions of each tied value by typing
for i = 1 : nties
kties(i) = sum(data == dties(i));
end
and display the values of all three variables by typing
nties
dties
kties
which yields
nties =
4
Search WWH ::




Custom Search