[R] Fishers exact test at < 2.2e-16

Robin Hankin rksh1 at cam.ac.uk
Thu Dec 17 15:07:44 CET 2009


The aylmer package has some functionality in this regard
which you may find useful.

In particular, you can use good() to get a feel for the
number of tableaux that are consistent with the
specified marginal totals:




 > good(dat2)
[1] 42285210
 > good(dat3)
[1] 2.756286e+12
 >


HTH

rksh


Søren Faurby wrote:
> In an effort to select the most appropriate number of clusters in a
> mixture analysis I am comparing the expected and actual membership of
> individuals in various clusters using the Fisher?s exact test. I aim
> for the model with the lowest possible p-value, but I frequently get
> p-values below 2.2e-16 and therefore does not get exact p-values with
> standard Fisher?s exact tests in R.
>
> Does anybody know if there is a version of Fisher?s exact test in
> any package which can handle lower probabilities, or have other 
> suggestions as to how I can compare the probabilities?
>
> I am for instance comparing the following two:
>
> dat2<-matrix(c(29,0,29,0,12,0,18,0,0,29,0,16,0,19), nrow=2)
> fisher.test(dat2, workspace=30000000)
>
> dat3<-matrix(c(29,0,0,29,0,0,12,0,0,17,0,1,0,29,0,0,15,1,0,0,19),
> nrow=3)
> fisher.test(dat3, workspace=30000000)
>
> Which both result in p-value < 2.2e-16
>
> Kind regards, Søren
>
> ______________________________________________
> R-help at 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.


-- 
Robin K. S. Hankin
Uncertainty Analyst
University of Cambridge
19 Silver Street
Cambridge CB3 9EP
01223-764877




More information about the R-help mailing list