You need to log-in or subscribe in order to use Student access.

Kruskal-Wallis Test

A Kruskal-Wallis test is used to determine whether there is a statistically significant difference between the medians of three or more independent groups. This test does not assume normality in the data and is much less sensitive to outliers than the one-way ANOVA.

When to use

  • Your data has been collected from three or more independent groups.
    NOTE: Each group does not need to be equal in size.
  • You want to test whether there is a statistically significant difference between these groups.
  • Your data cannot be assumed to be normally distributed.

NOTE: The Kruskal-Wallis test compares the medians of three or more independent groups while a one-way ANOVA compares the means of three or more independent groups.

Features

Before we can conduct a Kruskal-Wallis test, the following assumptions should be met:

  1. Ordinal or Continuous Variables – the data should be ordinal or continuous (e.g. a 5-point scale from “strongly disagree” to “strongly agree”) OR weight/height/concentration (see Types of Data for more information).
  2. Independence – the observations in each group need to be independent of each other. This means you have to have separate experimental groups, not the same group under different conditions.
  3. Distributions have similar shapes – the distributions in each group need to have a similar shape. You can check this by graphing a box-and-whisker plot of each group.

The hypotheses for this test are:

H0: The medians across the three groups are equal.

H1: At least one of the medians is different from the others.

NOTE: The Kruskal-Wallis test is much less sensitive to outliers than the one-way ANOVA.

An online calculator for this test can be found HERE.

PRACTICE

Worked Example

You want to know whether sunlight impacts the growth of a certain plant. You plant groups of seeds in four different locations that experience either high sunlight, medium sunlight, low sunlight or no sunlight. After one month you measure the height of each group of plants. It is known that the distribution of heights for this certain plant is not normally distributed and is prone to outliers.

Your data is as shown below (cm). 

High sunlight: 3.2, 14.5, 3.8, 4.1, 3.6, 3.1, 2.8, 5.1, 16.8, 3.0

Medium sunlight: 4.5, 6.3, 5.7, 6.0, 7.2, 5.8, 4.9, 5.3, 7.1, 4.9

Low sunlight: 6.4, 5.2, 3.6, 4.0, 5.0, 4.8, 3.8, 2.9, 12.4

No sunlight: 4.9, 3.7, 5.4, 4.8, 3.4, 6.1, 2.1, 4.8, 5.1

Using a Kruskal-Wallis test, determine whether there is a statistical difference between the median height of the four groups.

The hypotheses are:

H0: The medians across the 4 groups are equal.

H1: At least one of the medians is different from the others.

Using an online calculator we get a p-value = 0.08642. Since this is more than our critical probability or significance level (P/α = 5%) we cannot reject our H0 and must conclude that the medians of the four groups are not statistically different, that is, sunlight does not seem to have a significant impact on the growth of this type of plant.

Your Turn

A researcher wants to know whether different advertisements impact people’s views on fast fashion. She recruits 30 individuals and randomly splits them up into three groups to view either no advertising, Advertisement 1 or Advertisement 2. After viewing, each individual completes a short survey asking questions about their views on fast fashion. The survey uses a 5-point Likert scale from “strongly disagree” (1) to “strongly agree” (5). Questions are worded such that “strongly agree” always indicates a distaste for fast fashion.

Once all the surveys are completed each person’s total score is calculated, with a possible maximum of 25. You then have the following data: 

No advertisement: 23, 12, 16, 9, 14, 8, 14, 5, 18, 13

Advertisement 1: 13, 22, 21, 19, 24, 6, 17, 15, 20, 19

Advertisement 2: 23, 22, 12, 9, 27, 16, 24, 5, 12, 9

We will use a Kruskal-Wallis Test to check whether there are significant differences between the three groups.

The null and alternative hypotheses for our test will be which of the following?

The Kruskal-Wallis test compares the medians of three or more independent groups while a one-way ANOVA compares the means of three or more independent groups.

Enter the data into the online calculator HERE

In the online calculator "Sample 1" will correspond to which group in our data?

It actually doesn't matter which set of data goes into each "sample" box, but it makes most sense to put the data for "No advertisement" in the "Sample 1" box.

After running the test, which of the following statements are true? Tick all that apply.

The p-value (0.24908) is greater than the critical probability or significance level (5% or 0.05) so we should fail to reject the null hypothesis. 

Remember the rule of thumb: "If p is low, H0 must go" ... but since the p-value is greater than the significance level, in this case H0 must stay!

Total Score:

All materials on this website are for the exclusive use of teachers and students at subscribing schools for the period of their subscription. Any unauthorised copying or posting of materials on other websites is an infringement of our copyright and could result in your account being blocked and legal action being taken against you.