Fisher exact test with zeros

305 views
Skip to first unread message

ekbrown77

unread,
Nov 20, 2017, 2:50:54 PM11/20/17
to StatForLing with R
I have a 5 X 6 contingency table, with zeros in 14 of the 30 cells:

Given that the expected values of most of the cells is smaller than 5, I try to run a Fisher exact text (instead of a chi-square test), but get the following error:

How should I go about determining statistical significance with regards to independence of these two categorical variables?

Stefan Th. Gries

unread,
Nov 20, 2017, 3:58:11 PM11/20/17
to StatForLing with R
Works here:

fisher.test(qwe <- matrix(c(0,1,1,0,4,0,1,0,0,5,0,57,28,1,50,0,3,0,0,2,0,1,0,0,0,1,14,4,0,5), ncol=6))

Maybe the problem is that your input is a data frame?

Cheers,
STG
--
Stefan Th. Gries
----------------------------------
Univ. of California, Santa Barbara
http://tinyurl.com/stgries
----------------------------------

ekbrown77

unread,
Nov 20, 2017, 4:55:34 PM11/20/17
to StatForLing with R
Well, that's embarrassing. Yeah, that was the problem. Thanks.

I just discovered data.matrix(), which converts from type data.frame to matrix.
Reply all
Reply to author
Forward
0 new messages