Вы находитесь на странице: 1из 8

Kruskal-Wallis Test:

The Kruskal-Wallis Test is the nonparametric test equivalent to the one-way ANOVA.
- Recall what we know about ANOVA:
o Used to determine whether there are any significant differences between the
means of three or more independent (unrelated) groups.
o Equivalent for two sample t-test
o Hypotheses are written as:
H0: All k populations have the same mean

H1: At least a pair is
o Assumptions include:
All the groups are normally or approximately normally distributed
(Researcher must assume that the distributions of the measure for each
sample are normal and have equal variances).
There is homogeneity of variances.
The samples of the groups are independent of each other and subjects
within the groups were randomly selected.

- What happens if my data fail these assumptions?
o If the assumption of normality is not met and we do not have a balanced design,
one-way ANOVA is not an appropriate tool.
o One of our options is to choose the non-parametric Kruskal-Wallis H Test which
does not require the assumption of normality.

- Things to know about the Kruskal-Wallis Test:
o Used when you have one independent variable with three or more groups and
an ordinal dependent variable.
o It is an inferential statistics and a powerful non-parametric method for testing
the equality of different samples' medians (like all non-parametric tests, the
focus is on ranks, counting and the medians rather than the raw values to
calculate the statistic).
We use the sums of the ranks of the k samples to compare the
distributions.
o As the ANOVA is a conceptual extension of the two sample t-test, so the K-W test
is a conceptual extension of the Wilcoxon Rank Sum (Mann Whitney) test This
will help us analyze the specific sample pairs for significant differences.
Mann-Witney test is a non-parametric analog to the independent sample
t-test and can be used when you do not assume that the dependent
variable is a normally distributed interval variable We only assume that
the variable is at least ordinal
A generalized form of Mann-Witney test since it permits 3 or more
groups.
o Unlike one-way ANOVA, Kruskal-Wallis test does not require normality of the
populations (It places less restriction on the comparison, and therefore has
wider applications)
Since KW-test does not does not make a distributional assumption, it is
not as powerful as the one-way ANOVA.
o The hypotheses statements are written as:
H0: All k populations have the same median.
H1: Not all of the k population medians are the same (at least a pair is ).
Though the test does not identify where the differences occur or how
many differences actually occur.

- Assumptions:
o The data for analysis consists of k ramdon sample sizes
k
n n n ,..., ,
2 1

o The observations are independent both within and among the samples.
o The variable of interest is continuous.
o The measurement scale is at least ordinal

- Formula:
) 1 ( 3
) 1 (
12
1
2
+
+
=

=
N
n
R
N N
H
k
i
i
i

Where:
N = Total number of observations across all groups

=
=
k
i
i
n
1

Number of observations in group i


=

k
i
i
R
1

Summation of rank for each group
k = Represents the number of groups

- Examples:
o To assess the effects of expectation on the aesthetic quality, an investigator randomly
sorts 24 amateur wine aficionados into three groups A, B and C of 8 subjects each.
Each subject is scheduled for an individual interview to taste and rate wines. The only
difference among the three groups is the expectations set regarding the quality of the
wine (its the same wine being tested across the groups). Group A is told that the wine
is of VERY fine quality, Group B is told that the wine is medium quality and Group C is
told that the wine is of low quality. The wine will be ranked from 1 (low) to 10 (high).

Group
1
Group
2
Group
3
6.4 2.5 1.3
6.8 3.7 4.1
7.2 4.9 4.9
8.3 5.4 5.2
8.4 5.9 5.5
9.1 8.1 8.2
9.4 8.2
9.7
N=8 N=7 N=6

-
Step 1: Rank all of the scores, ignoring which group they belong to. The procedure
for ranking is as follows: the lowest score gets the lowest rank. If two or more scores
are the same then they are "tied". "Tied" scores get the average of the ranks that
they would have obtained, had they not been tied.

Score Rank
1.3 1
2.5 2
3.7 3
4.1 4
4.9 5.5
4.9 5.5
5.2 7
5.4 8
5.5 9
5.9 10
6.4 11
6.8 12
7.2 13
8.1 14
8.2 15.5
8.2 15.5
8.3 17
8.4 18
9.1 19
9.4 20
9.7 21

Step 2: Find "Ri", the total of the ranks for each group. Just add together all of the
ranks for each group in turn.

Group 1 R1
Group
2 R2
Group
3 R3
6.4 11 2.5 2 1.3 1
6.8 12 3.7 3 4.1 4
7.2 13 4.9 5.5 4.9 5.5
8.3 17 5.4 8 5.2 7
8.4 18 5.9 10 5.5 9
9.1 19 8.1 14 8.2 15.5
9.4 20 8.2 15.5


9.7 21

Sum 131 58 42
(Sum)
2
17161 3364 1764

Step 3: Find "H".

-
) 1 21 ( 3
6
1764
7
3364
8
17161
) 1 21 ( 21
12
+ |
.
|

\
|
+ +
+
= H

-
( ) ) 22 ( 3 294 571 . 480 125 . 2145
) 22 ( 21
12
+ + = H

-
( ) 66 696 . 2919
462
12
= H

-
84 . 9 = H

Step 4: the degrees of freedom is the number of groups minus one.
df = 3 1 = 2

Step 5: Assessing the significance of H depends on the number of participants and
the number of groups. If you have three groups, with five or fewer participants in
each group, then you need to use the special table for small sample sizes. If you
have more than five participants per group, then treat H as Chi-Square. H is
statistically significant if it is equal to or larger than the critical value of Chi-Square for
your particular d.f.

Note: When sample sizes are small in each group (<5) and the number of groups is
less than 4 a tabled value for the Kruskal-Wallis should be compared to the H
statistic to determine the significance level. Otherwise, a chi-square with k-1 (the
number of groups -1) degrees of freedom can be used to approximate the
significance level for the test.

Here, we have n > 5 observations per group and so we treat H as Chi-Square. H
is 9.84, with 2 d.f.

-
Critical value falls under 5.99.

Decision: Since H> 5.99 at 0.05 level of significance, we therefore reject the null
hypothesis.

Using SPSS 16
Ranks

Group N Mean Rank
Score 1 8 16.38
2 7 8.29
3 6 7.00
Total
21

Test Statistics
a,b


Score
Chi-Square 9.849
df 2
Asymp. Sig. .007
a. Kruskal Wallis Test
b. Grouping Variable:
Group

Using the chi square table, since there are three columns so the degrees of
freedom can be calculated as 3 1 = 2.

For 0.05 level of significance, the critical value is 5.99.

Since, H = 9.84 > 5.99, therefore there is enough evidence to reject the null
hypothesis.








o Samples of four different cereals show the following numbers of calories for the
suggested servings of each brand. At = 0.05, is there a difference in the number of
calories for the different brands?


Brand A Brand B Brand C Brand D
112 110 109 106
120 118 116 122
135 123 125 130
125 128 130 117
108 102 128 116
121 101 132 114

Вам также может понравиться