|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.utils.math.statistics.FishersExactTest
public class FishersExactTest
Calculate Fisher's exact test for a 2x2 frequency table.
| Constructor Summary | |
|---|---|
protected |
FishersExactTest()
Don't allow instantiation but do allow overrides. |
| Method Summary | |
|---|---|
static double[] |
fishersExactTest(int n11,
int n12,
int n21,
int n22)
Calculate Fisher's exact test from the four cell counts. |
protected static double |
hypergeometricProbability(int x,
int n1d,
int n2d,
int nd1,
int nd2)
Compute hypergeometric probability. |
protected static double |
logCombination(int n,
int k)
Compute log of number of combinations of n things taken k at a time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected FishersExactTest()
| Method Detail |
|---|
public static double[] fishersExactTest(int n11,
int n12,
int n21,
int n22)
n11 - Frequency for cell(1,1).n12 - Frequency for cell(1,2).n21 - Frequency for cell(2,1).n22 - Frequency for cell(2,2).
protected static double logCombination(int n,
int k)
n - Number of items.k - Group size.
log(combination(n,m)) = log(n!/m!(n-m)!) = log(n!) - log(m!) - log((n-m)!)
protected static double hypergeometricProbability(int x,
int n1d,
int n2d,
int nd1,
int nd2)
x - n1d - n2d - nd1 - nd2 -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||