Class OneWayANOVA

All Implemented Interfaces:
StatisticalTest

public class OneWayANOVA extends IntervalRatioStatisticalTest
The Single-Factor Between-Subjects Analysis of Variance determines if (at least) two out of K >= 2 populations have differing means.
  • Null Hypothesis: All populations have equal means.
  • Alternative Hypothesis: Not all populations have equal means.

Assumptions:

  1. Samples are randomly selected from their corresponding populations
  2. The distribution of the underlying populations are normal
  3. The variances of the underlying populations are identical

References:

  1. Sheskin, D.J. "Handbook of Parametric and Nonparametric Statistical Procedures, Third Edition." Chapman & Hall/CRC. 2004.
  • Constructor Details

    • OneWayANOVA

      public OneWayANOVA(int numberOfGroups)
      Constructs a one-way ANOVA statistical test with the specified number of groups.
      Parameters:
      numberOfGroups - the number of groups being tested
  • Method Details

    • add

      public void add(double value, int group)
      Description copied from class: IntervalRatioStatisticalTest
      Adds a new observation with the specified value and group.
      Overrides:
      add in class IntervalRatioStatisticalTest
      Parameters:
      value - the value of the new observation
      group - the group to which the new observation belongs
    • addAll

      public void addAll(double[] values, int group)
      Description copied from class: IntervalRatioStatisticalTest
      Adds several new observations to the specified group.
      Overrides:
      addAll in class IntervalRatioStatisticalTest
      Parameters:
      values - the values of the new observations
      group - the group to which the new observations belong
    • test

      public boolean test(double alpha)
      Returns true if the null hypothesis is rejected; false otherwise. The meaning of the null hypothesis and alternative hypothesis depends on the specific test.

      The prespecified level of confidence, alpha, can be used for either one-tailed or two-tailed (directional or non-directional) distributions, depending on the specific test. Some tests may only support specific values for alpha.

      Parameters:
      alpha - the prespecified level of confidence
      Returns:
      true if the null hypothesis is rejected; false otherwise
      See Also:
      • TestUtils.oneWayAnovaTest(java.util.Collection, double)