RE: Permutation test with small number of possible permutations
From: Leonid Gibiansky"
Subject: RE: [NMusers] Permutation test with small number of possible permutations
Date: Fri, November 26, 2004 8:47 pm
Samer,
Actually, there will be only 35 different permutations (permutation
1234 versus 5678 is the same as 5678 versus 1234). The code below gives them all:
N <- 0
i <-1
for(j in (i+1):6)
for(k in (j+1):7)
for(n in (k+1):8) {
if(i < j & j < k & k < n) {
N <- N+1
print(paste("Permutation", N,", class A subjects:", i,j,k,n))
}
}
P-value based on many (say, 1000) random permutations should be approximately the
same as a p-value based on all (35 in this case) permutations.
Leonid