I ranked a list of chemicals by two distinct variables (one is a "Standard"
and the other a surrogate), and made an initial attempt to compare the two
sets of ranks by computing the sum of absolute differences between them.
Next, I generated random permutations of the "standard" ranks and computed
the sum of absolute differences between them. The random permutation of
ranks was performed with the code below:
dif <- vector("numeric",10000)
rstand <- rank(Standard)
for (i in 1:10000) {
smp <- sample(rstand, replace=FALSE)
dif[i] <- sum(abs(smp-rstand)
}
randif <- sort(dif)
The observed difference between ranks based on the standard and the
surrogate variable was less than the lowest value computed from the random
permutation of ranks, suggesting that the surrogate variable is adequate. Is
there a more elegant way to compare the two sets of ranks?
Thanks,
Manolo
|