I'd like to suggest an alternative to the FEXACT function for the 2x3 Fisher's exact test.
See fisher23() in https://github.com/chrchang/stats , fisher.c . No workspace is required any more, and contingency tables with entries in the millions can be evaluated in seconds. This can be quickly patched in by importing fisher.c into src/library/stats/src/, adding in a thin wrapper in fisher.c which takes a 2x3/3x2 R matrix and converts it to fisher23()'s format, and adding a branch in src/library/stats/R/fisher.test.R as the first line under
if(nr != 2 || nc != 2) {
to calculate 2x3/3x2 p-values via the fisher23() wrapper instead of simulation or FEXACT.
My source code also contains a fisher22() function, but it does not provide fisher.test's 2x2 odds ratio functionality so it can be ignored for now.
I'd like to suggest an alternative to the FEXACT function for the 2x3 Fisher's exact test.
See fisher23() in https://github.com/chrchang/stats , fisher.c . No workspace is required any more, and contingency tables with entries in the millions can be evaluated in seconds. This can be quickly patched in by importing fisher.c into src/library/stats/src/, adding in a thin wrapper in fisher.c which takes a 2x3/3x2 R matrix and converts it to fisher23()'s format, and adding a branch in src/library/stats/R/fisher.test.R as the first line under
to calculate 2x3/3x2 p-values via the fisher23() wrapper instead of simulation or FEXACT.
My source code also contains a fisher22() function, but it does not provide fisher.test's 2x2 odds ratio functionality so it can be ignored for now.
METADATA