Package pal.statistics
Class FisherExact
java.lang.Object
pal.statistics.FisherExact
This does a one tail fisher exact test.
It uses an array of factorials initialized at the beginning to provide speed.
There could be better ways to do this.
- Version:
- $Id: FisherExact.java,v 1
- Author:
- Ed Buckler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal double
getCumlativeP
(int a, int b, int c, int d) calculates the one tail P-value for the Fisher Exact test Thisfinal double
getP
(int a, int b, int c, int d) calculates the P-value for this specific state
-
Constructor Details
-
FisherExact
public FisherExact(int maxSize) constructor for FisherExact table- Parameters:
maxSize
- is the maximum sum that will be encountered by the table (a+b+c+d)
-
-
Method Details
-
getP
public final double getP(int a, int b, int c, int d) calculates the P-value for this specific state- Parameters:
a
- ,b,c,d are the four cells in a 2x2 matrix- Returns:
- the P-value
-
getCumlativeP
public final double getCumlativeP(int a, int b, int c, int d) calculates the one tail P-value for the Fisher Exact test This- Parameters:
a
- ,b,c,d are the four cells in a 2x2 matrix- Returns:
- the P-value
-