You are on page 1of 23

6.

2 Kruskal-wallis
One-way
Analysis Of
Variance By
Ranks
Learning outcome

Students should be able
to make inferences
by using Kruskal-wallis
Assumption
The data for analysis consist of k random
samples of sizes

The observations are independent both
within and among samples.
The variable of interest is continuous
The measurement scale is at least ordinal.
The populations are identical except for a
possible difference in location for at least
one population.
k
n n n ,... ,
2 1
Hypotheses

The k population distribution
functions are identical.

The k populations do not all have
the same median.
:
0
H
:
1
H
Test statistics
Data display for Kruskal-Wallis one-way
analysis of variance by ranks.

Sample

1 2 ... K




1 , 1
X
2 , 1
X
1
, 1 n
X
1 , 2
X
2 , 2
X
2
, 2 n
X
1 , k
X
2 , k
X
k
n k
X
,


= Sum of the ranks assigned to
observation in the sample

= Expected sum of ranks for the
treatment under
0


(equation 6.1)

=
|
.
|

\
|
+

+
=
k
i
i
i
i
N n
R
n N N
H
1
2
2
) 1 ( 1
) 1 (
12
2
) 1 ( + N n
i
i
R







(Equation
6.2)

=
+
+
=
k
i
i
i
N
n
R
N N
H
1
2
) 1 ( 3
) 1 (
12
To show how to get equation 6.2 :



=
12
( + 1)

=1

( +1)
2
2

=
12
( + 1)

+1 +

2
+ 1
2
4

=1

=
12
( + 1)

=1

1
+ 1 +

2
+ 1
2

=1

=
12
( + 1)

=1

+ 1

=1
+

+ 1
2
4

=1

Given that


Therefore:

2
1 + ,

=1

=1
=
=
12
( + 1)

=1

+ 1
2
2
+
+ 1
2
4

=
12
( + 1)

=1

+ 1
2
4

=
12
( + 1)

=1
3 + 1 !
Decision rule
Reject if

0
H
5 s
i
n
5 >
i
n
) 12 . ( A H H
o
>
) 11 . (
) 1 ( ,
2
A X H
k
>
o
Summary to find Kruskal-Wallis

Step 1 : State the hypotheses and identify the
claim
Step 2 : Compute the test value
a) Arrange the data from lowest to
highest and rank each value.
b) Find the sum of the ranks of each
group.
c) Substitute in the formula



Step 3 :Find the critical value. If

5
use table A.12 (kruskal-wallis table)
if

> 5 , use table A.11


(chi-squares table)
Step 4 :Make a decision
Step 5 :Summarize the results (conclusion)
=
12
( + 1)

=1
3 + 1
Example
Cawson et.al *reported the data shown in Table below
on cortisol levels in three groups of patients who were
delivered between 38 and 42 weeks gestation. Group I
was studied before the onset of labor at elective
Caesarean section, group II was studied at emergency
Caesarean section during induced labor, and group
consisted of patients in whom spontaneous labor
occurred and who were delivered either normally or
by Caesarean section. We wish to know whether these
data provide sufficient evidence to indicate a
difference in median cortisol levels among the three
populations represented. Let = 0.01

*Cawson,M.J.,AnneB.M.Anderson,A.C.Turnbull, and L. Lampe, Cortisol, Cortisone, and
11-Deoxycortisol Levels in Human Umbilical and Maternal Plasma in Relation to the
Onset of Labour, Obstet. Gynaecol. Br. Commonw.,81 (1974), 737-745.
Antecubital vein cortisol levels in three
groups of patients studied at time of delivery






Group
I

262

307

211

323

454

339

304

154

287

356
Group
II

465

501

455

355

468

362
Group
III

343

772

207

1048

838

687
Table 6.10
Hypotheses

The three populations represented by the
data are identical

The three populations do not have the
same median (claim)






:
0
H
:
1
H
Test statistic
The ranks replacing the original observations
of Table 6.10 are displayed in Table 6.11,
along with the three rank sums. From these
data we use Equation 6.2 to compute





Table 6.11
Group Ranks Rank sums
I 4 7 3 8 14 9 6 1 5 12
II 16 18 15 11 17 13
III 10 20 2 22 21 19
69
1
= R
90
2
= R
94
3
= R

=
+
+
=
k
i
i
i
N
n
R
N N
H
1
2
) 1 ( 3
) 1 (
12
( ) 232 . 9 1 22 3
6
94
6
90
10
69
) 1 22 ( 22
12
2 2 2
= +
(

+ +
+
= H
Decision
Since the sample sizes all exceed 5, we
must use the chi-squared table (A.11)
df = k-1= 3-1 = 2
thus critical value = 9.210 and test statistic
H = 9.232
since 9.232 > 9.210 we reject
Conclusion
Medians of the populations represented
are not equal-that is, the median cortisol
levels are not the same for all three types
of patient.

0
H
Correction for ties




Where and t is the number of ties
observations in a group of tied scores. The
adjusted test statistic becomes






N N
T


3
1
t t T =
3


=
) /( 1
3
N N T
H
H
c
Power efficiency

The asymptotic efficiency of the Kruskal-
Wallis test is relative to parametric F test
to be 0.955 when sampling is from
normally distributed populations.
If the distribution functions have identical
shapes and differ only in location, Hodges
and Lehmann (T5) have shown that the
asymptotic relative efficiency is never less
than 0.864 and may be greater than 1
under certain conditions.

BACK
Link video in the youtube :
http://youtu.be/CXebfjEY5zE



http://appliednonparametricstatistic.blog
spot.com/.

Link video and note in the
blog :

You might also like