You are viewing documentation for the old version 2.30 of Analyse-it. If you are using version 3.00 or later we recommend you go to the Kruskal-Wallis ANOVA.

Kruskal Wallis

Kruskal-Wallis test is a non-parametric test for a difference in central location (median) between two or more independent samples.

The requirements of the test are:

  • Two or more independent samples measured on an ordinal or continuous scale.
  • Samples have similar shape distributions, although the distributions need not be normal.


Arranging the dataset

Data in existing Excel worksheets can be used and should be arranged in a List dataset layout or Table dataset layout. The dataset must contain a continuous scale variable and a nominal/ordinal scale variable containing two or more independent groups.

When entering new data we recommend using New Dataset to create a new 2 variables (1 categorical) dataset ready for data entry.

Using the test

To start the test:

  1. Excel 2007:
    Select any cell in the range containing the dataset to analyse, then click Compare Groups on the Analyse-it tab, then click Kruskal Wallis.
  2. Excel 97, 2000, 2002 & 2003:
    Select any cell in the range containing the dataset to analyse, then click Analyse on the Analyse-it toolbar, click Compare Groups then click Kruskal Wallis.

  3. If the dataset is arranged using the table layout:
    The Variable - Groups list shows the observed variable split by the groups. Tick the samples to compare.

    If the dataset is arranged using the list layout:
    Click Variable and select the dependent variable and click Factor and select the independent variable containing the groups to compare.

  4. Click OK to run the test.

The report shows the number of observations analysed, and, if applicable, how many missing values were excluded. Summary statistics for the ranks of each sample are also shown.

The Kruskal-Wallis statistic and hypothesis test are shown. The p-value is the probability of rejecting the null hypothesis, that the samples have the same median, when it is in fact true. A significant p-value implies that at least two samples have different medians. To determine which samples differ perform multiple comparisons.

METHOD The p-value is calculated using the chi-square approximation with correction for ties (see [2]). When the number of observations are ≤ 25 it is recommended to lookup an exact p-value (see [2]).

Comparing groups with multiple comparisons

Multiple comparisons allow pairs of groups to be compared to determine which are different. When comparing many groups the chance of committing a type I error increases. To reduce the risk multiple comparisons should only be made when the Kruskal-Wallis test is significant. The risk is further reduced with error protection methods:

  • Bonferroni

    METHOD See [1] and [2] for more information on how the multiple comparisons are calculated.

  • LSD

To calculate multiple comparisons:

  1. If the Kruskal-Wallis dialog box is not visible click Edit on the Analyse-it tab/toolbar.
  2. Click Contrasts then select All pairwise to compare each group against each other, or select Many against control to compare each group against a control.
  3. Click Error protection then select Bonferroni or LSD.
  4. If contrasting Many against a control click Control group then select the group to use as the control against which all other groups will be contrasted.
  5. Click OK.

The groups compared, the difference between mean ranks, and hypothesis test are shown. If the p-value is significant the group medians are different.

To disable multiple comparisons:

  1. If the Kruskal-Wallis dialog box is not visible click Edit on the Analyse-it tab/toolbar.
  2. Click Contrasts then select None.
  3. Click OK.

Further reading & references

  1. Handbook of Parametric and Nonparametric Statistical Procedures (3rd edition)
    David J. Sheskin, ISBN 1-58488-440-1 2003; 757.
  2. Practical Non-parametric Statistics (3rd edition)
    Conover W.J. ISBN 0-471-16068-7 1999; 288-297.

(click to enlarge)