In: Statistics and Probability
Group1: [4,5,3,4,5,5,2]
Group2:[3,4,5,2,3,1,1,2]
Group3:[1,1,1,2,1,3]
Perform a Kruskal-Wallis test, calculate test statistic, find p-value by chi-square approximation, and state you conclusion
Kruskal-Wallis test is a non parametric test based on ranks. Following is the data listed:
T1 | T2 | T3 |
4 | 3 | 1 |
5 | 4 | 1 |
3 | 5 | 1 |
4 | 2 | 2 |
5 | 3 | 1 |
5 | 1 | 3 |
2 | 1 | |
2 |
Null Hypothesis: The treatments are all the same.
Alternate Hypothesis: There is a difference among the treatment.
Next, mix up all the data from lowest to highest by retaining the treatment label.
Treatment | Sorted | Rank |
1 | T2 | 1 |
1 | T2 | 2 |
1 | T3 | 3 |
1 | T3 | 4 |
1 | T3 | 5 |
1 | T3 | 6 |
2 | T1 | 7 |
2 | T2 | 8 |
2 | T2 | 9 |
2 | T3 | 10 |
3 | T1 | 11 |
3 | T2 | 12 |
3 | T2 | 13 |
3 | T3 | 14 |
4 | T1 | 15 |
4 | T1 | 16 |
4 | T2 | 17 |
5 | T1 | 18 |
5 | T1 | 19 |
5 | T1 | 20 |
5 | T2 | 21 |
From this listing, we see there are ties in values. In the next step, we sort out all the ties by adding their ranks and dividing by the number of times that particular number is repeated. For example, the number 3 is repeated 4 times and their ranks are from 11 to 14 and hence the revised rank for '3' is (11+12+13+14)/4=50/4=12.5. Hence the revised rank is 12.5 for 3. Likewise ,we compute for other values as well.
Treatment | Sorted | Rank | Revised |
1 | T2 | 1 | 3.5 |
1 | T2 | 2 | 3.5 |
1 | T3 | 3 | 3.5 |
1 | T3 | 4 | 3.5 |
1 | T3 | 5 | 3.5 |
1 | T3 | 6 | 3.5 |
2 | T1 | 7 | 8.5 |
2 | T2 | 8 | 8.5 |
2 | T2 | 9 | 8.5 |
2 | T3 | 10 | 8.5 |
3 | T1 | 11 | 12.5 |
3 | T2 | 12 | 12.5 |
3 | T2 | 13 | 12.5 |
3 | T3 | 14 | 12.5 |
4 | T1 | 15 | 16 |
4 | T1 | 16 | 16 |
4 | T2 | 17 | 16 |
5 | T1 | 18 | 19.5 |
5 | T1 | 19 | 19.5 |
5 | T1 | 20 | 19.5 |
5 | T2 | 21 | 19.5 |
In the next step, we list the revised ranks, treatment wise .
T1 | T2 | T3 |
8.5 | 3.5 | 3.5 |
12.5 | 3.5 | 3.5 |
16 | 8.5 | 3.5 |
16 | 8.5 | 3.5 |
19.5 | 12.5 | 8.5 |
19.5 | 12.5 | 12.5 |
19.5 | 16 | 35 |
111.5 | 19.5 | 6 |
7 | 84.5 | |
8 |
Now the entries in Bold gives the Total and the number of values in each treatment.
Here we have three treatments and the number of times each treatment appears
Total of ranks for the three treatments
Test Statistics: Compute follows a distribution.
We shall look at EXCEL to find out the p-value by CHISQ.DIST.RT(8.6165,2)=0.0135.
Since the p-value <0.05, the Null hypotheis is rejected and there a significant difefernce between treatments.