powered by
Return a random permutation of a contingency table n rows x 2 columns keeping the marginal totals
permcont(Table)
A matrix with the permuted values
a contingency table
The contingency table is split in a two colums table of 0/1 categories, sampled and re-organised with the function table()
tab<-cbind(n1=c(10,12,8,7,5),n2=c(4,5,8,10,12)) tab permcont(tab)
Run the code above in your browser using DataLab