The Kruskal-Wallis Test The Kruskal-Wallis test is a nonparametric test that can be used to determine whether three or more independent samples were selected from populations having the same distribution. H 0: There is no difference in the population distributions. H a: There is a difference in the population distributions. Combine the data and rank the values. Then separate the data according to sample and find the sum of the ranks for each sample. R i = the sum of the ranks for sample i.
Kruskal-Wallis Test Given three or more independent samples, the test statistic H for the Kruskal-Wallis test is where k represents the number of samples, n i is the size of the i th sample, N is the sum of the sample sizes, and R i is the sum of the ranks of the i th sample. Reject the null hypothesis when H is greater than the critical number. (always use a right tail test.)
As the one-way ANOVA is an extension of the two independent groups t-test, the Kruskal-Wallis test is an extension of the Mann-W hitney U test. The Kruskal-Wallis test handles k-independent groups of samples. Like the Mann-Whiteny U test, this test uses ranks.
Procedure 1. combine the observations of the various groups 2. arrange them in order of magnitude from lowest to highest 3. assign ranks to each of the observations and replace them in each of the groups 4. original ratio data has therefore been converted into ordinal or ranked data
5- ranks are summed in each group and the test statistic, H is computed 6. ranks assigned to observations in each of the k groups are added separately to give k rank sums
If k = 3 and n(i)'s are less than or equal to 5, use Table N to determine the critical value for a specified level of significance. Decision rule: Reject ho if H < H (alpha), otherwise do not reject ho. The conclusion will relate the decision with the actual hypothesis being tested.
If k, the number of groups is greater than 3 or any of the n(i) ‘ s are greater than 5, the critical value is found by entering the chi-square distribution (Table F) with k-1 degrees of freedom. *The sampling distribution is a chi-square distribution with k - 1 degrees of freedom (Where k = the number of samples.) If the test statistic H is greater than the chi-square value, then ho is rejected, otherwise it is not rejected
Example Three different diets are tested to determine their effectiveness in helping people lose weight. Fifteen overweight men are chosen for the study. Five men each are assigned to a different diet plan. After a 5 month period each are measured on the percentage of body weight. The data are given below.
The null and alternative hypotheses are stated verbally. For example ho: The diet plans A, B and C are equally effective. For example ho: The diet plans A, B and C are equally effective. h1: At least one of the following is true: A is different from B, A is different from C or B is different from C
–** Plan A * Plan B ** Plan C
ho: Diet Plans A, B, and C are equally effective h1: At least one of the following is true: A is different from B, A is different from C or B is different from C. The ranks assigned to the data are given in the table below: Plan A * Plan B **61.54 Plan C
n(1) = 5, n(2) = 4, n(3) = 3 r(1) = = 27.5 r(2) = = 39.0 r(3) = = 11.5 N = = 12 NOTE: one subject dropped out of Plan B and 2 subjects dropped out of Plan C.
From Table N, the critical value obtained is This value is found using n(1) =5, n(2) = 4, and n(3) = 3 and alpha =.05. Decision Rule: Reject ho if H or KW > 5.603, otherwise, do not reject ho. Decision: Since H = is not larger than 5.603, the null hypothesis is not rejected. Conclusion: The is insufficient evidence that the Diet plans are different in effectiveness.
There will be a significant difference if the calculated H value > or equals the tabulated one. Adjustment due to ties can affect the value of H ( increase ), So if the value of calculated H is already larger there is no need for adjustment but if it is small it has to be done.
Adjustment due to ties can be achieved as follows : If tied Values present we may need to adjust H Value for this tie by dividing it by Where T=t 3 – t t = the number of tied observations. t = the number of tied observations. n = the sum of tied ranks. n = the sum of tied ranks.
You want to compare the hourly pay rates of accountants who work in Michigan, New York and Virginia. To do so, you randomly select 10 accountants in each state and record their hourly pay rate as shown below. At the.01 level, can you conclude that the distributions of accountants’ hourly pay rates in these three states are different?
H 0 : There is no difference in the hourly pay rate in the 3 states. H a : There is a difference in the hourly pay in the 3 states. 1. Write the null and alternative hypothesis 2. State the level of significance 3. Determine the sampling distribution The sampling distribution is chi-square with d.f. = 3-1 = 2 From Table,the critical value is 2 5. Find the rejection region 4. Find the critical value
Test Statistic Michigan salaries are in ranks: 2, 3, 4, 5, 6, 7, 13, 15, 17.5, 22 The sum = 94.5 New York salaries are in ranks: 8, 14, 19, 21, 23, 24, 27, 28, 29, 30 The sum is 223 Virginia salaries are in ranks: 1, 9, 10, 11, 12, 16, 17.5, 20, 25, 26 The sum is 147.5
R 1 = 94.5, R 2 = 223, R 3 =147.5 n 1 = 10, n 2 =10 and n 3 =10, so N = 30 H = Make Your Decision Interpret your decision The test statistic, falls in the rejection region, so Reject the null hypothesis There is a difference in the salaries of the 3 states. Find the test statistic