Package org.snpeff.probablility
Class CochranArmitageTest
java.lang.Object
org.snpeff.probablility.CochranArmitageTest
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
FieldsModifier and TypeFieldDescriptionstatic double
A small numberstatic final double[]
static final double[]
static final double[]
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 ...
-
Field Details
-
WEIGHT_DOMINANT
public static final double[] WEIGHT_DOMINANT -
WEIGHT_RECESSIVE
public static final double[] WEIGHT_RECESSIVE -
WEIGHT_TREND
public static final double[] WEIGHT_TREND -
EPSILON
public static double EPSILONA small number
-
-
Method Details
-
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:
-