Professional Documents
Culture Documents
Login Cookies & Privacy
Kruskal-Wallis H Test using SPSS Statistics
Introduction
The Kruskal-Wallis H test (sometimes also called the "one-wa ANOVA on ranks") is a rank-ased nonparametric test that can e used to
determine if there are statisticall significant differences etween two or more groups of an independent variale on a continuous or ordinal
dependent variale. It is considered the nonparametric alternative to the one-wa ANOVA, and an extension of the Mann-Whitne U test to
allow the comparison of more than two independent groups.
For example, ou could use a Kruskal-Wallis H test to understand whether exam performance, measured on a continuous scale from 0-100,
differed ased on test anxiet levels (i.e., our dependent variale would e "exam performance" and our independent variale would e
"test anxiet level", which has three independent groups: students with "low", "medium" and "high" test anxiet levels). Alternatel, ou could
use the Kruskal-Wallis H test to understand whether attitudes towards pa discrimination, where attitudes are measured on an ordinal scale,
differed ased on jo position (i.e., our dependent variale would e "attitudes towards pa discrimination", measured on a 5-point scale
from "strongl agree" to "strongl disagree", and our independent variale would e "jo description", which has three independent groups:
"shop floor", "middle management" and "oardroom").
Note: If ou wish to take into account the ordinal nature of an independent variale and have an ordered alternative hpothesis, ou
could run a Jonckheere-Terpstra test instead of the Kruskal-Wallis H test.
It is important to realize that the Kruskal-Wallis H test is an omnius test statistic and cannot tell ou which specific groups of our
independent variale are statisticall significantl different from each other; it onl tells ou that at least two groups were different. ince ou
ma have three, four, five or more groups in our stud design, determining which of these groups differ from each other is important. You
can do this using a post hoc test (N.., we discuss post hoc tests later in this guide).
This "quick start" guide shows ou how to carr out a Kruskal-Wallis H test using P tatistics, as well as interpret and report the results
from this test. However, efore we introduce ou to this procedure, ou need to understand the different assumptions that our data must
meet in order for a Kruskal-Wallis H test to give ou a valid result. We discuss these assumptions next.
SPSS Statistics top ^
Assumptions
When ou choose to analse our data using a Kruskal-Wallis H test, part of the process involves checking to make sure that the data ou
want to analse can actuall e analsed using a Kruskal-Wallis H test. You need to do this ecause it is onl appropriate to use a Kruskal-
Wallis H test if our data "passes" four assumptions that are required for a Kruskal-Wallis H test to give ou a valid result. In practice,
checking for these four assumptions just adds a little it more time to our analsis, requiring ou to click a few more uttons in P
tatistics when performing our analsis, as well as think a little it more aout our data, ut it is not a difficult task.
efore we introduce ou to these four assumptions, do not e surprised if, when analsing our own data using P tatistics, one or more
of these assumptions is violated (i.e., is not met). This is not uncommon when working with real-world data rather than textook examples,
which often onl show ou how to carr out a Kruskal-Wallis H test when everthing goes well! However, don’t worr. ven when our data
fails certain assumptions, there is often a solution to overcome this. First, let’s take a look at these four assumptions:
Assumption #1: Your dependent variale should e measured at the ordinal or continuous level (i.e., interval or ratio). xamples of
ordinal variales include Likert scales (e.g., a 7-point scale from "strongl agree" through to "strongl disagree"), amongst other was
of ranking categories (e.g., a 3-pont scale explaining how much a customer liked a product, ranging from "Not ver much", to "It is OK",
to "Yes, a lot"). xamples of continuous variales include revision time (measured in hours), intelligence (measured using IQ score),
exam performance (measured from 0 to 100), weight (measured in kg), and so forth. You can learn more aout ordinal and continuous
variales in our article: Tpes of Variale.
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 1/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Assumption #2: Your independent variale should consist of two or more categorical, independent groups. Tpicall, a Kruskal-
Wallis H test is used when ou have three or more categorical, independent groups, ut it can e used for just two groups (i.e., a
Mann-Whitne U test is more commonl used for two groups). xample independent variales that meet this criterion include ethnicit
(e.g., three groups: Caucasian, African American and Hispanic), phsical activit level (e.g., four groups: sedentar, low, moderate and
high), profession (e.g., five groups: surgeon, doctor, nurse, dentist, therapist), and so forth.
Assumption #3: You should have independence of oservations, which means that there is no relationship etween the oservations
in each group or etween the groups themselves. For example, there must e different participants in each group with no participant
eing in more than one group. This is more of a stud design issue than something ou can test for, ut it is an important assumption
of the Kruskal-Wallis H test. If our stud fails this assumption, ou will need to use another statistical test instead of the Kruskal-Wallis
H test (e.g., a Friedman test). If ou are unsure whether our stud meets this assumption, ou can use our tatistical Test elector,
which is part of our enhanced content.
As the Kruskal-Wallis H test does not assume normalit in the data and is much less sensitive to outliers, it can e used when these
assumptions have een violated and the use of a one-wa ANOVA is inappropriate. In addition, if our data is ordinal, a one-wa ANOVA is
inappropriate, ut the Kruskal-Wallis H test is not. However, the Kruskal-Wallis H test does come with an additional data consideration,
Assumption #4, which is discussed elow:
Assumption #4: In order to know how to interpret the results from a Kruskal-Wallis H test, ou have to determine whether the
distriutions in each group (i.e., the distriution of scores for each group of the independent variale) have the same shape (which
also means the same variailit). To understand what this means, take a look at the diagram elow:
Copright 2014. Laerd tatistics
In the diagram on the left aove, the distriution of scores for the "Caucasian", "African American" and "Hispanic" groups have the
same shape. On the other hand, in the diagram on the right aove, the distriution of scores for each group are not identical (i.e., the
have different shapes and variailities).
If our distriutions have the same shape, ou can use P tatistics to carr out a Kruskal-Wallis H test to compare the medians of
our dependent variale (e.g., "engagement score") for the different groups of the independent variale ou are interested in (e.g., the
groups, Caucasian, African American and Hispanic, for the independent variale, "ethnicit"). However, if our distriutions have a
different shape, ou can onl use the Kruskal-Wallis H test to compare mean ranks. Having similar distriutions simpl allows ou to
use medians to represent a shift in location etween the groups (as illustrated in the diagram on the left aove). As such, it is ver
important to check this assumption or ou can end up interpreting our results incorrectl.
You can check assumption #4 using P tatistics. You should also check that our data meets assumptions #1, #2 and #3, which ou can
do without using P tatistics. Just rememer that if ou do not check assumption #4, ou will not know whether ou are ale to compare
medians or just mean ranks, meaning that ou might incorrectl interpret and report the result of the Kruskal-Wallis H test. This is wh we
dedicate a numer of sections of our enhanced Kruskal-Wallis H test guide to help ou get this right. You can learn more aout assumption
#4 and what ou will need to interpret in the Assumptions section of our enhanced Kruskal-Wallis H test guide, which ou can access
suscriing to the site here.
In the Test Procedure in P tatistics section of this "quick start" guide, we illustrate the P tatistics procedure to perform a Kruskal-
Wallis H test assuming that our distriutions are not the same shape and ou have to interpret mean ranks rather than medians. First, we
set out the example we use to explain the Kruskal-Wallis H test procedure in P tatistics.
SPSS Statistics top ^
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 2/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Example
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 ack pain, when administered in doses lower than those prescried for
depression. The medical researcher would like to investigate this anecdotal evidence with a stud. The researcher identifies 3 well-known,
anti-depressive drugs which might have this positive side effect, and laels them Drug A, Drug and Drug C. The researcher then recruits a
group of 60 individuals with a similar level of ack pain and randoml assigns them to one of three groups – Drug A, Drug or Drug C
treatment groups – and prescries the relevant drug for a 4 week period. At the end of the 4 week period, the researcher asks the
participants to rate their ack pain on a scale of 1 to 10, with 10 indicating the greatest level of pain. The researcher wants to compare the
levels of pain experienced the different groups at the end of the drug treatment period. The researcher runs a Kruskal-Wallis H test to
compare this ordinal, dependent measure ( Pain_core ) etween the three drug treatments (i.e., the independent variale,
Drug_Treatment_Group , is the tpe of drug with more than two groups).
TAKE THE TOUR
PLANS & PRICING
SPSS Statistics top ^
Test Procedure in SPSS Statistics
The eight steps elow show ou how to analse our data using the Kruskal-Wallis H test in P tatistics. At the end of these eight steps,
we show ou how to interpret the results from our Kruskal-Wallis H test. If ou want to find out where the differences etween our groups
lie (i.e., the Kruskal-Wallis H test onl tells ou whether there was a statisticall significant difference etween our groups), ou will need to
follow up our Kruskal-Wallis H test with a post hoc test. We also show ou how to carr these out a post hoc test using P tatistics in
our enhanced Kruskal-Wallis H test guide, which ou can access suscriing to the site here.
Note: P tatistics has two different procedures that can e used to run a Kruskal-Wallis H test: a legac procedure and a 'new'
procedure (N.., we just call it 'new' for ease). The procedure we set out elow is P tatistics' legac procedure. We show ou the
legac procedure ecause it can e used for more recent and older versions of P tatistics. However, it has the disadvantage of
not automaticall running post hoc tests. The new procedure can e used for P tatistics versions 18 and aove (i.e., up to the
current version 22), ut not for older versions (i.e., version 17 and older). However, we show ou how to carr out the new procedure in
our enhanced Kruskal-Wallis H test guide ecause it has the enefit of automaticall running post hoc tests, making the analsis
procedure much quicker and easier.
Click Analze > Nonparametric Tests > Legac Dialogs > K Independent amples... on the top menu as shown elow:
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 3/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Pulished with written permission from P tatistics, IM Corporation.
You will e presented with the "Tests for everal Independent amples" dialogue ox, as shown elow:
Pulished with written permission from P tatistics, IM Corporation.
into the appropriate oxes or highlighting (i.e., clicking on) each variale and using the appropriate utton. You will end up
with a screen similar to the one elow:
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 4/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Pulished with written permission from P tatistics, IM Corporation.
Click the utton. You will e presented with the "everal Independent amples: Define Range" dialogue ox, as
shown elow:
Pulished with written permission from
P tatistics, IM Corporation.
Pulished with written permission from
P tatistics, IM Corporation.
Note: If ou had four groups (e.g., Drug A through Drug D) and onl wanted to analse Drug through Drug D, ou could
enter "2" and "4" into the Minimum: and Maximum oxes, respectivel (assuming ou ordered the groups numericall).
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 5/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Click the utton and ou will e returned to the "Tests for everal Independent amples" dialogue ox, ut now with a
completed Grouping Variable: ox, as highlighted elow:
Pulished with written permission from P tatistics, IM Corporation.
Click the utton. You will e presented with the "everal Independent amples: Options" dialogue ox, as shown elow:
The KruskalWallis Define
Groups Dialog Box
Pulished with written permission from
P tatistics, IM Corporation.
Pulished with written permission from
P tatistics, IM Corporation.
Click the utton. You will e returned to the "Tests for everal Independent amples" dialogue ox.
Click the utton. This will generate the results.
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 6/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Join the 10,000s of students, academics and professionals
who rely on Laerd Statistics. TAKE THE TOUR PLANS & PRICING
SPSS Statistics top ^
SPSS Statistics Output for the Kruskal-Wallis H Test
You will e presented with the following output (assuming ou did not select the Descriptive checkox in the "everal Independent
amples: Options" dialogue ox):
Pulished with written permission from P tatistics, IM Corporation.
SPSS Statistics top ^
Reporting the Output of the Kruskal-Wallis H Test
Using the data from the two tales aove, ou could report the result as:
General
A KruskalWallis H test showed that there was a statistically significant difference in pain score between the different
drug treatments, χ2(2) = 8.520, p = 0.014, with a mean rank pain score of 35.33 for Drug A, 34.83 for Drug B and 21.35
for Drug C.
In our enhanced Kruskal-Wallis H test guide we show ou how to run a Kruskal-Wallis H test using P tatistics' new nonparametric
procedure which includes a post hoc test so that ou can determine where an differences lie etween our groups. For example, ou can
use the post hoc test to determine whether pain score is statisticall significantl different etween Drug A and Drug . We also show ou
how to write up our results if ou need to report these in a dissertation/thesis, assignment or research report. We do this using the Harvard
and APA stles. Rememer, the distriution of our data will determine whether ou can report differences with respect to medians. In our
enhanced guide, not onl do we explain how to test for this assumption, ut we also show ou how to interpret and report the results
whether ou pass this assumption or not. You can learn more aout our enhanced content here.
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 7/8
11/2/2016 KruskalWallis H Test in SPSS Statistics | Procedure, output and interpretation of the output using a relevant example.
Join the 10,000s of students, academics and professionals
who rely on Laerd Statistics. TAKE THE TOUR PLANS & PRICING
https://statistics.laerd.com/spsstutorials/kruskalwallishtestusingspssstatistics.php 8/8