We consider the exact likelihood ratio test of independence conditioned on row and column margins in an r × c contingency table with multinomial sampling. We develop an update algorithm to compute the exact P-value of the test and show it is better than the network algorithm in terms of computing speed. In the algorithm the P-value is reduced to a sum of probabilities for 2 × 2 contingency tables, which we compute using the hypergeometric distribution. The same algorithm can also be used for testing homogeneity of independent multinomial populations.
All Science Journal Classification (ASJC) codes
- Statistics and Probability
- Modelling and Simulation
- Statistics, Probability and Uncertainty
- Applied Mathematics