Laerd Statistics LoginCookies & Privacy

Kruskal-Wallis H Test using SPSS


The Kruskal-Wallis test is the nonparametric test equivalent to the one-way ANOVA, and an extension of the Mann-Whitney U test to allow the comparison of more than two independent groups. It is used when we wish to compare three or more sets of scores that come from different groups. For example, you could use a Kruskal-Wallis test to understand whether exam performance differed based on test anxiety levels amongst students, dividing students into three independent groups (e.g., low, medium and high-stressed students). It is important to realise that the Kruskal-Wallis test is an omnibus test statistic and cannot tell you which specific groups were significantly different from each other; it only tells you that at least two groups were different. Since you may have three, four, five or more groups in your study design, determining which of these groups differ from each other is important. You can do this using a post-hoc test (N.B., we discuss post-hoc tests later in this guide).

This "quick start" guide shows you how to carry out a Kruskal-Wallis test using SPSS, as well as interpret and report the results from this test. However, before we introduce you to this procedure, you need to understand the different assumptions that your data must meet in order for a Kruskal-Wallis test to give you a valid result. We discuss these assumptions next.



A Kruskal-Wallis test is only appropriate where the following two assumptions are met:

As the Kruskal-Wallis test does not assume normality in the data and is much less sensitive to outliers, it can be used when these assumption have been violated and the use of the one-way ANOVA is inappropriate. In addition, if your data is ordinal, you cannot use a one-way ANOVA, but you can use this test.

In the section, Procedure, we illustrate the SPSS procedure to perform a Kruskal-Wallis test. First, we introduce the example that is used in this guide.



A medical researcher has heard anecdotal evidence that certain anti-depressive drugs can have the positive side-effect of lowering neurological pain in those individuals with chronic, neurological back pain, when administered in doses lower than those prescribed for depression. The medical researcher would like to investigate this anecdotal evidence with a study. The researcher identifies 3 well-known, anti-depressive drugs which might have this positive side-effect, and labels them Drug A, Drug B and Drug C. The researcher then recruits a group of 60 individuals with a similar level of back pain and randomly assigns them to one of three groups - Drug A, Drug B or Drug C treatment groups - and prescribes the relevant drug for a 4 week period. At the end of the 4 week period, the researcher asks the participants to rate their back pain on a scale of 1 to 10, with 10 indicating the greatest level of pain. The researcher wishes to compare the levels of pain experienced by the different groups at the end of the drug treatment period. The researcher runs a Kruskal-Wallis test to compare this ordinal, dependent measure (Pain Score) between the three drug treatments (i.e., the independent variable is the type of drug, with more than two groups).



Test Procedure in SPSS

The eight steps below show you how to analyse your data using Kruskal-Wallis H test in SPSS. At the end of these eight steps, we show you how to interpret the results from your Kruskal-Wallis H test. If you want to find out where the differences between your groups lie (i.e., the Kruskal-Wallis test only tells you whether there was a statistically significant difference between your groups), you will need to follow up your Kruskal-Wallis test with post-hoc tests. We also show you how to carry these out these post-hoc tests using SPSS in our enhanced Kruskal-Wallis test guide. You can learn more about our enhanced content here.

Join the 1,000s of students, academics and professionals who rely on Laerd Statistics. TAKE THE TOUR

SPSS Output for the Kruskal-Wallis H Test

You will be presented with the following output (Descriptives excluded):

Output from the Kruskal-Wallis H Test

Published with written permission from SPSS Inc., an IBM Company.

The Ranks table shows the mean rank of the Pain_Score for each drug group. The Test Statistics table presents the Chi-square value (Kruskal-Wallis H), the degrees of freedom and the significance level.


Reporting the Output of the Kruskal-Wallis H Test

In our example, we can report that there was a statistically significant difference between the different drug treatments (H(2) = 8.520, p = 0.014), with a mean rank of 35.33 for Drug A, 34.83 for Drug B and 21.35 for Drug C.

How to run a Kruskal-Wallis test using SPSS's new nonparametric procedure, along with post-hoc tests required to determine where differences lie between your groups is explained in our enhanced Kruskal-Wallis test guide. We also show you how to write up your results if you need to report these in a dissertation/thesis, assignment or research report. We do this using the Harvard and APA styles. You can learn more about our enhanced content here.

Join the 1,000s of students, academics and professionals who rely on Laerd Statistics. TAKE THE TOUR