Example usage for org.apache.commons.math3.stat.inference TTest pairedTTest

List of usage examples for org.apache.commons.math3.stat.inference TTest pairedTTest

Introduction

In this page you can find the example usage for org.apache.commons.math3.stat.inference TTest pairedTTest.

Prototype

public boolean pairedTTest(final double[] sample1, final double[] sample2, final double alpha)
        throws NullArgumentException, NoDataException, DimensionMismatchException, NumberIsTooSmallException,
        OutOfRangeException, MaxCountExceededException 

Source Link

Document

Performs a paired t-test evaluating the null hypothesis that the mean of the paired differences between sample1 and sample2 is 0 in favor of the two-sided alternative that the mean paired difference is not equal to 0, with significance level alpha.

Usage

From source file:org.mines.processing.utils.ResultsTable.java

private boolean signifTest(double[] s1, double[] s2) {
    if (significanceTest == SigTest.TTEST) {
        TTest ttest = new TTest();
        return ttest.tTest(s1, s2, pValue);

    }/*  w w  w.  j  a  v a2 s  .c  o  m*/
    if (significanceTest == SigTest.PAIRED_TTEST) {
        TTest ttest = new TTest();
        return ttest.pairedTTest(s1, s2, pValue);

    }
    if (significanceTest == SigTest.MANN_WHITNEY_U) {
        MannWhitneyUTest mwuTest = new MannWhitneyUTest();
        return mwuTest.mannWhitneyUTest(s1, s2) < pValue;
    }
    if (significanceTest == SigTest.WILCOXON_SIGNED_RANK) {
        WilcoxonSignedRankTest wsrTest = new WilcoxonSignedRankTest();
        return wsrTest.wilcoxonSignedRankTest(s1, s2, true) < pValue;
    }
    return false;
}