Background image of landing

Unrivalled
Education
Solutions for your
Family

How to perform a Kruskal-Wallis test?

To conduct a Kruskal-Wallis test, follow these steps carefully. This non-parametric test assesses whether there are significant differences among three or more independent groups. It serves as an alternative to the one-way ANOVA, particularly when the data do not fulfill the assumptions of normality or equal variances.

Steps to Perform the Kruskal-Wallis Test

  1. Rank the Data: Start by ranking all data points from lowest to highest across all groups. Assign ranks such that the smallest value receives the rank of 11, the second smallest receives 22, and so on.

  2. Calculate the Sum of Ranks: For each group, compute the sum of the ranks assigned to the observations within that group. For instance, suppose you have four groups with the following number of observations:

    • Group 1: 1010 observations
    • Group 2: 88 observations
    • Group 3: 1212 observations
    • Group 4: 99 observations

    The sums of ranks for each group would be calculated as follows:

    • Group 1: 1+2+3+4+5+6+7+8+9+10=551 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
    • Group 2: 11+12+13+14+15+16+17+18=11611 + 12 + 13 + 14 + 15 + 16 + 17 + 18 = 116
    • Group 3: 19+20+21+22+23+24+25+26+27+28+29+30=27119 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 = 271
    • Group 4: 31+32+33+34+35+36+37+38+39=31531 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 = 315
  3. Calculate the Test Statistic: Use the following formula to compute the Kruskal-Wallis test statistic, denoted as HH:

    H=(12N(N+1)(RjN+12)2)3(N+1)H = \left( \frac{12}{N(N + 1)} \sum (R_j - \frac{N + 1}{2})^2 \right) - 3(N + 1)

    In this formula:

    • NN represents the total number of observations.
    • RjR_j denotes the sum of ranks for each group.

    The test statistic HH follows a chi-squared distribution, with degrees of freedom equal to the number of groups minus one.

  4. Compare with Critical Value: Finally, compare the calculated test statistic HH to the critical value from the chi-squared distribution table. If HH exceeds the critical value, you can reject the null hypothesis, indicating that there is a statistically significant difference among the groups.

By following these steps, you can effectively use the Kruskal-Wallis test to analyze your data when the assumptions for parametric tests are not met.

Answered by: Prof. Alan Smith
A-Level Physics Tutor
Medal Icon

100%

Globe Icon

Global

Crest Icon

97%

Professional Tutors

International Tuition

Independent School Entrance Success

All of our elite tutors are full-time professionals, with at least five years of tuition experience and over 5000 accrued teaching hours in their subject.

Based in Cambridge, with operations spanning the globe, we can provide our services to support your family anywhere.

Our families consistently gain offers from at least one of their target schools, including Eton, Harrow, Wellington and Wycombe Abbey.

Medal Icon

100%

Professional Tutors

All of our elite tutors are full-time professionals, with at least five years of tuition experience and over 5000 accrued teaching hours in their subject.

Globe Icon

Global

International Tuition

Based in Cambridge, with operations spanning the globe, we can provide our services to support your family anywhere.

Crest Icon

97%

Independent School Entrance Success

Our families consistently gain offers from at least one of their target schools, including Eton, Harrow, Wellington and Wycombe Abbey.

Book a free
30-minute consultation
session

At the Beyond Tutors we recognise that no two students are the same. 

That’s why we’ve transcended the traditional online tutoring model of cookie-cutter solutions to intricate educational problems. Instead, we devise a bespoke tutoring plan for each individual student, to support you on your path to academic success.

To help us understand your unique educational needs, we provide a free 30-minute consultation with one of our founding partners, so we can devise the tutoring plan that’s right for you.

To ensure we can best prepare for this consultation, we ask you to fill out the short form below.

Hire a Tutor

All the form fields are optional, but we ask you to provide as much information as possible so that we are in a better position to quickly meet your tutoring requirements.

Still have questions?
Let's get in touch