Uploaded by joseph.pines001

Kruskal-Wallis Test Explained

advertisement
The Kruskal
Wallis Test
By: JOSEPH PINES
•What is Kruskal-Wallis
Test?
The Kruskal-Wallis test is a nonparametric statistical method used
to determine if there are significant
differences between three or more
independent groups
WHY DO WE USE
KRUSKAL WALLIS TEST?
The data is not normally
distributed.
The sample sizes are small.
We want to compare medians
between groups.
.
•
12
H=
𝑁 𝑁+1
𝑘
𝑖=1
𝑅𝑖 2
− 3 𝑁+1
𝑛𝑖
Formula and Symbols:
•H = Kruskal-Wallis statistic
•k = number of groups
•N = total number of observations
•Ri = sum of ranks for group i
•Ni = number of observations in
group i
.
• Problem
• You want to compare the effects of three
different study methods on student exam
scores. The scores for each method are as
follows:
• Method
A: 78, 85, 88
.
• Method B: 65, 70, 72, 75
• Method C: 80, 82, 84
•Step 1: Rank all the data.
• Combined
SCORES
RANK
data:78,85,88,65,70,72,75,80,82,84
65
1
70
2
72
3
75
4
78
5
80
6
82
7
84
8
85
9
88
10
•Step 2:Calculate Ranks and Group
Statistics
Ra=5+9+10= 24
Na = 3
Rb=1+2+3+4= 10
Nb = 4
Rc=6+7+8= 21
Nc = 3
• Step 3: Calculate the Test Statistics
(H)
𝑘
12
H=
𝑁 𝑁+1
𝑖=1
𝑅𝑖 2
− 3 𝑁+1
𝑛𝑖
.
Where:
N= Na + Nb+ Nc = 3 + 4 + 3 = 10
K= 3 (number of groups)
•
• Step 4: Calculate
the
Kruskal-Wallis
statistic
𝑘
H.
𝑅𝑖 2
− 3 𝑁+1
𝑛𝑖
12
𝑖=1
H=
𝑁 𝑁+1
𝑘
242 102 212
(
+
+
) − 3 10 + 1
3
4
3
12
𝑖=1
H=
10 10+1
.
𝑅𝑖 2
1. Calculate:
:
𝑁𝑖
242 576
Method A:
=
= 192
3
3
102 100
Method B:
=
= 𝟐𝟓
4
4
212 441
• Sum of these values:
𝑘
𝑖=1
𝑅𝑖 2
= 192 + 25 + 147 = 364
𝑛𝑖
2. Substitute values into H:
12
H=
(364) – 3 (10+1)
10 (11)
12
H=
(364) – 3 (11)
110
4368
H=
– 3 (11)
110
4368
H=
- 33
110
H= 39.71 – 33 = 6.71
•Degrees of Freedom:
df = k- 1
df= 3 – 1 = 2
For df = 2 and alpha (α) = 0.05
the critical value from the Chi-squared
distribution table is approximately
5.991.
Conclusion:
Calculated H : 6.71
Critical Value: 5.991
Since H: 6.71 > 5.991, we reject the null
hypothesis
There is significant evidence to suggest
that there are differences in exam
scores among the three study
methods.
•Activity
Problem:
• A researcher is studying the effect of three
different diets on cholesterol reduction
after a 10-week program. The cholesterol
reductions (in mg/dL) for each diet group
are as follows:
• Diet A: 12, 15, 18
• Diet B: 10, 11, 14, 16
• Diet C: 8, 9, 13
The end!
Thank you!
Download