Class CochranArmitageTest

java.lang.Object
org.snpeff.probablility.CochranArmitageTest

public class CochranArmitageTest extends 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 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 EPSILON
      A small number
  • Method Details

    • 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 row
      N2 - : Values for the second row
      weight - : Weight values
      Returns: