Package dev.nm.stat.test.rank
Class KruskalWallis
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.rank.KruskalWallis
-
public class KruskalWallis extends HypothesisTest
The Kruskal-Wallis test is a non-parametric method for testing the equality of population medians among groups. It is identical to a one-way analysis of variance with the data replaced by their ranks. Since it is a non-parametric method, the Kruskal-Wallis test does not assume a normal population, unlike the analogous one-way analysis of variance. However, the test does assume an identically-shaped and scaled distribution for each group, except for any difference in medians. TODO: correction for ties The R equivalent function iskruskal.test
.
-
-
Constructor Summary
Constructors Constructor Description KruskalWallis(double[]... samples)
Construct a Kruskal-Wallis test for the equality of medians of groups.
-
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
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
-
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
-
-