/** * @param observed1 array of observed frequency counts of the first data set * @param observed2 array of observed frequency counts of the second data set * @param alpha significance level of the test * @return true iff null hypothesis can be rejected with confidence * 1 - alpha * @throws IllegalArgumentException if preconditions are not met * @throws MathException if an error occurs performing the test * @since 1.2 */ public boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) throws IllegalArgumentException, MathException { if ((alpha <= 0) || (alpha > 0.5)) { throw new IllegalArgumentException( "bad significance level: " + alpha); } return (chiSquareTestDataSetsComparison(observed1, observed2) < alpha); }
/** * @param observed1 array of observed frequency counts of the first data set * @param observed2 array of observed frequency counts of the second data set * @param alpha significance level of the test * @return true iff null hypothesis can be rejected with confidence * 1 - alpha * @throws IllegalArgumentException if preconditions are not met * @throws MathException if an error occurs performing the test * @since 1.2 */ public boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) throws IllegalArgumentException, MathException { if ((alpha <= 0) || (alpha > 0.5)) { throw MathRuntimeException.createIllegalArgumentException( LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL, alpha, 0.0, 0.5); } return chiSquareTestDataSetsComparison(observed1, observed2) < alpha; }
/** * @param observed1 array of observed frequency counts of the first data set * @param observed2 array of observed frequency counts of the second data set * @param alpha significance level of the test * @return true iff null hypothesis can be rejected with confidence * 1 - alpha * @throws IllegalArgumentException if preconditions are not met * @throws MathException if an error occurs performing the test * @since 1.2 */ public boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) throws IllegalArgumentException, MathException { if ((alpha <= 0) || (alpha > 0.5)) { throw MathRuntimeException.createIllegalArgumentException( "out of bounds significance level {0}, must be between {1} and {2}", alpha, 0.0, 0.5); } return chiSquareTestDataSetsComparison(observed1, observed2) < alpha; }