Bug 16654 - Cochran condition in fisher.test hybrid mode might be incorrect
Summary: Cochran condition in fisher.test hybrid mode might be incorrect
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Accuracy (show other bugs)
Version: R 3.2.2
Hardware: All All
: P5 major
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-01-04 04:29 UTC by Emmanuel Noutahi
Modified: 2016-01-04 04:29 UTC (History)
0 users

See Also:


Attachments
ALGO 643, FEXACT original fortran source code. (58.45 KB, text/x-fortran)
2016-01-04 04:29 UTC, Emmanuel Noutahi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Noutahi 2016-01-04 04:29:20 UTC
Created attachment 1981 [details]
ALGO 643, FEXACT original fortran source code.

In fisher.test source code, expect = 5, percent = 180 and emin = 1  is used in the call to Fexact subroutine :

else if(hybrid) {
     ## Cochran condition for asym.chisq. decision:
     PVAL <- .Call(C_Fexact, x, c(5, 180, 1), workspace, mult)
} else {
      ##  expect < 0 : exact
      PVAL <- .Call(C_Fexact, x, c(-1, 100, 0), workspace, mult)
}

The documentation of Fexact actually say to use PERCNT = 80.0 in order to obtain the 'Cochran' condition (see attached original FEXACT source code in fortran or the modified C version used by R : src/library/stats/src/fexact.c).

I'm not sure if this is an error or not and how it impact p-value in hybrid mode.