The Kruskal-Wallis H test Lecture 55

 The Kruskal-Wallis H Test 

Lecture 55

The Kruskal-Wallis H test, commonly known as the one-way ANOVA on ranks, is a non-parametric test alternative to one-way ANOVA.  The null hypothesis tested that the population medians are equal against the alternative that the population medians are not equal. The Kruskal-Wallis H test is the extension of the Mann-Whitney U test, which is employed to compare two population medians. To perform the test, arrange all the sample observations, assign ranks denoted by rij and assign average ranks to the tied observations. The observations are replaced by their respective ranks, and the sum of ranks of each sample is denoted by Ri. Then compute the following quantities:

If there is no tie, then S^2r can be calculated as:

Then the Kruskal-Wallis H statistic can be computed as:

Where C is the correction factor and can be obtained as:

If there are no ties, the H statistic is simplified to

Reject H0 when H ≥ χ2(k-1)
Example 13.11: A botanist is interested to know the impact of sunlight on the height of a particular plant. The certain plant is sown in four different locations of the district sites. The plant is exposed to high, medium and low sunlight, and the following ranks are obtained:

Rank of Growth of Plant

High Sun Light

Medium Sun Light

Low Sun Light

8

4

1

7

5

3

9

6

5

2

4

3


The shape of the population is not normally distributed. Test the hypothesis that the growth of the plant is identically distributed.
Solution:
i. State the null and alternative hypotheses
H0: Median 1 = Median 2 = Median 3 vs. H1: Median 1  Median 2  Median 3
ii. The significance level: α = 0.05
iii. The test statistic: 
iv. Reject H0 when H ≥ χ²(2) = 5.991

.v. Computation:




vi. Remarks: The calculated H value falls in the rejection area; the sample data does not provide sufficient evidence to accept the null hypothesis. Thus, it is concluded that the growth of the plant is not identical in three different sunlights.

Example 13.12: A researcher is interested in wanting to compare the efficacy of three drugs in shoulder pain. She selects 24 patients who have shoulder pain and divides them into three groups of approximately identical medical conditions to receive drug A, drug B or drug C. The rating of 24 patients is as follows:

Drug A

Drug B

Drug C

23

22

59

26

27

66

51

39

38

49

29

49

58

46

56

37

48

60

29

49

56

44

65

62

The patients' population is not normal, and test the hypothesis that three drugs are equally effective.
i. State the null and alternative hypotheses
H0: Median 1 = Median 2 = Median 3 vs. H1: Median 1  Median 2  Median 3
ii. The significance level: α = 0.05
iii. The test statistic: Kruskal-Wallis H test.

iv. Reject H0 when H ≥ χ²(2) = 5.991

.v. Computation: arrange the data of three samples in ascending order of magnitude and assign ranks.

Observation

22

23

26

27

29

29

37

38

Rank

1

2

3

4

5

6

7

8

Avg. Rank

 

 

 

 

5.5

 

 

Observation

39

44

46

48

49

49

49

51

Rank

9

10

11

12

13

14

15

16

Avg. Rank

 

 

 

 

14

 

Observation

56

56

58

59

60

62

65

66

Rank

17

18

19

20

21

22

23

24

Avg. Rank

17.5

 

 

 

 

 

 


Replace each value by its respective rank.

Rank of Drug A

Rank of Drug B

Rank of Drug C

2

1

20

3

4

24

16

9

8

14

5.5

14

19

11

17.5

7

12

21

5.5

14

17.5

10

23

22

Total

R1 = 76.5

R2 = 79.5

R3=144


vi. Remarks: The calculated H value falls in the rejection area; the sample data does not provide sufficient evidence to accept the null hypothesis. Thus, it is concluded that the three drugs do not have equal efficacy in relieving shoulder pain.

Dunn’s Test

The Dunn’s test is a post hoc test alternative to the Kruskal-Wallis H test. In the Kruskal-Wallis H test, when the null hypothesis is significant. The pairwise comparison is made by Dunn’s test. The pairwise treatments can also be compared by the Mann-Whitney U test and Wilcoxon rank sum.

The Dunn’s statistic is given by:

Where:

N represents the total number of observations.

ni, nj represent the sample observations.

The pair of means will be significant if the Q value exceeds Dunn’s critical table value.


Example 13.12: Using the data of Q 13.11, check the pairwise comparison by using Dunn's test.
Solution:
R1 = 76.5, R2 = 79.5, R3 = 144
n1 = 8, n2 = 8, n3 = 8
N = 24
The Dunn's critical value for k = 3 treatments at α = 0.05 is 2.394
D = 2.394
Comparing drugs A and B:
H0: Median 1 = Median 2 vs. H1: Median 1  Median 2 

There is no significant difference between drugs A and B.

Comparing drugs A and C:

H0: Median 1 = Median 3 vs. H1: Median 1  Median 3 


The drug A is significantly different from drug C.
Comparing drugs B and C:

H0: Median 2 = Median 3 vs. H1: Median 2  Median 3 
The drug B is significantly different from drug C.
Example 13.13: Four treatments, A, B, C and D, are involved in an experiment. The observations in each group are randomly selected, and the following data represent the results of the experiment.

A

B

C

D

57

43

87

60

81

61

69

70

67

42

58

75

64

45

82

72

96

39

90

79

80

 

91

76

68

 

 

 

56

 

 

 

Use the Kruskal-Wallis H test to decide whether the four groups are taken from populations with the same median. Apply Dunn's test, if applicable.

Solution:

i. State the null and alternative hypotheses
H0: Median 1 = Median 2 = Median 3 = Median 4 
vs. 
H1: Median 1  Median 2  Median 3  Median 4
ii. The significance level: α = 0.05

iii. The test statistic: Kruskal-Wallis H test.
vi. Reject H0 when H ≥ χ²(3) = 7.815
v. Computation: Arrange the observations of four samples combinedly in ascending order of magnitude and assign ranks. Replace each observation by its respective rank.

Rank of A

Rank of B

Rank 0f C

Rank of D

6

3

22

8

20

9

13

14

11

2

7

16

10

4

21

15

25

1

23

18

19

 

24

17

12

 

 

 

5

 

 

 

R1 = 108

R2 = 19

R3 = 110

R4 = 88





vi. Remarks: The calculated H value falls in the rejection region; the sample data does not provide sufficient evidence to accept the null hypothesis. Thus, it is concluded that the four treatments are significantly different.
Yes, the Dunn's test is applicable.
The Dunn's critical value:
D = 2.639






* Significant


No comments:

Post a Comment

Moving Average Models (MA Models) Lecture 17

  Moving Average Models  (MA Models)  Lecture 17 The autoregressive model in which the current value 'yt' of the dependent variable ...