Selon Yann Clough <[EMAIL PROTECTED]>: > Dear useRs > > I am looking for a way to randomise the values within a matrix: > the conditions are that the sums of the rows and the sums of the columns > should > remain the same as in the original matrix. > > Any help would be appreciated > Cheers > > Yann > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Hello, your question makes me think about what does the chisq.test function with simulate.p.value = T, maybe that could help to look what is done there. The help page of chisq.test points to that reference wich seems quite like what you are looking for : Patefield, W. M. (1981) Algorithm AS159. An efficient method of generating r x c tables with given row and column totals. Applied Statistics 30, 91�97. Romain. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
