The Kruskal-Wallis Test

What it’s for:

The Kruskal-Wallis Test is a non-parametric test used to compare two or more means. It can also be used on parametric (i.e. normally distributed) data, but will be slightly less powerful than an ANOVA in this circumstance (Zar 1996).

Assumptions/Cautions:

Approximation of the test statistic H with chi-square (see below) is suspect for small sample sizes (Zar 1996).
A correction factor should be applied when tied rankings occur, otherwise the test statistic will be slightly underestimated (Zar 1996).
How to use it:

First note the definitions in the table below.

Term
Definition
ni The number of measurements in a single treatment group.
N The total number of measurements in all treatment groups (sum of the n’s).
k The number of treatment groups.
Ri Sum of the ranks within each treatment group (see steps 2, 3).

1) The Kruskal-Wallis test uses the ranks of individual data points rather than their actual value. You therefore need to rank your data points. Each data point should be ranked relative to all other points (in all treatments). You do not rank data points within each treatment separately. If two or more measurements have the same value (i.e. you have a tie), assign each point a ranking equal to the mean of the ranks being used. For example, if the values for ranks 2 and 3 are equal, both measurements are assigned a rank of 2.5, and the next measurement would receive rank 4. If the values for 5,6, and 7 are tied, all three receive a rank of 6, and the next measurement would receive a rank of 8. It makes no difference whether you rank your measurements from lowest to highest or highest to lowest.

2) Sum the rankings within each treatment group (R i).

3) Calculate the test statistic H as shown in the box at right (Zar 1996). The formula looks complex, but is actually fairly straightforward once data have been ranked and R calculated for each treatment group. If you wish to apply the correction factor for tied ranks, look here for details on how to calculate it.

4) Use the test statistic and a table or computer program to estimate a p-value. The p-value associated with H can be approximated by using chi-square with k-1 degrees of freedom. (See caution above.)

5) Draw a conclusion based on the p-value. See also Types of Errror.

MS Excel Tips:

Tested versions of MS Excel do not include the Kruskal-Wallis test. Excel, or any other spreadsheet, can be used to assist in the calculation of R, but care should be taken in using spreadsheets to rank data points, as often they do not deal appropriately with ties.

RETURN