Class DAgostino
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.distribution.normality.DAgostino
-
public class DAgostino extends HypothesisTest
D'Agostino's K2 test is a goodness-of-fit measure of departure from normality. It tests whether or not a given sample comes from a normally distributed population. The test is based on transformations of the sample kurtosis and skewness, and has power only against the alternatives that the distribution is skewed and/or kurtic. The R equivalent function isdagoTest
infBasics
.
-
-
Constructor Summary
Constructors Constructor Description DAgostino(double[] sample)
Perform D'Agostino's test to test for the departure from normality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
pvalueZ1()
Get the p-value for Z1.double
pvalueZ2()
Get the p-value for Z2.double
statistics()
Get the test statistics.double
Z1()
Get Z1.double
Z2()
Get Z1.-
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
-
Z1
public double Z1()
Get Z1. NB: the paper is inconsistent about which skewness value to use; either the unbiased or the biased one. The derivation in Section 3 uses the biased estimator but the numerical example in Section 5 use the unbiased indicator.- Returns:
- Z1
-
Z2
public double Z2()
Get Z1. NB: the paper is inconsistent about which skewness value to use; either the unbiased or the biased one. The derivation in Section 3 uses the biased estimator but the numerical example in Section 5 use the unbiased indicator.- Returns:
- Z1
-
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
-
pvalueZ1
public double pvalueZ1()
Get the p-value for Z1.- Returns:
- the p-value for Z1
-
pvalueZ2
public double pvalueZ2()
Get the p-value for Z2.- Returns:
- the p-value for Z2
-
-