Kruskal-Wallis Rank Sum Test for Independent-Samples

Statistics > Nonparametric Tests > Kruskal-Wallis


Performs Kruskal-Wallis H-Rank Sum Test for Independent-Samples.


This test is a generalization of the procedure used by the Mann-Whitney test and, like Mood's Median test, offers a nonparametric alternative to the one-way analysis of variance.

The null hypothesis of the test is that all k distribution functions are equal. The alternative hypothesis is that at least one of the populations tends to yield larger values than at least one of the other populations.



random samples from populations

independence within each sample

mutual independence among samples

measurement scale is at least ordinal

either k population distribution functions are identical, or else some of the populations tend to yield larger values than other populations


Dialog box items

Samples in one column:
Choose if the sample data are in a single column, differentiated by factor levels in a second column.

oResponse: Enter the columns containing the sample data.

oFactor: Enter the columns containing the sample factor.

Samples in different columns:
Choose if you have entered raw data in separate columns.

oSamples: Enter the column containing the samples.

The display of outputs of VisualStat.



The response (measurement) data must be stacked in one numeric column. You must also have a column that contains the factor levels or population identifiers. Factor levels can be numeric, or text. Data can also be in separate numeric columns.



Summary Statistics:
Check to compute summaries for each sample.

Adjusted for ties:
Check if the statistic is computed with average ranks used in the case of ties.

Confidence Level:
Enter the level of confidence desired. Enter any number between 0 and 100. Entering 90 will result in a 90% confidence interval. The default is 95%.



The data are from a comparison of four investment firms. The observations represent percentage of growth during a three month period for recommended funds.

1.Open the DataBook nonparam.vstz

2.Select the sheet growth

3.Choose the tab Statistics, the group Nonparametric Tests and the command Kruskal-Wallis

4.Select group Samples in different columns

5.In Samples, select A, B, C and D.

6.Click Options page and check Summary Statistics.

7.Click OK


Report window output


Kruskal-Wallis Rank Sum Test for Independent-Samples


Test of the equality of medians for two or more populations

alternative hypothesis: true Not all the population medians are equal.


Summary Statistics

  N    Mean  Median  Std Dev  Mean Rank  Rank Sum

A  4  4.1750  4.1000   0.2681    16.2500   65.0000

B  5  2.9800  2.8000   0.5075     8.3000   41.5000

C  5  2.1800  2.1000   0.3311     3.5000   17.5000

D  5  3.7600  3.7000   0.4543    13.2000   66.0000


Kruskal-Wallis Rank Sum Test (adjusted for ties)

NB                 19

Type of Test       Two-sided

Distribution       Chi-Square Approximation

Kruskal-Wallis H   13.6904

Degree of freedom  3

p-value            0.0034

alpha-level        0.05

Critical Value     7.8147

Conclusion         Accept the Alternative Hypothesis




Interpreting the results

The p-value for a = 0.05 with df = 3 is 0.0285. Since 0.05 > 0.0285, we reject the null hypothesis.




See Also:

One-Way Analysis of Variance | Mann-Whitney U-test for Independent-Samples | Report | Numeric Formats

Web Resource: NIST e-Handbook of Statistical Methods, 2006 | Probability and statistics EBook | Non-parametric tests (PDF)