Skip to content

Simulating contingency table (Basic question, help please)

3 messages · bbbnc, Achim Zeileis, Rolf Turner

#
I'd like to carry out a Monte Carlo simulation test where given data is a
contingency table. I think this is something to do with using rmultinonom(),
but I'm not sure how to code this, to simulate contingency tables. Could
anyone please help with how to use R to simulate contingency tables like
this?
#
On Tue, 24 Feb 2009, bbbnc wrote:

            
If you want a two-way table with certain fixed margins, you can use 
r2dtable() which implements the Patefield algorithm. For testing 
(conditional) independence of two variables based on r2dtable(), you can 
use coindep_test() in package "vcd".
Z
#