Skip to content

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

Open

Description

@josef-pkt

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.

Activity

  1. josef-pkt commented on Feb 26, 2020

    @josef-pkt
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions