Hi folks, Forgive me if this question is a trivial issue. I was doing a series of Fishers' exact test using the fisher.test function in stats package. Since the counts I have were quite large (c(64, 3070, 2868, 4961135)), R suggested me to use *other algorithms* for the test which can be specified through the 'control' argument of the fisher.test function as I understood. But where can I find other algorithms that I can use? I hoped I could find relevant information in the manual but could not. Can anybody help me out there? Many thanks in advance. Kihwang
Kihwang Lee wrote:> Hi folks, > > Forgive me if this question is a trivial issue. > > I was doing a series of Fishers' exact test using the fisher.test > function in stats package. > Since the counts I have were quite large (c(64, 3070, 2868, 4961135)), R > suggested me to use > *other algorithms* for the test which can be specified through the > 'control' argument of the > fisher.test function as I understood. But where can I find other > algorithms that I can use? > I hoped I could find relevant information in the manual but could not. > > Can anybody help me out there?What about a chisq.test? And honestly, I know the answer before calculating anything .... Uwe Ligges> Many thanks in advance. > > Kihwang > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Prof Brian Ripley
2005-Nov-10 10:17 UTC
[R] Low level algorithm conrol in Fisher's exact test
On Thu, 10 Nov 2005, Kihwang Lee wrote:> Hi folks, > > Forgive me if this question is a trivial issue. > > I was doing a series of Fishers' exact test using the fisher.test > function in stats package. > Since the counts I have were quite large (c(64, 3070, 2868, 4961135)), R > suggested me to use > *other algorithms* for the test which can be specified through the > 'control' argument of the > fisher.test function as I understood.Not that I can reproduce. You cannot change the algorithm that way.> But where can I find other algorithms that I can use? I hoped I could > find relevant information in the manual but could not. > > Can anybody help me out there?What *exactly* did you see? I get> fisher.test(matrix(c(64, 3070, 2868, 4961135), 2))FEXACT error 40. Out of workspace.> fisher.test(matrix(c(64, 3070, 2868, 4961135), 2), workspace=20e6)FEXACT error 501. The hash table key cannot be computed because the largest key is larger than the largest representable int. The algorithm cannot proceed. Reduce the workspace size or use another algorithm. Where does it say anything about using control= ? AFAIK R does not have a means of doing Fisher's test on such a table, and it really does not make much statistical sense to do so. With such numbers, the null hypothesis is almost always rejected (try the chisq test), even for negligible dependence. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley wrote: > > Where does it say anything about using control= ? fisher.test(x, y = NULL, workspace = 200000, hybrid = FALSE, control = list(), or = 1, alternative = "two.sided", conf.int = TRUE, conf.level = 0.95) ... control a list with named components for low level algorithm control. I could not make any sense out of this, but it seems to indicate that this argument either selects or modifies the algorithm used to compute the output. Jim