|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.snver.pileup.util.math.FisherExact
public class FisherExact
This does a Fisher Exact test. The Fisher's Exact test procedure calculates an exact probability value for the relationship between two dichotomous variables, as found in a two by two crosstable. The program calculates the difference between the data observed and the data expected, considering the given marginal and the assumptions of the model of independence. It works in exactly the same way as the Chi-square test for independence; however, the Chi-square gives only an estimate of the true probability value, an estimate which might not be very accurate if the marginal is very uneven or if there is a small value (less than five) in one of the cells.
It uses an array of factorials initialized at the beginning to provide speed. There could be better ways to do this.
Constructor Summary | |
---|---|
FisherExact(int maxSize)
constructor for FisherExact table |
|
FisherExact(int maxSize,
boolean useLookup)
|
Method Summary | |
---|---|
double |
getCumlativeP(int a,
int b,
int c,
int d)
Calculates the one-tail P-value for the Fisher Exact test. |
double |
getLeftTailedP(int a,
int b,
int c,
int d)
Calculates the left-tail P-value for the Fisher Exact test. |
double |
getP(int a,
int b,
int c,
int d)
calculates the P-value for this specific state |
double |
getRightTailedP(int a,
int b,
int c,
int d)
Calculates the right-tail P-value for the Fisher Exact test. |
double |
getRightTailedPQuick(int a,
int b,
int c,
int d,
double maxP)
Calculates the right-tail P-value for the Fisher Exact test. |
double |
getTwoTailedP(int a,
int b,
int c,
int d)
Calculates the two-tailed P-value for the Fisher Exact test. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FisherExact(int maxSize)
maxSize
- is the maximum sum that will be encountered by the table (a+b+c+d)public FisherExact(int maxSize, boolean useLookup)
Method Detail |
---|
public final double getP(int a, int b, int c, int d)
a
- a, b, c, d are the four cells in a 2x2 matrixb
- c
- d
-
public final double getCumlativeP(int a, int b, int c, int d)
a
- a, b, c, d are the four cells in a 2x2 matrixb
- c
- d
-
public final double getRightTailedP(int a, int b, int c, int d)
a
- a, b, c, d are the four cells in a 2x2 matrixb
- c
- d
-
public final double getRightTailedPQuick(int a, int b, int c, int d, double maxP)
a
- a, b, c, d are the four cells in a 2x2 matrixb
- c
- d
-
public final double getLeftTailedP(int a, int b, int c, int d)
a
- a, b, c, d are the four cells in a 2x2 matrixb
- c
- d
-
public final double getTwoTailedP(int a, int b, int c, int d)
a
- a, b, c, d are the four cells in a 2x2 matrixb
- c
- d
-
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |