Class OneWayAnova
java.lang.Object
org.apache.commons.statistics.inference.OneWayAnova
Implements one-way ANOVA (analysis of variance) statistics.
Tests for differences between two or more categories of univariate data
(for example, the body mass index of accountants, lawyers, doctors and
computer programmers). When two categories are given, this is equivalent to
the TTest.
This implementation computes the F statistic using the definitional formula:
\[ F = \frac{\text{between-group variability}}{\text{within-group variability}} \]
- Since:
- 1.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classResult for the one-way ANOVA. -
Method Summary
Modifier and TypeMethodDescriptiondoublestatistic(Collection<double[]> data) Computes the F statistic for an ANOVA test for a collection of category data, evaluating the null hypothesis that there is no difference among the means of the data categories.test(Collection<double[]> data) Performs an ANOVA test for a collection of category data, evaluating the null hypothesis that there is no difference among the means of the data categories.static OneWayAnovaReturn an instance using the default options.
-
Method Details
-
withDefaults
Return an instance using the default options.- Returns:
- default instance
-
statistic
Computes the F statistic for an ANOVA test for a collection of category data, evaluating the null hypothesis that there is no difference among the means of the data categories.Special cases:
- Parameters:
data- Category summary data.- Returns:
- F statistic
- Throws:
IllegalArgumentException- if the number of categories is less than two; a contained category does not have at least one value; or all categories have only one value (zero degrees of freedom within groups)
-
test
Performs an ANOVA test for a collection of category data, evaluating the null hypothesis that there is no difference among the means of the data categories.Special cases:
- Parameters:
data- Category summary data.- Returns:
- test result
- Throws:
IllegalArgumentException- if the number of categories is less than two; a contained category does not have at least one value; or all categories have only one value (zero degrees of freedom within groups)
-