s-news
[Top] [All Lists]

random permutation of ranks

To: <s-news@lists.biostat.wustl.edu>
Subject: random permutation of ranks
From: "Manoel Pacheco" <mpacheco@glec-oh.com>
Date: Fri, 16 Jul 2004 18:37:17 -0400
Organization: GLEC
Reply-to: "Manoel Pacheco" <mpacheco@glec-oh.com>
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



<Prev in Thread] Current Thread [Next in Thread>