问题:
> obs
[,1] [,2] [,3]
[1,] 83 29 35
[2,] 30 20 10
[3,] 23 12 1
[4,] 11 13 0
> fisher.test(obs)
Error in fisher.test(obs) :
FEXACT error 6. LDKEY=621 is too small for this problem,
(ii := key2[itp=394] = 488497, ldstp=18630)
Try increasing the size of the workspace and possibly 'mult'
原来是我的workspace 太小,增加workspace :
> fisher.test(obs,workspace = 2e7)
Fisher's Exact Test for Count Data
data: obs
p-value = 0.0002342
alternative hypothesis: two.sided
有的时候数据太多,可能花费很长时间,可以加参数simulate.p.values=TRUE
,可以节省时间。