[R] power 2x3 exact test

Thomas Lumley tlumley at u.washington.edu
Thu May 10 17:07:10 CEST 2007


On Thu, 10 May 2007, ted.harding at nessie.mcc.ac.uk wrote:
>
> Given that you expect some cells to be small, it should not
> be a severe task to draw up a list of (a1,b1) values which
> correspond to rejection of the null hypothesis (that both
> ORs equal 1), and then the simulation using different values
> of the two odds-ratios will give you the power for each such
> pair of odds-ratios.
>
> The main technical difficulty will be simulation of random
> tables, conditional on the marginals, with the probabilities
> as given above.
>
> I don't know of a good suggestion for this.

r2dtable().

If this is a power calculation, though, you probably want to fix only one 
margin, which is a much simpler problem, and if the table is not too large 
it would not be difficult to compute the exact probability for each 
element of the sample space and so get exact power.

 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-help mailing list