Package dev.nm.stat.test.variance
Class Bartlett
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.variance.Bartlett
-
public class Bartlett extends HypothesisTest
Bartlett's test is used to test ifksamples are from populations with equal variances, hence homoscedasticity. Some statistical tests, for example ANOVA, assume that variances are equal across groups or samples. A homoscedasticity test, such as the Bartlett test, can be used to verify that assumption. Bartlett's test is sensitive to departures from normality. That is, if the samples come from non-normal distributions, then Bartlett's test may simply be testing for non-normality. TheLeveneandBrownForsythetests are alternatives to the Bartlett test that are less sensitive to departures from normality. The R equivalent function isbartlett.test.
-
-
Constructor Summary
Constructors Constructor Description Bartlett(double[]... samples)Perform the Bartlett test to test for equal variances across the groups.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
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
-
-