Class 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
    • 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 ...
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 Detail

      • 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: