checkArray(counts); int nRows = counts.length; int nCols = counts[0].length;
checkArray(counts); int nRows = counts.length; int nCols = counts[0].length;
checkArray(counts); int nRows = counts.length; int nCols = counts[0].length;
/** * @param counts array representation of 2-way table * @return p-value * @throws IllegalArgumentException if preconditions are not met * @throws MathException if an error occurs computing the p-value */ public double chiSquareTest(long[][] counts) throws IllegalArgumentException, MathException { checkArray(counts); double df = ((double) counts.length -1) * ((double) counts[0].length - 1); distribution.setDegreesOfFreedom(df); return 1 - distribution.cumulativeProbability(chiSquare(counts)); }
/** * @param counts array representation of 2-way table * @return p-value * @throws IllegalArgumentException if preconditions are not met * @throws MathException if an error occurs computing the p-value */ public double chiSquareTest(long[][] counts) throws IllegalArgumentException, MathException { checkArray(counts); double df = ((double) counts.length -1) * ((double) counts[0].length - 1); distribution.setDegreesOfFreedom(df); return 1 - distribution.cumulativeProbability(chiSquare(counts)); }
/** * @param counts array representation of 2-way table * @return p-value * @throws IllegalArgumentException if preconditions are not met * @throws MathException if an error occurs computing the p-value */ public double chiSquareTest(long[][] counts) throws IllegalArgumentException, MathException { checkArray(counts); double df = ((double) counts.length -1) * ((double) counts[0].length - 1); distribution.setDegreesOfFreedom(df); return 1 - distribution.cumulativeProbability(chiSquare(counts)); }