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

Fisher Exact Test for arbitrary contingency tables #14

Open
dcwuser opened this issue Mar 12, 2018 · 0 comments
Open

Fisher Exact Test for arbitrary contingency tables #14

dcwuser opened this issue Mar 12, 2018 · 0 comments

Comments

@dcwuser
Copy link
Owner

dcwuser commented Mar 12, 2018

The Kuiper Exact Test is generalizable to r X c contingency tables. Just iterate over all tables with the same marginal totals, compute the probability of each, and add up all the probabilities less than or equal to the one observed.

The number of degrees of freedom is r * c - r - c + 1. For example:

  • 2 X 2: 4 - 2 - 2 + 1 = 1
  • 3 X 2: 6 - 3 - 2 + 1 = 2
  • 3 X 3: 9 - 3 - 3 + 1 = 4
  • 4 X 2: 8 - 4 - 2 + 1 = 3
  • 4 X 3: 12 - 4 - 3 + 1 = 4
  • 4 X 4: 16 - 4 - 4 + 1 = 9

Only 2 X 2 has only a single degree of freedom corresponding to a hyper-geometrically distributed variable, which is why it is the one most commonly supported.

Others can be supported via enumeration of multiple degrees of freedom, or via Monte Carlo simulation. Here is a recent article about the latter: https://arxiv.org/pdf/1507.00070.pdf

@dcwuser dcwuser changed the title Kuiper Exact Test for arbitrary contingency tables Fisher Exact Test for arbitrary contingency tables Mar 16, 2018
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