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).
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.
Click Analyze > Nonparametric Tests > Legacy Dialogs > K Independent Samples... on the top menu as shown below:
Published with written permission from SPSS Inc., an IBM Company.
You will be presented with the following:
Published with written permission from SPSS Inc., an IBM Company.
Transfer the dependent variable that you are interested in analyzing into the Test Variable List: box. In our example, we need to transfer the variable Pain_Score into this box. The independent variable needs to be transfered into the Grouping Variable: box. There are two ways transfer your variables. You can either highlight drag-and-drop each variable into the respective boxes or you highlight the variable by using the cursor and clicking the button. Make sure that the Kruskal-Wallis H checkbox is ticked in the Test Type box.
You will end up with a screen similar to the one below:
Published with written permission from SPSS Inc., an IBM Company.
Press the button and type "1" into the Minimum box and "3" into the Maximum box. This is defining the range of the values for the categories of the independent variables. In this case, there are 3 groups/categories, called Drug A, Drug B and Drug C. If there had been 4 groups, but you did not want to include the first group in the analysis, you would have entered "2" and "4" into the Minimum and Maximum boxes, respectively (assuming you ordered the groups numerically).
Published with written permission from SPSS Inc., an IBM Company.
Click the button. Tick the Descriptive checkbox if you want descriptives and/or Quartiles if you want quartiles. You will be presented with the following if you select Descriptives:
Published with written permission from SPSS Inc., an IBM Company.
You will be presented with the following output (Descriptives excluded):
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.
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.