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 double
df1()
Get the first degree of freedom.double
df2()
Get the second degree of freedom.String
getAlternativeHypothesis()
Get the description of the alternative hypothesis.String
getNullHypothesis()
Get a description of the null hypothesis.double
pValue()
Get the p-value for the test statistics.double
statistics()
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:HypothesisTest
Get a description of the null hypothesis.- Specified by:
getNullHypothesis
in classHypothesisTest
- Returns:
- the null hypothesis description
- See Also:
- Wikipedia: Null hypothesis
-
getAlternativeHypothesis
public String getAlternativeHypothesis()
Description copied from class:HypothesisTest
Get the description of the alternative hypothesis.- Specified by:
getAlternativeHypothesis
in 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:HypothesisTest
Get the test statistics.- Specified by:
statistics
in classHypothesisTest
- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
pValue
public double pValue()
Description copied from class:HypothesisTest
Get the p-value for the test statistics.- Specified by:
pValue
in classHypothesisTest
- Returns:
- the p-value
- See Also:
- Wikipedia: P-value
-
-