public class ContigencyTable
Class for permuting contigency tables and determining the likelihood of the table. If determining of the probability of a 2x2 table use FisherExact as it is much faster.
public ContigencyTable(int maxSize)
constructor for Contigency table
maxSize - is the maximum sum that will be encountered by contigency tablepublic void setMatrix(kotlin.Array[] tcontig)
sets the data for the contigency table, must be set before other methods are called. If tcontig has a greater count than maxSize, then the contig is set to null
public double calcRapidContigencyChiSquare(int maxPermutations)
This calculates the probability in a rapid approach, using the Chi Square as the test statistic. It runs for maxPermutations permutations unless it find 10 values that beat the observed, and then it stops and calculates the p-value. This slighly biases the P-values but makes it much more rapid.
maxPermutations - Number of permutations used to calculate the probabilitypublic double calcContigencyChiSquare(int permutations)
This calculates the probability in the normal approach, using the Chi Square as the test statistic.
permutations - Number of permutations used to calculate the probabilitypublic double calcRapidMonteCarloExactTest(int maxPermutations)
This calculates the probability in the rapid permutational approach, using the method described by Weir, B. S. (1996) Genetic Data Analysis II (Sinauer, Sunderland, MA) It runs for 1000 permutations unless it find 10 values that beat the observed, and then it stops and calculates the p-value. This slighly biases the P-values but makes it much more rapid.
public double calcMonteCarloExactTest(int permutations)
This calculates the probability in the normal permutation approach, using the method described by Weir, B. S. (1996) Genetic Data Analysis II (Sinauer, Sunderland, MA).
permutations - Number of permutations used to the probability