Class OneWayAnova.Result

java.lang.Object
org.apache.commons.statistics.inference.OneWayAnova.Result
All Implemented Interfaces:
SignificanceResult
Enclosing class:
OneWayAnova

public static final class OneWayAnova.Result extends Object
Result for the one-way ANOVA.

This class is immutable.

Since:
1.1
  • Method Details

    • getMSBG

      public double getMSBG()
      Gets the mean square between groups.
      Returns:
      mean square between groups
    • getMSWG

      public double getMSWG()
      Gets the mean square within groups.
      Returns:
      mean square within groups
    • getVCBG

      public double getVCBG()
      Gets the variance component between groups.

      The value is a partitioning of the variance. It is the complement of getVCWG().

      Partitioning the variance applies only to a model II (random effects) one-way anova. This applies when the groups are random samples from a larger set of groups; partitioning the variance allows comparison of the variation between groups to the variation within groups.

      If the MSBG is less than the MSWG this returns 0. Otherwise this creates an estimate of the added variance component between groups as:

      \[ \text{between-group variance} = A = (\text{MS}_{\text{bg}} - \text{MS}_{\text{wg}}) / n_o \]

      where \( n_o \) is a number close to, but usually less than, the arithmetic mean of the sample size \(n_i\) of each of the \( a \) groups:

      \[ n_o = \frac{1}{a-1} \left( \sum_i{n_i} - \frac{\sum_i{n_i^2}}{\sum_i{n_i}} \right) \]

      The added variance component among groups \( A \) is expressed as a fraction of the total variance components \( A + B \) where \( B \) is the MSWG.

      Returns:
      variance component between groups (in [0, 1]).
    • getVCWG

      public double getVCWG()
      Gets the variance component within groups.

      The value is a partitioning of the variance. It is the complement of getVCBG(). See that method for details.

      Returns:
      variance component within groups (in [0, 1]).
    • getStatistic

      public double getStatistic()
      Description copied from interface: SignificanceResult
      Returns the test statistic.
      Specified by:
      getStatistic in interface SignificanceResult
      Returns:
      the statistic
    • getPValue

      public double getPValue()
      Description copied from interface: SignificanceResult
      Returns the test statistic p-value.

      The number returned is the smallest significance level at which one can reject the null hypothesis.

      Specified by:
      getPValue in interface SignificanceResult
      Returns:
      the p-value