[R] How can I create all possible contigency tables if the total count and number of rows and columns are fixed?

RLearner ywangpitt at gmail.com
Fri May 1 03:01:51 CEST 2009


Dear all

It sounds an easy task, but I got stuck with creating all possible
contigency tables if the total count is fixed. For example, if the total
count is 2, and number of cells in the table is 4 (nrow=2,ncol=2), there
should be 10 possible tables:
0 0     0 0    0 0     0 1     0 1      0 2      1 0     1 0     1 1     2 0
0 2     1 1    2 0     0 1     1 0      0 0      0 1     1 0     0 0     0 0

And, are there any suggestions on creating hash and inverse hash function
such that whenever we know the index integer, we can find the corresponding
table?

Please let me know if you have any thoughts. Thanks a lot!
-- 
View this message in context: http://www.nabble.com/How-can-I-create-all-possible-contigency-tables-if-the-total-count-and-number-of-rows-and-columns-are-fixed--tp23327067p23327067.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list