Class OneWayAnova.Result
- All Implemented Interfaces:
SignificanceResult
- Enclosing class:
OneWayAnova
This class is immutable.
- Since:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Degrees of freedom in numerator (between groups).private final long
Degrees of freedom in denominator (within groups).private final double
Mean square between groups.private final double
Mean square within groups.private final double
nO value used to partition the variance. -
Constructor Summary
ConstructorsConstructorDescriptionResult
(int dfbg, long dfwg, double msbg, double mswg, double nO, double f, double p) -
Method Summary
Modifier and TypeMethodDescription(package private) int
getDFBG()
Gets the degrees of freedom in the numerator (between groups).(package private) long
getDFWG()
Gets the degrees of freedom in the denominator (within groups).double
getMSBG()
Gets the mean square between groups.double
getMSWG()
Gets the mean square within groups.double
getVCBG()
Gets the variance component between groups.double
getVCWG()
Gets the variance component within groups.Methods inherited from class org.apache.commons.statistics.inference.BaseSignificanceResult
getPValue, getStatistic
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.statistics.inference.SignificanceResult
reject
-
Field Details
-
dfbg
private final int dfbgDegrees of freedom in numerator (between groups). -
dfwg
private final long dfwgDegrees of freedom in denominator (within groups). -
msbg
private final double msbgMean square between groups. -
mswg
private final double mswgMean square within groups. -
nO
private final double nOnO value used to partition the variance.
-
-
Constructor Details
-
Result
Result(int dfbg, long dfwg, double msbg, double mswg, double nO, double f, double p) - Parameters:
dfbg
- Degrees of freedom in numerator (between groups).dfwg
- Degrees of freedom in denominator (within groups).msbg
- Mean square between groups.mswg
- Mean square within groups.nO
- Factor for partitioning the variance.f
- F statisticp
- P-value.
-
-
Method Details
-
getDFBG
int getDFBG()Gets the degrees of freedom in the numerator (between groups).- Returns:
- degrees of freedom between groups
-
getDFWG
long getDFWG()Gets the degrees of freedom in the denominator (within groups).- Returns:
- degrees of freedom within groups
-
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]).
-