0% found this document useful (0 votes)
264 views19 pages

Kruskal-Wallis Test Guide

The Kruskal-Wallis H test is a non-parametric method used to determine if there are statistically significant differences between two or more groups of an independent variable on a continuous dependent variable. It is similar to a one-way ANOVA but does not assume a normal distribution and equal variances among groups. The null hypothesis is that the samples are from identical populations. If the Kruskal-Wallis test is significant, post-hoc tests like the Mann-Whitney U test can identify which specific groups differ. Examples demonstrate calculating the Kruskal-Wallis H statistic and conducting follow-up Mann-Whitney tests to determine the source of differences between groups.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
264 views19 pages

Kruskal-Wallis Test Guide

The Kruskal-Wallis H test is a non-parametric method used to determine if there are statistically significant differences between two or more groups of an independent variable on a continuous dependent variable. It is similar to a one-way ANOVA but does not assume a normal distribution and equal variances among groups. The null hypothesis is that the samples are from identical populations. If the Kruskal-Wallis test is significant, post-hoc tests like the Mann-Whitney U test can identify which specific groups differ. Examples demonstrate calculating the Kruskal-Wallis H statistic and conducting follow-up Mann-Whitney tests to determine the source of differences between groups.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Kruskal-Wallis Test

Dr.E.S.Jeevanand,
Associate Professor
Union Christian College. Aluva
Kruskal-Wallis Test
The Kruskal-Wallis Test was developed by Kruskal and Wallis (1952)
jointly and is named after them. The Kruskal-Wallis test is a
nonparametric (distribution free) test, and is used when the
assumptions of one way ANOVA are not met. They both assess for
significant differences on a continuous dependent variable by a
grouping independent variable (with three or more groups). In the
ANOVA, we assume that distribution of each group is normally
distributed and there is approximately equal variance on the scores for
each group. However, in the Kruskal-Wallis Test, we do not have any
of these assumptions.
One way ANOVA is a statistical data analysis technique that is used to
test the equality of the mean of three or more independent variable
Kruskal-Wallis Test
• The Kruskal-Wallis H test (sometimes also called the "one-way
ANOVA on ranks") is a rank-based nonparametric test that can be
used to determine if there are statistically significant differences
between two or more groups of an independent variable on a
continuous or ordinal dependent variable. The Kruskal-Wallis one-
way ANOVA is a non-parametric method for comparing k
independent samples. It is roughly equivalent to a parametric one
way ANOVA with the data replaced by their ranks. Since ranking is
conditional upon your observed values, so is this test. The null and
alternative hypothesis in this case are
• Null hypothesis: The samples are from identical populations.
• Alternative hypothesis: The sample comes from different
populations.
Kruskal-Wallis Test
The Kruskal-Wallis is also used as a test of equality of medians or even
means. In the latter case, in addition to the distributional assumptions
mentioned above, observations are also assumed to be distributed
symmetrically.
• The null and alternative hypothesis in this case are
• Null hypothesis: Null hypothesis assumes that the k samples median are
equal. (i.e. H0: )
• Alternative hypothesis: Alternative hypothesis assumes that some among
the k samples median are different.
The outcome of the Kruskal–Wallis test tells you if there are differences
among the medians of some of the k groups, but doesn't tell you which
groups are different from other groups. In order to determine which groups
are different from others, Mann Whitney U test can be conducted.
Kruskal-Wallis Test- Assumptions
• The assumptions of the Kruskal-Wallis test are similar to those for
the Mann-Whitney test.
• Samples are random samples, or allocation to treatment group is
random.
• The two samples are mutually independent. (independence within
each sample and mutual independence among samples)
• The measurement scale is at least ordinal, and the variable is
continuous.
• If the test is used as a test of dominance, it has no distributional
assumptions. If it used to compare medians, the distributions must
be similar apart from their locations.
Kruskal-Wallis Test
Procedure for carrying out the test
• Combine the observations in the k samples into a single pooled 'null'
sample, retaining the information on the source of each observation.
• Under each observation, write down X or Y or Z etc. (or some other
relevant symbol) to indicate which sample they are from.
• Assign ranks to the pooled sample after arrange the data in
ascending order. If two values are the same, they both get the
average of the two ranks for which they tie - in other words use
mean ranks for tied observations, not sequential ranks. (i.e. the
ranking is same as that of Mann-Whitney test)
• Once this is complete, ranks or the different samples are separated
and summed up as R1 R2 R3, etc.
Kruskal-Wallis Test
Procedure for carrying out the test
• Compute the Kruskal-Wallis test statistic (H).

3(n+1)

• Where, n = total number of observations in all


samples Kruskal-Wallis Test statistic is approximately a chi-square
distribution, with k-1 degree of freedom where ni should be greater than 5.
• Decision criteria is
Reject H0 if H ≥
• Where for a given , is the tabled value obtained from the chi-square
table, with k-1 degree of freedom.
Example I
• Three products received the Product
following performance rating
by a panel of 20 customers. A B C
Use the Kurskal-Wallis test to
25 60 50
determine whether there is
significant difference in the 70 20 70
performance ratings for the
product. 60 30 60

• Here the hypothesis are 85 15 80

• H0: the performance ratings 95 40 90


are same for the product. 90 35 70
• H1: the performance ratings 80 75
are different for the product.
Example I ranking for pooled data
Rating Product Rank Rating Product Rank
15 B 1 70 A 12
20 B 2 70 C 12
25 A 3 70 C 12
30 B 4 75 C 14
35 B 5 80 A 15.5
40 B 6 80 C 15.5
50 C 7 85 A 17
60 A 9 90 A 18.5
60 B 9 90 C 18.5
60 C 9 95 A 20
Example I
Product A Rank Product B Rank Product C Rank
25 3 60 9 50 7
70 12 20 2 70 12
60 9 30 4 60 9
85 17 15 1 80 15.5
95 20 40 6 90 18.5
90 18.5 35 5 70 12
80 15.5 75 14
Total R1=95 R2=27 R3=88
Example I
Here n1 = 7, n2 = 6, n3 = 7, n= = 7+6+7 =20, k=3
R1 = 95, R2 = 27 and R3 = 88

= = 2517.071

3(n+1)
( )

= = 8.916.
( )

The tabled value for =0.05 and k=3-1 degrees of freedom is 5.99. Since
the calculated value test is significant. So we reject H0 and conclude
that the performance ratings are different for the product.
Example II
The marks of statistics for selected 5
students from three colleges are College
given in the table. Test whether the
A B C
performance of the students of the
three college are same or not. 50 80 60
• Here the hypothesis are
62 95 45
• H0:
75 98 30
• H1: some of the colleges differs in
median marks. 48 87 58

Where is the median mark of ith 65 90 57


college.
Example II ranking for pooled data
Marks College Rank Marks College Rank
30 C 1 65 A 9
45 C 2 75 A 10
48 A 3 80 B 11
50 A 4 87 B 12
57 C 5 90 B 13
58 C 6 95 B 14
60 C 7 98 B 15
62 A 8
Example II
College A Rank College B Rank College C Rank
50 4 80 11 60 7
62 8 95 14 45 2
75 10 98 15 30 1
48 3 87 12 58 6
65 9 90 13 57 5
R1=34 R2=65 R3=21
Example II
Here n1 = 5, n2 = 5, n3 = 5, n2 = 7, n= = 5+5+5 =15, k=3
R1 = 34, R2 = 65 and R3 = 21

= = 1164.40

3(n+1)
( )

= = 10.22.
( )

The tabled value for =0.05 and k=3-1 degrees of freedom is 5.99. Since the
calculated value test is significant. So we reject H0 and conclude that the
performance students are different for the three colleges.
Example II
Since the test is found significant, Compare
Groups Ri Ui U Result
we have to determine which Colleges

colleges are different from each Group I


College A 15 25.00
0.00 Significant
other in median marks for this we College B 40 0.00
conduct Mann Whitney U test. College A 34 6.00 Not
Group II 6.00
The result presented in the College C 21 19.00 Significant

following table. The result College B 40 0.00


indicate that the college A and Group III
College C 15 25.00
0.00 Significant

College B, College B and College


Critical U =2
C differs significantly. But college
A and College C does not differ
with each other.
The difference between Mann
Whitney and Kruskal-Wallis Tests
• The major difference between the Mann-Whitney U and
the Kruskal-Wallis H is simply that the latter can
accommodate more than two groups.
• That is Mann-Whitney compare the median or
distribution between two groups or two populations.
• Kruskal-Wallis compare the median or distribution
between three or more groups or populations
Non Parametric Tests

Sign Test Kruskal-Wallis


Test

Wilcoxon
Signed Ranks Mann-
Test Whitney U test

χ2Goodness of Wald–Wolfowitz
Fit test Runs test
χ2test of
Independence Fishers Exact Test

When scaling, group all elements to be scaled. Scale as needed. Use the
“Increase Font Size,” “Decrease Font Size” buttons or manually change the font
size for the editable text.
Contact details esjmaths@gmail.com
9847915101, 8089684892

This Completes your


syllabus

You might also like