Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.64.0902242054110.4947@paninaro.stat-math.wu-wien.ac.at>
Date: 2009-02-24T19:56:45Z
From: Achim Zeileis
Subject: Simulating contingency table (Basic question, help please)
In-Reply-To: <22184961.post@talk.nabble.com>

On Tue, 24 Feb 2009, bbbnc wrote:

> 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?

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

> -- 
> View this message in context: http://www.nabble.com/Simulating-contingency-table-%28Basic-question%2C-help-please%29-tp22184961p22184961.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>