[R] exhaustive permutations

Nick Bond Nick.Bond at sci.monash.edu.au
Wed Jan 16 04:08:56 CET 2002


Hello R-help Readers

I'm currently in the process of trying to write a permutation test
procedure for looking at differences between groups with a multivariate
data set (something equivalent to ANOSIM - analaysis of similarities for
those familiar with this test).  As with other permutation tests, for
cases where there are large numbers of possible permutations, randomly
sampling from these is appropriate, and can be done simply using
sample(vector_x) to create each random permutation.  

However, where sample sizes are small, it is more appropriate (I think)
to exhaustively calculate all possible permutations.  This is equivalent
to determining all possible ways of assigning n samples to each of k
groups = (kn)!/[(n!)^k*k!].  As a relative beginner at programming, I
suspect that writing the code to determine (and list) these permutations
is far beyond me.  I am wondering, therefore, whether anyone out there
has done somehting similar, or knows of any suitable routine to
calculate these permutations that they would be willing to share with
me.
Thanks in advance.
Nick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dr Nick Bond				 
Department of Biological Sciences 	 
Monash University (Clayton Campus)
Victoria, Australia, 3800
Ph: +61 3 9905 5606	Fax: +61 3 9905 5613
Email:   Nick.Bond at sci.monash.edu.au
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list