This action might not be possible to undo. Are you sure you want to continue?
Chap 121
Statistics for Managers
Using Microsoft® Excel
5th Edition
Chapter 12
Chi Square Tests and Nonparametric
Tests
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 122
Learning Objectives
In this chapter, you learn:
How and when to use the chisquare test for
contingency tables
How to use the Marascuilo procedure for
determining pairwise differences when
evaluating more than two proportions
How and when to use the McNemar test
How and when to use nonparametric tests
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 123
Contingency Tables
Contingency Tables
Useful in situations involving multiple
population proportions
Used to classify sample observations
according to two or more characteristics
Also called a crossclassification table.
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 124
Contingency Table Example
Hand Preference vs. Gender
Dominant Hand: Left vs. Right
Gender: Male vs. Female
2 categories for each variable, so the
table is called a 2 x 2 table
Suppose we examine a sample of
300 college students
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 125
Contingency Table Example
Sample results organized in a contingency table:
Hand
Preference
Gender
Female Male
Left 12 24 36
Right 108 156 264
120 180 300
120 Females, 12 were
left handed
180 Males, 24 were
left handed
sample size = n = 300:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 126
Contingency Table Example
If H
0
is true, then the proportion of lefthanded females
should be the same as the proportion of lefthanded males.
The two proportions above should be the same as the
proportion of lefthanded people overall.
H
0
: π
1
= π
2
(Proportion of females who are left
handed is equal to the proportion of
males who are left handed)
H
1
: π
1
≠ π
2
(The two proportions are not the same –
Hand preference is not independent
of gender)
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 127
The ChiSquare Test Statistic
where:
f
o
= observed frequency in a particular cell
f
e
= expected frequency in a particular cell if H
0
is true
;
2
for the 2 x 2 case has 1 degree of freedom
¯
÷
=
cells all
e
2
e o
2
f
) f (f
χ
The Chisquare test statistic is:
Assumed: each cell in the contingency table has
expected frequency of at least 5
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 128
The ChiSquare Test Statistic
Decision Rule:
If ;
2
> ;
2
U
, reject H
0
,
otherwise, do not reject
H
0
The ;
2
test statistic approximately follows a chisquare
distribution with one degree of freedom
;
2
;
2
U
0
o
Reject H
0
Do not
reject H
0
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 129
Computing the
Average Proportion
Here: 120 Females, 12 were
left handed
180 Males, 24 were
left handed
The proportion of left handers overall is 0.12, that is, 12%
n
X
n n
X X
p =
+
+
=
2 1
2 1
12 . 0
300
36
180 120
24 12
p = =
+
+
=
The average
proportion is:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1210
Finding Expected Frequencies
To obtain the expected frequency for left handed females,
multiply the average proportion left handed (p) by the total
number of females
To obtain the expected frequency for left handed males,
multiply the average proportion left handed (p) by the total
number of males
If the two proportions are equal, then
P(Left Handed  Female) = P(Left Handed  Male) = .12
i.e., we would expect (.12)(120) = 14.4 females to be left handed
(.12)(180) = 21.6 males to be left handed
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1211
Observed vs. Expected
Frequencies
Hand
Preference
Gender
Female Male
Left
Observed = 12
Expected = 14.4
Observed = 24
Expected = 21.6
36
Right
Observed = 108
Expected = 105.6
Observed = 156
Expected = 158.4
264
120 180 300
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1212
The ChiSquare Test Statistic
Hand
Preference
Gender
Female Male
Left
Observed = 12
Expected = 14.4
Observed = 24
Expected = 21.6
36
Right
Observed = 108
Expected = 105.6
Observed = 156
Expected = 158.4
264
120 180 300
7576 . 0
4 . 158
) 4 . 158 156 (
6 . 21
) 6 . 21 24 (
6 . 105
) 6 . 105 108 (
4 . 14
) 4 . 14 12 (
) (
2 2 2 2
cells all
2
2
=
÷
+
÷
+
÷
+
÷
=
÷
=
¯
e
e o
f
f f
;
The test statistic is:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1213
The ChiSquare Test Statistic
Decision Rule:
If ;
2
> 3.841, reject H
0
, otherwise, do
not reject H
0
3.841 d.f. 1 with , 7576 . 0 is statistic test The
2 2
= =
U
; ;
Here,
;
2
= 0..7576 < ;
2
U
= 3.841,
so you do not reject H
0
and
conclude that there is
insufficient evidence that the
two proportions are different.
;
2
;
2
U
=3.841
0
o=.05
Reject H
0
Do not
reject H
0
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1214
;
2
Test for The Differences Among
More Than Two Proportions
Extend the ;
2
test to the case with more than two
independent populations:
H
0
: π
1
= π
2
= … = π
c
H
1
: Not all of the π
j
are equal (j = 1, 2, …, c)
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1215
The ChiSquare Test Statistic
where:
f
o
= observed frequency in a particular cell of the 2 x c table
f
e
= expected frequency in a particular cell if H
0
is true
;
2
for the 2 x c case has (21)(c1) = c  1 degrees of freedom
Assumed: each cell in the contingency table has expected frequency of
at least 1
¯
÷
=
cells all
2
2
) (
e
e o
f
f f
;
The Chisquare test statistic is:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1216
Computing the
Overall Proportion
n
X
n n n
X X X
p
c
c
=
+ + +
+ + +
=
...
...
2 1
2 1
The overall
proportion is:
Expected cell frequencies for the c categories are
calculated as in the 2 x 2 case, and the decision rule
is the same:
Decision Rule:
If ;
2
> ;
2
U
, reject H
0
,
otherwise, do not
reject H
0
Where ;
2
U
is from the
chisquare distribution
with c – 1 degrees of
freedom
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1217
;
2
Test with More Than Two
Proportions: Example
The sharing of patient records is a
controversial issue in health care. A survey
of 500 respondents asked whether they
objected to their records being shared by
insurance companies, by pharmacies, and by
medical researchers. The results are
summarized on the following table:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1218
;
2
Test with More Than Two
Proportions: Example
Object to
Record
Sharing
Organization
Insurance
Companies
Pharmacies Medical
Researchers
Yes 410 295 335
No 90 205 165
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1219
;
2
Test with More Than Two
Proportions: Example
6933 . 0
500 500 500
335 295 410
...
...
2 1
2 1
=
+ +
+ +
=
+ + +
+ + +
=
c
c
n n n
X X X
p
The overall
proportion is:
Object to
Record
Sharing
Organization
Insurance
Companies
Pharmacies Medical
Researchers
Yes f
o
= 410
f
e
= 346.667
f
o
= 295
f
e
= 346.667
f
o
= 335
f
e
= 346.667
No f
o
= 90
f
e
= 153.333
f
o
= 205
f
e
= 153.333
f
o
= 165
f
e
= 153.333
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1220
;
2
Test with More Than Two
Proportions: Example
Object
to
Record
Sharing
Organization
Insurance
Companies
Pharmacies Medical
Researchers
Yes
No
( )
700 . 7
2
=
÷
e
e o
f
f f
( )
159 . 26
2
=
÷
e
e o
f
f f
( )
571 . 11
2
=
÷
e
e o
f
f f
( )
3926 . 0
2
=
÷
e
e o
f
f f
( )
409 . 17
2
=
÷
e
e o
f
f f ( )
888 . 0
2
=
÷
e
e o
f
f f
1196 . 64
) (
cells all
2
2
=
÷
=
¯
e
e o
f
f f
;
The Chisquare test statistic is:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1221
;
2
Test with More Than Two
Proportions: Example
Decision Rule:
If ;
2
> ;
2
U
, reject H
0
,
otherwise, do not reject H
0
;
2
U
= 5.991 is from the chi
square distribution with 2
degrees of freedom.
H
0
: π
1
= π
2
= π
3
H
1
: Not all of the π
j
are equal (j = 1, 2, 3)
Conclusion: Since 64.1196 > 5.991, you reject H
0
and you
conclude that at least one proportion of respondents who object to
their records being shared is different across the three
organizations
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1222
The Marascuilo Procedure
The Marascuilo procedure enables you to
make comparisons between all pairs of
groups.
First, compute the observed differences p
j
 p
j’
among all c(c1)/2 pairs.
Second, compute the corresponding critical
range for the Marascuilo procedure.
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1223
The Marascuilo Procedure
Critical Range for the Marascuilo Procedure:
/
/ /
) 1 (
) 1 (
Range Critical
2
j
j j
j
j j
U
n
p p
n
p p
÷
+
÷
= ;
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1224
The Marascuilo Procedure
Compute a different critical range for each
pairwise comparison of sample proportions.
Compare each of the c(c  1)/2 pairs of
sample proportions against its corresponding
critical range.
Declare a specific pair significantly different
if the absolute difference in the sample
proportions p
j
– p
j’
 is greater than its critical
range.
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1225
The Marascuilo Procedure
Example
Object to
Record
Sharing
Organization
Insurance
Companies
Pharmacies Medical
Researchers
Yes 410
P
1
= 0.82
295
P
2
= 0.59
335
P
3
= 0.67
No 90 205 165
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1226
The Marascuilo Procedure
Example
MARASCUILO TABLE
Proportions
Absolute
Differences Critical Range
 Group 1  Group 2  0.23 0.06831808
 Group 1  Group 3  0.15 0.0664689
 Group 2  Group 3  0.08 0.074485617
Conclusion: Since each absolute difference is greater
than the critical range, you conclude that each
proportion is significantly different that the other two.
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1227
;
2
Test of Independence
Similar to the ;
2
test for equality of more than two
proportions, but extends the concept to contingency
tables with r rows and c columns
H
0
: The two categorical variables are independent
(i.e., there is no relationship between them)
H
1
: The two categorical variables are dependent
(i.e., there is a relationship between them)
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1228
;
2
Test of Independence
where:
f
o
= observed frequency in a particular cell of the r x c table
f
e
= expected frequency in a particular cell if H
0
is true
;
2
for the r x c case has (r1)(c1) degrees of freedom
Assumed: each cell in the contingency table has expected
frequency of at least 1)
¯
÷
= ;
cells all
e
2
e o
2
f
) f f (
The Chisquare test statistic is:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1229
Expected Cell Frequencies
Expected cell frequencies:
n
al column tot total row ×
=
e
f
Where:
row total = sum of all frequencies in the row
column total = sum of all frequencies in the column
n = overall sample size
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1230
Decision Rule
The decision rule is
If ;
2
> ;
2
U
, reject H
0
,
otherwise, do not reject H
0
Where ;
2
U
is from the chisquare distribution with
(r – 1)(c – 1) degrees of freedom
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1231
Example: Test of Independence
The meal plan selected by 200 students is shown below:
Class
Standing
Number of meals per week
Total
20/week 10/week none
Fresh. 24 32 14 70
Soph. 22 26 12 60
Junior 10 14 6 30
Senior 14 16 10 40
Total 70 88 42 200
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1232
Example: Test of Independence
The hypothesis to be tested is:
H
0
: Meal plan and class standing are independent
(i.e., there is no relationship between them)
H
1
: Meal plan and class standing are dependent
(i.e., there is a relationship between them)
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1233
Example: Test of Independence
Class
Standing
Number of meals
per week
Total 20/wk 10/wk none
Fresh. 24.5 30.8 14.7 70
Soph. 21.0 26.4 12.6 60
Junior 10.5 13.2 6.3 30
Senior 14.0 17.6 8.4 40
Total 70 88 42 200
Expected cell frequencies
if H
0
is true:
5 . 10
200
70 30
al column tot x total row
f
e
=
×
=
=
n
Example for one cell:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1234
Example: Test of Independence
The test statistic value is:
709 . 0
4 . 8
) 4 . 8 10 (
8 . 30
) 8 . 30 32 (
5 . 24
) 5 . 24 24 (
) (
2 2 2
cells
2
2
=
÷
+ +
÷
+
÷
=
÷
=
¯
all
e
e o
f
f f
;
;
2
U
= 12.592 for α = .05 from the chisquare
distribution with (4 – 1)(3 – 1) = 6 degrees of
freedom
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1235
Example: Test of
Independence
Decision Rule:
If ;
2
> 12.592, reject H
0
, otherwise,
do not reject H
0
12.592 d.f. 6 with , 709 . 0 is statistic test The
2
U
2
= ; = ;
Here,
;
2
= 0.709 < ;
2
U
= 12.592,
so do not reject H
0
Conclusion: there is
insufficient evidence that meal
plan and class standing are
related.
;
2
;
2
U
=12.592
0
o=0.05
Reject H
0
Do not
reject H
0
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1236
McNemar Test
Used to test for the difference between two
proportions of related samples (not
independent)
You need to use a test statistic that follows
the normal distribution
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1237
McNemar Test
Contingency Table
Condition (Group) 1
Condition (Group) 2
Yes No Totals
Yes A B A+B
No C D C+D
Totals A+C B+D n
Where A = number of respondents who answered yes to condition 1 and condition 2
B = number of respondents who answered yes to condition 1 and no to 2
C = number of respondents who answered no to condition 1 and yes to 2
D = number of respondents who answered no to condition 1 and condition 2
n = number of respondents in the sample
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1238
McNemar Test
Contingency Table
The sample proportions are:
Condition (Group) 1
Condition (Group) 2
Yes No Totals
Yes A B A+B
No C D C+D
Totals A+C B+D n
n
C A
p
n
B A
p
+
=
+
=
2 1
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1239
McNemar Test
Contingency Table
The population proportions are:
π
1
= proportion of the population who answer yes to condition 1
π
2
= proportion of the population who answer yes to condition 2
Condition (Group) 1
Condition (Group) 2
Yes No Totals
Yes A B A+B
No C D C+D
Totals A+C B+D n
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1240
McNemar Test
Test Statistic
To test the hypothesis:
H
0
: π
1
= π
2
H
1
: π
1
≠ π
2
Use the test statistic:
C B
C B
Z
+
÷
=
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1241
McNemar Test
Example
Suppose you survey 300 homeowners and ask
them if they are interested in refinancing their
home. In an effort to generate business, a
mortgage company improved their loan terms and
reduced closing costs. The same homeowners
were again surveyed. Determine if change in loan
terms was effective in generating business for the
mortgage company. The data are summarized as
follows:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1242
McNemar Test
Example
Survey response
before change
Survey response after change
Yes No Totals
Yes 118 2 120
No 22 158 180
Totals 140 160 300
Test the hypothesis (at the 0.05 level of significance):
H
0
: π
1
≥ π
2
: The change in loan terms was ineffective
H
1
: π
1
< π
2
: The change in loan terms increased business
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1243
McNemar Test
Example
Survey
response
before change
Survey response after
change
Yes No Totals
Yes 118 2 120
No 22 158 180
Totals 140 160 300
The critical value (.05
significance) is Z = 1.96
The test statistic is:
08 . 4
22 2
22 2
÷ =
+
÷
=
+
÷
=
C B
C B
Z
Since Z = 4.08 < 1.96, you reject H
0
and conclude that the
change in loan terms significantly increase business for the
mortgage company.
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1244
Wilcoxon RankSum Test
Test two independent population medians
Populations need not be normally distributed
Distribution free procedure
Used when only rank data are available
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1245
Wilcoxon RankSum Test
Can use when both n
1
, n
2
≤ 10
Assign ranks to the combined n
1
+ n
2
sample values
If unequal sample sizes, let n
1
refer to smallersized
sample
Smallest value rank = 1, largest value rank = n
1
+ n
2
Assign average rank for ties
Sum the ranks for each sample: T
1
and T
2
Obtain test statistic, T
1
(from smaller sample)
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1246
Checking the Rankings
The sum of the rankings must satisfy the formula
below
Can use this to verify the sums T
1
and T
2
2
1) n(n
2 1
+
= +T T
where n = n
1
+ n
2
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1247
Wilcoxon RankSum Test
Hypothesis and Decision
H
0
: M
1
= M
2
H
1
: M
1
≠ M
2
H
0
: M
1
≤ M
2
H
1
: M
1
> M
2
H
0
: M
1
≥ M
2
H
1
: M
1
< M
2
TwoTail Test LeftTail Test RightTail Test
M
1
= median of population 1; M
2
= median of population 2
Reject
T
1L
T
1U
Reject
Do Not
Reject
Reject
T
1L
Do Not Reject
T
1U
Reject Do Not Reject
Test statistic = T
1
(Sum of ranks from smaller sample)
Reject H
0
if T
1
≤ T
1L
or if T
1
≥ T
1U
Reject H
0
if T
1
≤ T
1L
Reject H
0
if T
1
≥ T
1U
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1248
Wilcoxon RankSum Test
Example with Small Samples
Sample data are collected on the capacity
rates (% of capacity) for two factories.
Are the median operating rates for two
factories the same?
For factory A, the rates are 71, 82, 77, 94, 88
For factory B, the rates are 85, 82, 92, 97
Test for equality of the population medians
at the 0.05 significance level
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1249
Wilcoxon RankSum Test
Example with Small Samples
Capacity Rank
Factory A Factory B Factory A Factory B
71 1
77 2
82 3.5
82 3.5
85 5
88 6
92 7
94 8
97 9
Rank Sums: 20.5 24.5
Tie in 3
rd
and
4
th
places
Ranked
Capacity
values:
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1250
Wilcoxon RankSum Test
Example with Small Samples
Factory B has the smaller sample size, so the test
statistic is the sum of the Factory B ranks:
T
1
= 24.5
The sample sizes are:
n
1
= 4 (factory B)
n
2
= 5 (factory A)
The level of significance is α = .05
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1251
Wilcoxon RankSum Test
Example with Small Samples
n
2
o n
1
One
Tailed
Two
Tailed
4 5
4
5
.05 .10 12, 28 19, 36
.025 .05 11, 29 17, 38
.01 .02 10, 30 16, 39
.005 .01 ,  15, 40
6
Lower and
Upper Critical
Values for T
1
from
Appendix
Table E.8:
T
1L
= 11 and
T
1U
= 29
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1252
Wilcoxon RankSum Test
Example with Small Samples
H
0
: M
1
= M
2
H
1
: M
1
≠ M
2
TwoTail Test
Reject
T
1L
=11 T
1U
=29
Reject
Do Not
Reject
Reject H
0
if T
1
≤ T
1L
= 11
or if T
1
≥ T
1U
= 29
o = .05
n
1
= 4 , n
2
= 5
Test Statistic (Sum of ranks
from smaller sample):
T
1
= 24.5
Decision:
Conclusion:
Do not reject at a = 0.05
There is not enough evidence to prove
that the medians are not equal.
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1253
Wilcoxon RankSum Test
Using Normal Approximation
For large samples, the test statistic T
1
is approximately normal
with mean and standard deviation:
Must use the normal approximation if either n
1
or n
2
> 10
Assign n
1
to be the smaller of the two sample sizes
Can use the normal approximation for small samples
2
) 1 n ( n
μ
1
T
1
+
=
12
) 1 n ( n n
σ
2 1
T
1
+
=
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1254
Wilcoxon RankSum Test
Using Normal Approximation
The Z test statistic is
Where Z approximately follows a standardized
normal distribution
1
1
σ
μ
Z
1
T
T
T ÷
=
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1255
Wilcoxon RankSum Test
Using Normal Approximation
Use the setting of the prior example:
The sample sizes were:
n
1
= 4 (factory B)
n
2
= 5 (factory A)
The level of significance was α = .05
The test statistic was T
1
= 24.5
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1256
Wilcoxon RankSum Test
Using Normal Approximation
The test statistic is
20
2
) 1 9 ( 4
2
) 1 n ( n
μ
1
T
1
=
+
=
+
=
082 . 4
12
) 1 9 ( ) 5 ( 4
12
) 1 (
σ
2 1
1
=
+
=
+
=
n n n
T
10 . 1
4.082
20 5 . 24
σ
μ
Z
1
1
1
=
÷
=
÷
=
T
T
T
Z = 1.10 is less than the critical Z value of 1.96 (for α =
.05) so you do not reject H
0
– there is not sufficient
evidence that the medians are not equal
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1257
KruskalWallis Rank Test
Tests the equality of more than 2 population medians
Use when the normality assumption for oneway
ANOVA is violated
Assumptions:
The samples are random and independent
variables have a continuous distribution
the data can be ranked
populations have the same variability
populations have the same shape
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1258
KruskalWallis Rank Test
Obtain overall rankings for each value
In event of tie, each of the tied values gets the
average rank
Sum the rankings for data from each of the c
groups
Compute the H test statistic
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1259
KruskalWallis Rank Test
The KruskalWallis H test statistic:
(with c – 1 degrees of freedom)
) 1 ( 3
) 1 (
12
1
2
+ ÷
+
=
¯
=
n
n
T
n n
H
c
j
j
j
where:
n = total number of values over the combined samples
c = Number of groups
T
j
= Sum of ranks in the j
th
sample
n
j
= Size of the j
th
sample
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1260
KruskalWallis Rank Test
Decision rule
Reject H
0
if test statistic H > ;
2
U
Otherwise do not reject H
0
Complete the test by comparing the calculated H value
to a critical ;
2
value from the chisquare distribution
with c – 1 degrees of freedom
;
2
;
2
U
0
o
Reject H
0
Do not
reject H
0
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1261
KruskalWallis Rank Test
Example
Do different branch offices have a different number of
employees?
Office size
(Chicago, C)
Office size
(Denver, D)
Office size
(Houston, H)
23
41
54
78
66
55
60
72
45
70
30
40
18
34
44
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1262
KruskalWallis Rank Test
Example
Do different branch offices have a different
number of employees?
Office size
(Chicago, C)
Ranking
Office size
(Denver, D)
Ranking
Class size
(Houston, H)
Ranking
23
41
54
78
66
2
6
9
15
12
55
60
72
45
70
10
11
14
8
13
30
40
18
34
44
3
5
1
4
7
E = 44 E = 56 E = 20
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1263
KruskalWallis Rank Test
Example
The H statistic is
72 . 6 ) 1 15 ( 3
5
20
5
56
5
44
) 1 15 ( 15
12
) 1 ( 3
) 1 (
12
2 2 2
1
2
= + ÷


.

\

+ +
+
=
+ ÷
+
=
¯
=
n
n
T
n n
H
c
j
j
j
equal are Medians population all Not : H
Median Median Median : H
A
H D C 0
= =
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1264
KruskalWallis Rank Test
Example
Since H = 6.72 > ,
reject H
0
5.991
2
U
= χ
Compare H = 6.72 to the critical value from the chisquare
distribution for 3 – 1 = 2 degrees of freedom and o = .05:
There is evidence of a difference in the
population median number of employees in
the branch offices
5.991
2
U
= χ
Statistics for Managers Using Microsoft Excel, 5e © 2008 PrenticeHall, Inc. Chap 1265
Chapter Summary
Developed and applied the ;
2
test for the difference between
two proportions
Developed and applied the ;
2
test for differences in more than
two proportions
Examined the ;
2
test for independence
Used the McNemar test for differences in two related
proportions
Used the Wilcoxon rank sum test for two population medians
Small Samples
Large sample Z approximation
Applied the KruskalWallis Htest for multiple population
medians
In this chapter, we have
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.