# Applying Monte Carlo simulation for Fisher test

This is related to the question posed here. If I have a 2x2 table where the cell counts are small (i.e. < 5), then I should use a Fisher's exact test. However, what motivates using simulate.p.value = TRUE (i.e. Monte Carlo simulation in this case)?

We resort to MC when we assume that the test conditions are not met, but what exactly are these conditions for the Fisher's exact test?

• Fisher's test assumes row and column totals are fixed. – Michael R. Chernick Apr 25 '17 at 18:30

Literally, Fisher's exact test requires you to count all of the possible tables with the marginal totals you have. You then compute the proportion that are as extreme or more extreme than your observed dataset. That proportion is the p-value. If your $N$ is moderately high, it becomes too onerous to form and count all the possible permutations. However, simulating will give you an empirical estimate of the proportion that is very good. So at a certain point, simulating is a more convenient option. That is, this isn't really about the assumptions.