Jeff and others:

Paul Mielke and Ken Berry at Colorado State University developed very fast 
Fortran routines for doing Fisher exact tests (as well as some others like 
Chi-square and Zelterman's statistics).   Their book (Permutation Methods: 
A Distance Function Approach, 2nd ed.  2007. Springer) indicates that 
these algorithms were only efficient for <= 5 conditional loops so 2x2, 
3x2, 4x2, 5x2, 6x2, 3x3, and 2x2x2 were feasible back in the 1990's.   I'm 
not sure whether more recent computing capability permits larger tables 
now. 

Brian

Brian S. Cade

U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO  80526-8818

email:  brian_cade@usgs.gov
tel:  970 226-9326



"Dr. Jeff Miller" <jeffmiller@alphapoint05.net> 
Sent by: r-help-bounces@r-project.org
05/07/2008 09:56 AM

To
"'Greg Snow'" <Greg.Snow@imail.org>, "'David Winsemius'" 
<dwinsemius@comcast.net>, <r-help@stat.math.ethz.ch>
cc

Subject
Re: [R] categorical data analysis - fisher.exact for 2x2 and greater






Hi Simon and all,

I'm pretty sure that you are correct about this. I think it is a
misconception to say that the fisher exact test is only for a 2 by 2 
table.
It is presented that way in textbooks because, for a 2x2 table, it is easy
to perform.  For larger tables, it becomes complex quickly due to the rate
at which the permutations increase.

 When I use it for larger tables, it is hit or miss as to whether R will 
be
able to do it.  It's not uncommon to get an error implying that R is out 
of
memory. 

Check out Agresti's Categorical Data Analysis on the use of the fisher 
exact
for larger than 2x2 tables, and check out the R archives (and Google 
search)
for all the posts about the error message people run into sometimes.

On April 29th, Marc Schwartz replied to my question about this as follows:

Take a look at the 'workspace' argument in ?fisher.test and review the
second paragraph in Details:

"For 2 by 2 cases, p-values are obtained directly using the (central or
non-central) hypergeometric distribution. Otherwise, computations are 
based
on a C version of the FORTRAN subroutine FEXACT which implements the 
network
developed by Mehta and Patel (1986) and improved by Clarkson, Fan and Joe
(1993). The FORTRAN code can be obtained from
http://www.netlib.org/toms/643. Note this fails (with an error message) 
when
the entries of the table are too large. (It transposes the table if
necessary so it has no more rows than columns. One constraint is that the
product of the row marginals be less than 2^31 - 1.)"



Thank you,
Jeff



-----Original Message-----
From: r-help-bounces@r-project.org [mailto:r-help-bounces@r-project.org] 
On
Behalf Of Greg Snow
Sent: Wednesday, May 07, 2008 9:55 AM
To: David Winsemius; r-help@stat.math.ethz.ch
Subject: Re: [R] categorical data analysis

The last example in ?fisher.test is not a 2x2 table, in fact it uses 
levels
with a natural ordering similar to the original question.  Why would this
not be applicable to the situation?

________________________________________
From: r-help-bounces@r-project.org [r-help-bounces@r-project.org] On 
Behalf
Of David Winsemius [dwinsemius@comcast.net]
Sent: Wednesday, May 07, 2008 7:34 AM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] categorical data analysis

Simon Blomberg <s.blomberg1@uq.edu.au> wrote in
news:1210130089.9048.11.camel@sib-sblomber01d.sib.uq.edu.au:

> But see these posts:
>
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/119079.html
>
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/119080.html
>
> Simon.

Interesting reading, but the OP specifically said he was not dealing with
2x2 tables, so neither fisher.test nor the suggested alternatives would
be applicable to his data situation.

--
David Winsemius

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Internal Virus Database is out-of-date.


11:27 AM
 

Internal Virus Database is out-of-date.


11:27 AM

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


	[[alternative HTML version deleted]]

