The Kruskal-Wallis test is a nonparametric method of testing the hypothesis that several populations have the same continuous distribution versus the alternative that measurements tend to be higher in one or more of the populations.
To apply the test, we obtain independent random samples of sizes n1, n2, . . . , nm from m populations. Assume that there are N observations in all. We rank all N observations and let Ri be the sum of the ranks of the ni observations in the ith sample. The Kruskal-Wallace statistic is
When the sample sizes are large and all m populations have the same continuous distribution, then H has an approximate chi-square distribution with m - 1 degrees of freedom.
When H is large, creating a small right-tail probability (p-value), then we reject the null hypothesis that all populations have the same distribution.
To execute the KRUSKAL program on the TI-83, we must use the MATRX EDIT screen to enter the data into matrix [A] that is defined to have m columns. The number of rows should be the maximum of the sample sizes. Fill out the last entries in the other columns with zeros. Next, enter the sample sizes into matrix [B] having dimensions 1 x m.
On the TI-86 use matrices called A and B. On the TI-89 use matrices called a and b in the Main folder.
The program displays the test statistic and P-value. Under list L5 on the TI-83 (fStat on the TI-86, or in c3 in the current list on the TI-89: Press APPS, then 6, then 1), the sums of the ranks from each population are listed.
Example. Below are the combined SAT scores for three GPA ranges from random samples of high school seniors. Use the data to test the hypothesis that there is no difference SAT score distribution among the three groups.
Solution. First, we enter the data into a 23 x 3 matrix [A] (A or a) and the successive sample sizes 22, 21, and 23 into the 1 x 3 matrix [B] (B or b). Then we call up and execute the KRUSKAL program to obtain a test statistic of14.2463 and a P-value of 0.000806. Based on the low P-value, we can reject the claim that SAT scores have the same distribution among these three grade point average groups.
Under list L5 on the TI-83 (fStat on the TI-86, or in c3 in the current list TI-89: Press APPS, then 6, then 1), we see that the sums of the ranks from the three groups are 1008.5, 623.5, and 579. If the SAT scores had the same distribution among these three GPA groups, then there would be only 0.000806 probability of the sums of the ranks being so disparate.
(Note: The conclusion does not mean that all three distributions are distinct. It simply means that at least one is different from the other two. It might be that one pair may have the same distribution. But pairs of groups can now be tested for having the same distribution using the sign test or the rank sum test.)
Here are raw sample data on the women's heights in inches as broken down by various age groups. Use the Kruskal-Wallis procedure to test the null hypothesis that heights have the same distribution for each age group.
1. First enter the heights into the 12 x 4 matrix [A] (A or a). Be sure to enter the populations as columns within the matrix. Fill out the first, second, and fourth columns with zeros. Then enter the sample sizes 10, 9, 12, 10 into the 1 x 4 matrix [B] (B or b).
After entering the data into the appropriate matrices and executing the KRUSKAL program, we obtain a test statistic of 1.64718 and a P-value of 0.64874. Based on the high P-value, we do not have evidence to reject the claim that heights have the same distribution among these four age groups.
Under list L5 on the TI-83 (fStat on the TI-86, or in c3 in the current list on the TI-89), we see that the sums of the ranks from the four groups are 185, 196.5, 290.5, and 189. These are not significant variations to warrant rejecting the null hypothesis.
Return to Table of Contents.