pal.statistics
Class FisherExact

java.lang.Object
  extended by pal.statistics.FisherExact

public class FisherExact
extends java.lang.Object

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
FisherExact(int maxSize)
          constructor for FisherExact table
 
Method Summary
 double getCumlativeP(int a, int b, int c, int d)
          calculates the one tail P-value for the Fisher Exact test This
 double getP(int a, int b, int c, int d)
          calculates the P-value for this specific state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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