Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: simulate contingency tables for exact monte carlo tests #3557

Open
josef-pkt opened this issue Mar 15, 2017 · 1 comment
Open

ENH: simulate contingency tables for exact monte carlo tests #3557

josef-pkt opened this issue Mar 15, 2017 · 1 comment

Comments

@josef-pkt
Copy link
Member

related to #2931

For conditional tests the simulations are more difficult because we need to simulate contingency tables with given margins which is more difficult than simulating from an unconditional distribution like binomial, multinomial or poisson.

Kim, Donguk, and Alan Agresti. 1997. “Nearly Exact Tests of Conditional Independence and Marginal Homogeneity for Sparse Contingency Tables.” Computational Statistics & Data Analysis 24 (1): 89–104. doi:10.1016/S0167-9473(96)00038-2.

Patefield, W. M. 1981. “Algorithm AS 159: An Efficient Method of Generating Random R × C Tables with Given Row and Column Totals.” Journal of the Royal Statistical Society. Series C (Applied Statistics) 30 (1): 91–97. doi:10.2307/2346669.

IIRC I looked at articles from Berry Mielke in the past but don't remember and contingency tables with fixed margins looked to complicated given my limited interest, maybe this:
Long, Michael A., Kenneth J. Berry, and Paul W. Mielke. 2010. “Multiway Contingency Tables: Monte Carlo Resampling Probability Values for the Chi-Squared and Likelihood-Ratio Tests.” Psychological Reports 107 (2): 501–10. doi:10.2466/03.PR0.107.5.501-510.

@josef-pkt
Copy link
Member Author

just saw while browsing

R stats has Patefield algorithm for r x c random tables with fixed margins
https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/r2dtable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant