# Kruskal Wallis Test

• Last Updated : 26 Nov, 2020

Kruskal Wallis Test: It is a nonparametric test. It is sometimes referred to as One-Way ANOVA on ranks. It is a nonparametric alternative to One-Way ANOVA. It is an extension of the Man-Whitney Test to situations where more than two levels/populations are involved. This test falls under the family of Rank Sum tests. It depends on the ranks of the sample observations.

Non-Parametric Test:  It is a test which does not follow normal distribution.

Elements of a Kruskal Wallis Test

• One independent variable with two or more levels. This independent variable is Categorical.
• One dependent variable which can be in Ordinal, Interval or Ratio level of measurement.

Assumptions of Kruskal Wallis Test

• Independence of Observations – Each observation can belong to only one level.
• No assumption of normality.
• Additional Assumption – The distributions of the dependent variable for all levels of the independent variable must have similar shapes. We can male use of Histograms or Boxplots to determine if the distributions have similar shapes. If this assumption is met it allows you to interpret the results of the Kruskal Wallis Test in terms of medians and not just mean ranks.

Null Hypothesis of Kruskal Wallis Test

The Kruskal Wallis Test has one Null Hypothesis i.e. – The distributions are Equal.

H Statistics of Kruskal Wallis Test ni = number of items in sample i
Ri = sum of ranks of all items in sample i
K = total number of samples
n = n1 + n2 + ...... +nK ; Total number of observations in all samples.



Steps to perform Kruskal Wallis Test

Let us take an example to understand how to perform this test.

Example:- The score of a sample of 20 students in their university examination are arranged according to the method used in their training : 1) Video Lectures 2) Books and Articles 3) Class Room Training. Evaluate the Effectiveness of these training methods at 0.10 level of significance.

Step 1: Identify Independent and Dependent variables

Here,
Independent variable – method of training. It has three levels.
Dependent variable – examination scores.

Step 2: State the Hypothesis

H0 = The mean examination scores of students trained by each of the three methods are equal. u1=u2=u3.

H1 = At least one of the mean examination scores is not equal.

Step 3: Sort the data for all groups in ascending order and allot them ranks. If more than one entry has the same score then take the average of the ranks and allot the same rank to each of those entries.

In this the score 80 had three ranks 10, 11 and 12. So we took the average of these ranks which was 11.

Step 4: Arrange back according to the levels an calculate the sum of ranks for each level.

Step 5: Calculate H Statistics H = 0.0938

Step 6: Find the critical chi-square value

• The chi-square distribution can be used when all the sample sizes are at least 5.

Degree of freedom = K-1 => 3-1=2
Alpha = 0.10

Use this chi-square table to find the value.

X2 = 4.605

Step 7: Compare H value and Critical Chi- Square value

• If H calc < X2 ; Accept the Null Hypothesis
• If H calc > X2 ; Reject the Null Hypothesis

Here, 0.0938 < 4.605.

Since, Hcalc < X2 . We accept the Null Hypothesis. We can say that there is no difference in the result obtained by using the three training methods.