Exploring in detail Kruskal Wallis Test which is an alternative to One way ANOVA

ANOVA attempts to analyse whether one independent variables explain the dependent variables. The independent variable is assumed to have an impact on the dependent variable. These independent variables are measured in interval or ordinal level. Also, these variables should consist of any number of groups but more than three at least. These groups of independent variables represents unique treatments. F statistics, resulting from ANOVA test measure or tells us about the significant difference between the at least two group means , while not identifying which two are not. Kruskal wallis test is widely used in all the business research studies.  

The kruskal wallis test is non- parametric alternative test to One Way ANOVA. It is often used when the level of measurement is ordinal. The process uses ranking technique in order to compare the medians of the ranks for all the groups with the individual group medians. 

The kruskal- wallis test is an extension of the Mann- Whitney test to situations where more than two populations are involved. We compare medians of the groups instead of means as in ANOVA. 

In order to begin the process of comparing medians i.e is Kruskal Wallis test we need to use the following assumptions:-

  • The samples to be examined are selected randomly. 

  • The distributions that are scaled are identically shaped.

  • The data should be measured in ordinal level.

If any of these assumptions are violated, then the scientific insights, forecasts yielded may be inefficient or biased/misleading.when data fails to meet the parametric requirement to perform the test then we use non- parametric kruskal wallis test.  

To understand kruskal wallis test let's take an example, 

Let's consider the platelet count of four different groups of patients who have been treated with different medicines suffering from dengue. The observations are recorded and taken for further analysis of the impact of different medicines.  

treatment 1

treatment 2

treatment 3

treatment 4

45000

25000

95000

21000

23000

89000

25000

45000

17000

71000

14000

15000

56000

65000

 

16000

14000

   

80000

10000

   

79000

     

32000

Now, let's define the hypothesis to test using kruskal wallis test:

  1. We define null hypothesis as medians of all the four populations are same

  2. We define alternate hypothesis as medians of all the populations are different 

Sample size of all the four treatment are as follows: 

Treatment 1 - n1 = 6

Treatment 2 - n2 = 4

Treatment 3 - n3 = 3

Treatment 3 - n4 = 7

Total N = n1 + n2 + n3 +n4 = 5=6+4+3+7 = 20

Now , assign the ranks to all the observations

RANK1

RANK 2

RANK 3

RANK 4

10.5

8.5

17

6

7

16

8.5

10.5

5

13

2.5

3

11

12

 

4

2.5

   

15

1

   

14

     

9

sum of ranks =n(n+1)/2.

sum of ranks = 153

n(n+1)/2 = (17*18)/2 = 153

Now using krushal h statistic formula , we can compare the medians of all the four treatments and measure the hypothesis

To determine the critical value from the tables and calculated test statistics we could either accept the null hypothesis or reject alternative 

The critical value using the table is 5.565 and the calculated is 6.556. As the critical value is less than the calculated value therefore we could probably reject our defined null hypothesis and state that there is no significance that the medians of all four populations are the same. In order to check the critical values in table we can use chi square test where the population is more than three groups. We can perform the same test on different statistical softwares like SPSS, R , EXCEL etc.

Leave a Reply

Ads Responsive