public static double ttest(double[] arrA, double[] arrB) { if ((arrA.length == 1) && (arrB.length == 1)) { // return a NULL value for score (does not make sense) return Double.NaN; } try { if (arrA.length == 1) { return ttest.tTest(arrA[0], arrB); } else if (arrB.length == 1) { return ttest.tTest(arrB[0], arrA); } else { return ttest.tTest(arrA, arrB); } } catch (Exception e) { e.printStackTrace(); return Double.NaN; } }
/** * @see org.apache.commons.math.stat.inference.TTest#t(double, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double t(double mu, StatisticalSummary sampleStats) throws IllegalArgumentException { return tTest.t(mu, sampleStats); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(double[], double[]) */ public static double homoscedasticTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.homoscedasticTTest(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedTTest(double[], double[]) */ public static double pairedTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.pairedTTest(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticT(double[], double[]) */ public static double homoscedasticT(double[] sample1, double[] sample2) throws IllegalArgumentException { return tTest.homoscedasticT(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedT(double[], double[]) */ public static double pairedT(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.pairedT(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#t(double[], double[]) */ public static double t(double[] sample1, double[] sample2) throws IllegalArgumentException { return tTest.t(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(org.apache.commons.math.stat.descriptive.StatisticalSummary, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double homoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException { return tTest.homoscedasticTTest(sampleStats1, sampleStats2); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedTTest(double[], double[], double) */ public static boolean pairedTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException { return tTest.pairedTTest(sample1, sample2, alpha); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticT(org.apache.commons.math.stat.descriptive.StatisticalSummary, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double homoscedasticT(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException { return tTest.homoscedasticT(sampleStats1, sampleStats2); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedT(double[], double[]) */ public static double pairedT(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.pairedT(sample1, sample2); }
private static double tTest(double d, List<Double> group) { try { double[] arr = listToArray(group); return ttest.tTest(d, arr); } catch (Exception e) { e.printStackTrace(); return Double.NaN; } }
/** * @see org.apache.commons.math.stat.inference.TTest#t(double, double[]) */ public static double t(double mu, double[] observed) throws IllegalArgumentException { return tTest.t(mu, observed); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(double[], double[], double) */ public static boolean homoscedasticTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException { return tTest. homoscedasticTTest(sample1, sample2, alpha); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedTTest(double[], double[], double) */ public static boolean pairedTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException { return tTest.pairedTTest(sample1, sample2, alpha); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticT(double[], double[]) */ public static double homoscedasticT(double[] sample1, double[] sample2) throws IllegalArgumentException { return tTest.homoscedasticT(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedT(double[], double[]) */ public static double pairedT(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.pairedT(sample1, sample2); }
private static double tTest(List<Double> groupA, List<Double> groupB) { try { double[] arrA = listToArray(groupA); double[] arrB = listToArray(groupB); return ttest.tTest(arrA, arrB); } catch (Exception e) { e.printStackTrace(); return 0.0d; } }
/** * @see org.apache.commons.math.stat.inference.TTest#t(double, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double t(double mu, StatisticalSummary sampleStats) throws IllegalArgumentException { return tTest.t(mu, sampleStats); }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(org.apache.commons.math.stat.descriptive.StatisticalSummary, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double homoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException { return tTest.homoscedasticTTest(sampleStats1, sampleStats2); }