R语言Fisher检验的workspace问题

问题描述:

stage<-matrix(c(9,14,2,0,4,1,6,12,8,5,13,2,7,15,7,4,13,4,1,18,5),3,7)
fisher.test(stage)

软件报错

Error in fisher.test(stage) : FEXACT error 7.
LDSTP is too small for this problem.
Try increasing the size of the workspace

解决方法:提升workspace

fisher.test(stage, workspace=2e8)
Fisher's Exact Test for Count Data

data: stage
p-value = 0.2323
alternative hypothesis: two.sided

参考资料

提供了2种解决方法:(1)设置workspace参数(2)蒙特卡洛模拟
主要应用场景:GO富集分析等利用fisher P值-log10来进行比较的情况

You can try increasing the workspace argument from its default value, but I don’t know if you’re going to be able to make it big enough (I gave up at workspace=2e8, which still fails; I ran out of memory at workspace=2e9.) You can also try simulated p-values, e.g. fisher.test(Finaltable,simulate.p.value=TRUE,B=1e7) (for example), but since the p-value is extremely small, you’re going to need a huge number of simulations (B) if you want to do more than bound the p-value, which will also be very slow. (For most purposes, knowing that p is <1e-7 is more than enough – but in some bioinformatics contexts people want to use p as an index of signal strength and/or impose massive multiple-corrections comparisons. I don’t really like these approaches, but they’re out there …)
http://stackoverflow.com/questions/17052639/fisher-test-error-ldstp-is-too-small

你可能感兴趣的:(统计学,R)