Kruskal-Wallis Test Calculator

The Kruskal-Wallis test calculator is designed to compare the medians of three or more independent treatments (groups).

Result:

How to Use the Kruskal-Wallis Test Calculator?

  1. Input the set of numbers (comma or space separated) for a minimum of two and a maximum of five treatments.
  2. Also, enter more than two data points in each group.
  3. Set the significance level.
  4. Now run the Kruskal-Wallis test by pressing the 'Calculate' button.
  5. As a result, the tool returns the H-statistic and p-value associated with the given data.
  6. In addition, it checks whether the test result is significant or not to determine the difference between the groups.

How to Calculate?

The following formula is used to compute the Kruskal-Wallis H-statistic:

H =  
12
N(N + 1)
Σ
Ri2
ni
 - B(N + 1)

Where,
N = Total number of data points,
Ri = Sum of ranks of the ith group,
ni = Number of data points (observations) in the ith group.

Let's understand the step-by-step calculation with an example.

Example:

Compute the H-statistic and P-value for the following groups:

  • Group 1: [10, 15, 23]
  • Group 2: [32, 12, 26]
  • Group 3: [5, 6, 14]

Solution:

Step 1: Rank the data:

First, assign ranks to all the values from all the groups.

Group Value Rank
Group 3 5 1
Group 3 6 2
Group 1 10 3
Group 2 12 4
Group 3 14 5
Group 1 15 6
Group 1 23 7
Group 2 26 8
Group 2 32 9

Step 2: Find the sum of ranks for each group:

R1 = 3 + 6 + 7 = 16.

R2 = 4 + 8 + 9 = 21.

R3 = 1 + 2 + 5 = 8.

N = 9 (Total number of observations).

Step 3: Substitute values into the formula:

H =  
12
N(N + 1)
Σ
Ri2
ni
 - B(N + 1)
=  
12
9(9 + 1)
(
162
3
+
212
3
+
82
3
)  - 3(9 + 1)
=  
12
90
(
256
3
+
441
3
+
64
3
)  - 30

H = 3.82222

Also, you can find the P-value using the P-value from Chi-Square Score Calculator by entering the Chi-Square Score (H) = 3.82222 and the Degrees of Freedom (DF) = k - 1 = 3 - 1 = 2. Where, k = number of groups.

As a result, we get:

P-value = 0.1479