Class OneWayAnova.Result
- All Implemented Interfaces:
SignificanceResult
- Enclosing class:
OneWayAnova
This class is immutable.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetMSBG()Gets the mean square between groups.doublegetMSWG()Gets the mean square within groups.doubleReturns the test statistic p-value.doubleReturns the test statistic.doublegetVCBG()Gets the variance component between groups.doublegetVCWG()Gets the variance component within groups.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.statistics.inference.SignificanceResult
reject
-
Method Details
-
getMSBG
Gets the mean square between groups.- Returns:
- mean square between groups
-
getMSWG
Gets the mean square within groups.- Returns:
- mean square within groups
-
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
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:SignificanceResultReturns the test statistic.- Specified by:
getStatisticin interfaceSignificanceResult- Returns:
- the statistic
-
getPValue
public double getPValue()Description copied from interface:SignificanceResultReturns the test statistic p-value.The number returned is the smallest significance level at which one can reject the null hypothesis.
- Specified by:
getPValuein interfaceSignificanceResult- Returns:
- the p-value
-