Package org.snpeff.probablility
Class CochranArmitageTest
- java.lang.Object
-
- org.snpeff.probablility.CochranArmitageTest
-
public class CochranArmitageTest extends java.lang.Object
Calculate a Cochran-Armitage test Reference: http://en.wikipedia.org/wiki/Cochran-Armitage_test_for_trend The trend test is applied when the data take the form of a 2 x k contingency table. For example, if k = 3 we have B=1 B=2 B=3 A=1 N_11 N_12 N_13 R_1 A=2 N_21 N_22 N_23 R_2 The test statistic is: T = sum_i[ t_i (N_1i R_2 - N_2i R_1]- Author:
- pcingola
-
-
Field Summary
Fields Modifier and Type Field Description static double
EPSILON
A small numberstatic double[]
WEIGHT_DOMINANT
static double[]
WEIGHT_RECESSIVE
static double[]
WEIGHT_TREND
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CochranArmitageTest
get()
double
p(int[] N1, int[] N2, double[] weight)
double
test(int[] N1, int[] N2, double[] weight)
Calculate CochranArmitageTest using the following contingency table B=1 B=2 ...
-
-
-
Method Detail
-
get
public static CochranArmitageTest get()
-
p
public double p(int[] N1, int[] N2, double[] weight)
-
test
public double test(int[] N1, int[] N2, double[] weight)
Calculate CochranArmitageTest using the following contingency table B=1 B=2 ... B=N A=1 N_11 N_12 ... N_1N R_1 A=2 N_21 N_22 ... N_2N R_2- Parameters:
N1
- : Values for the first rowN2
- : Values for the second rowweight
- : Weight values- Returns:
-
-