Kruskal-Wallis Test
Menu location: Analysis_Analysis of Variance_Kruskal-Wallis.
This is a method for comparing several independent random samples and can be used as a nonparametric alternative to the one way ANOVA.
The Kruskal-Wallis test statistic for k samples, each of size ni is:
- where N is the total number (all ni) and Ri is the sum of the ranks (from all samples pooled) for the ith sample and:
The null hypothesis of the test is that all k distribution functions are equal. The alternative hypothesis is that at least one of the populations tends to yield larger values than at least one of the other populations.
Assumptions:
- random samples from populations
- independence within each sample
- mutual independence among samples
- measurement scale is at least ordinal
- either k population distribution functions are identical, or else some of the populations tend to yield larger values than other populations
If the test is significant, you can make multiple comparisons between the samples. You may choose the level of significance for these comparisons (default is a = 0.05). All pairwise comparisons are made and the probability of each presumed "non-difference" is indicated (Conover, 1999; Critchlow and Fligner, 1991; Hollander and Wolfe, 1999). Two alternative methods are used to make all possible pairwise comparisons between groups; these are Dwass-Steel-Critchlow-Fligner and Conover-Inman. In most situations, you should use the Dwass-Steel-Critchlow-Fligner result.
By the Dwass-Steel-Critchlow-Fligner procedure, a contrast is considered significant if the following inequality is satisfied:
- where q is a quantile from the normal range distribution for k groups, ni is size of the ith group, nj is the size of the jth group, tb is the number of ties at rank b and Wij is the sum of the ranks for the ith group where observations for both groups have been ranked together. The values either side of the greater than sign are displayed in parentheses in StatsDirect results.
The Conover-Inman procedure is simply Fisher's least significant difference method performed on ranks. A contrast is considered significant if the following inequality is satisfied:
- where t is a quantile from the Student t distribution on N-k degrees of freedom. The values either side of the greater than sign are displayed in parentheses in StatsDirect results.
An alternative to Kruskal-Wallis is to perform a one way ANOVA on the ranks of the observations.
StatsDirect also gives you an homogeneity of variance test option with Kruskal-Wallis; this is marked as "Equality of variance (squared ranks)". Please refer to homogeneity of variance for more details.
Technical Validation
The test statistic is an extension of the Mann-Whitney test and is calculated as above. In the presence of tied ranks the test statistic is given in adjusted and unadjusted forms, (opinion varies concerning the handling of ties). The test statistic follows approximately a chi-square distribution with k-1 degrees of freedom; P values are derived from this. For small samples you may wish to refer to tables of the Kruskal-Wallis test statistic but the chi-square approximation is highly satisfactory in most cases (Conover, 1999).
Example
From Conover (1999, p. 291).
Test workbook (ANOVA worksheet: Method 1, Method 2, Method 3, Method 4).
The following data represent corn yields per acre from four different fields where different farming methods were used.
Method 1 | Method 2 | Method 3 | Method 4 |
83 | 91 | 101 | 78 |
91 | 90 | 100 | 82 |
94 | 81 | 91 | 81 |
89 | 83 | 93 | 77 |
89 | 84 | 96 | 79 |
96 | 83 | 95 | 81 |
91 | 88 | 94 | 80 |
92 | 91 | 81 | |
90 | 89 | ||
84 |
To analyse these data in StatsDirect you must first prepare them in four workbook columns appropriately labelled. Alternatively, open the test workbook using the file open function of the file menu. Then select Kruskal-Wallis from the Nonparametric section of the analysis menu. Then select the columns marked "Method 1", "Method 2", "Method 3" and "Method 4" in one selection action.
For this example:
Adjusted for ties: T = 25.62883 P < 0.0001
All pairwise comparisons (Dwass-Steel-Chritchlow-Fligner)
Method 1 and Method 2 , P = 0.1529
Method 1 and Method 3 , P = 0.0782
Method 1 and Method 4 , P = 0.0029
Method 2 and Method 3 , P = 0.0048
Method 2 and Method 4 , P = 0.0044
Method 3 and Method 4 , P = 0.0063
All pairwise comparisons (Conover-Inman)
Method 1 and Method 2, P = 0.0078
Method 1 and Method 3, P = 0.0044
Method 1 and Method 4, P < 0.0001
Method 2 and Method 3, P < 0.0001
Method 2 and Method 4, P = 0.0001
Method 3 and Method 4, P < 0.0001
From the overall T we see a statistically highly significant tendency for at least one group to give higher values than at least one of the others. Subsequent contrasts show a significant separation of all groups with the Conover-Inman method and all but method 1 vs. methods 2 and 3 with the Dwass-Steel-Chritchlow-Fligner method. In most situations, it is best to use only the Dwass-Steel-Chritchlow-Fligner result.