Fisher’s Exact Test
by Michael Boedigheimer
29 Dec 2008
(Updated 12 Jun 2012)
Hypergeometric cumulative distribution (left, right and two-tailed) including permutation testing.
|
Watch this File
|
| File Information |
| Description |
Matlab's implementation of Fisher's exact test only supports one-tailed tests. Other implementations on the file exchange are reportedly buggy and are far too slow for problems I'm working on. This implementation does 2.5e6 one or two-tailed tests per second and is ideally suited for genome-wide association studies or other large problems where 100s of samples and 10s to 100s of 1000s of tests are being performed.
It has been verified correct for samples sizes up to 100 and spot checked beyond that up to 1000s of samples.
|
| MATLAB release |
MATLAB 7.11 (R2010b)
|
| Other requirements |
Requires a large amount of memory for genome wide assocation studies (>=4Gb) |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 23 Dec 2011 |
Improved documentation and help. Improved performance for single tests. |
| 17 Jan 2012 |
Now can handle large number of observations in a single trial with minimal footprint.
If X = [7.9 7.911; 8 8]*1e6
fexact(x(1),sum(x(:)),x(1)+x(3),x(1)+x(2)) returns 0.0498 for a two-sided test; |
| 17 Jan 2012 |
Has been updated to work with a large sample size if performing a single test. |
| 19 Apr 2012 |
Fixed a reporting error that may affect results when a single test is done. The error that allowed p-values to be larger than 1 to be reported. p-values smaller than one should not be affected. |
| 19 Apr 2012 |
fixed bug in detecting error conditions |
| 12 Jun 2012 |
changed to allow permutation testing in 2012a. Added a graphic to help explain contingency table |
|
Contact us