5
$\begingroup$

I have a question about conducting independence tests for categorical data with Fisher's Exact when I have zeros in my data. Since I observed no data for a category in both groups, is it right to include zero? Is this the best I can do with some empty categories?

Take the following R code for instance which represents my two groups of 7 categories:

v1 <- c(31, 9, 6, 0, 5, 0 27)
v2 <- c(13, 0, 1, 0, 1, 2, 7)
v <- cbind(v1, v2)
fisher.test(v)
p-value = 0.08061
$\endgroup$
5
$\begingroup$

A row (or column) of $0$'s in a Fisher test don't contribute anything to the calculation (it shouldn't change the probabilities of the various tables with the same margins as the sample table if you remove any such rows and/or columns).

As a result it should make no difference, but personally I'd remove them (it may help avoid a number of possible issues, including programs that might balk at a particular table size but not one a little smaller).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.