Package dev.nm.stat.test.mean
Class OneWayANOVA
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.mean.OneWayANOVA
-
public class OneWayANOVA extends HypothesisTest
The One-Way ANOVA test tests for the equality of the means of several groups. ANOVAs are helpful because they possess an advantage over a two-sample t-test. Doing multiple two-sample t-tests would result in an increased chance of committing a type I error. For this reason, ANOVAs are useful in comparing three or more means.The R equivalent function is
aov.
-
-
Constructor Summary
Constructors Constructor Description OneWayANOVA(double[]... samples)Perform the one-way ANOVA test to test for the equality of the means of several groups.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledf1()Get the first degree of freedom.doubledf2()Get the second degree of freedom.StringgetAlternativeHypothesis()Get the description of the alternative hypothesis.StringgetNullHypothesis()Get a description of the null hypothesis.doublepValue()Get the p-value for the test statistics.doublestatistics()Get the test statistics.-
Methods inherited from class dev.nm.stat.test.HypothesisTest
isNullRejected, nGroups, nObs, oneSidedPvalue
-
-
-
-
Method Detail
-
getNullHypothesis
public String getNullHypothesis()
Description copied from class:HypothesisTestGet a description of the null hypothesis.- Specified by:
getNullHypothesisin classHypothesisTest- Returns:
- the null hypothesis description
- See Also:
- Wikipedia: Null hypothesis
-
getAlternativeHypothesis
public String getAlternativeHypothesis()
Description copied from class:HypothesisTestGet the description of the alternative hypothesis.- Specified by:
getAlternativeHypothesisin classHypothesisTest- Returns:
- the alternative hypothesis description
- See Also:
- Wikipedia: Alternative hypothesis
-
df1
public double df1()
Get the first degree of freedom.- Returns:
- the first degree of freedom
-
df2
public double df2()
Get the second degree of freedom.- Returns:
- the second degree of freedom
-
statistics
public double statistics()
Description copied from class:HypothesisTestGet the test statistics.- Specified by:
statisticsin classHypothesisTest- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
pValue
public double pValue()
Description copied from class:HypothesisTestGet the p-value for the test statistics.- Specified by:
pValuein classHypothesisTest- Returns:
- the p-value
- See Also:
- Wikipedia: P-value
-
-