Worked example III
Our third example is from a study we have looked at previously  a multiple group study comparing behaviour of game mammals inside a protected area with that of animals outside a protected area. The proportion of animals fleeing on approach of a vehicle is compared between the two areas.
Location  Behaviour 
Totals  Propn affected 
Flee  Not flee 
Inside park  6 (a)  2 (b) 
8  23.1 
Outside park  20 (c)  0 (d) 
20  0 
Totals  26  2 
28  
The smallest expected frequency is very low at only 0.57. We will use the continuity correction with the simpler computational formula but anticipate an inaccurate test because the assumptions of chi square will not be met.
Using
X^{2} = 
28 × (6×0 − 20×2 − 14)^{2} 
= 
2.275 

8 × 26 × 2 × 20 
This has a Pvalue of 0.1315 which is not even close to significance.
However, this result is unsafe as some of the expected frequencies are so low. If we use the Monte Carlo simulation method for Pearson's chi square statistic in R, we obtain markedly smaller Pvalues (usually around 0.07), close to the conventional value for significance. If we use Fisher's exact test (not shown here) we get a similar Pvalue (0.074) to the Monte Carlo simulation.
However, both the latter two methods assume that both rows and column totals are fixed. This is not the case and test results may be misleading. Hence we carry out an exact two sample independent binomial X^{2} test with Monte Carlo simulation using the R code given above.
Using
This gives a midPvalue of around 0.017, and a conventional Pvalue of 0.030 both of which are significant at the 0.05 level of significance. In this case using the exact test has shifted the result of the test from 'non significant' to 'significant'  but with other data sets it may shift in the other direction. The important thing is that one is using the correct test based on the design of the study  rather than an inadequate approximation. Note also:
 The conventional Pvalue is still rather close to 0.05  the only sensible conclusion is that larger samples are required.
 It is assumed that observations are independent (in the study reported this was unclear)
 We can only make inferences about the two areas  not about the treatment factor (that is 'protected' versus 'not protected') since we only have one replicate (= area) of each level.