Basic Business Statistics
10 th Edition
Chapter 12
Chi-Square Tests and
Nonparametric Tests
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-1
Learning Objectives
In this chapter, you learn:
How and when to use the chi-square test for contingency tables
How to use the Marascuilo procedure for determining pairwise differences when evaluating more than two proportions
How to use the chi-square test to evaluate the goodness of fit of a set of data to a specific probability distribution
How and when to use nonparametric tests
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-2
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 cross-classification table .
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-3
Contingency Table Example
Left-Handed vs. Gender
Dominant Hand: Left vs. Right
Gender: Male vs. Female
2 categories for each variable, so called a 2 x 2 table
Suppose we examine a sample of size 300
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-4
Contingency Table Example
(continued)
Sample results organized in a contingency table: sample size = n = 300:
120 Females, 12 were left handed
180 Males, 24 were left handed
Gender
Female
Male
Hand Preference
Left Right
12 108
24
36
156
264
120
180
300
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-5
2 Test for the Difference
Between Two Proportions
H
0
: π
1
= π
2
H
1
: π
1
≠ π
2
(Proportion of females who are left handed is equal to the proportion of males who are left handed)
(The two proportions are not the same –
Hand preference is not independent of gender)
If H
0 is true, then the proportion of left-handed females should be the same as the proportion of left-handed males
The two proportions above should be the same as the proportion of left-handed people overall
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-6
The Chi-Square Test Statistic
The Chi-square test statistic is:
2 all cells
( f o
f e
)
2 f e
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
(Assumed: each cell in the contingency table has expected frequency of at least 5)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-7
Decision Rule
The
2 test statistic approximately follows a chisquared distribution with one degree of freedom
Decision Rule:
If
2 >
2
U
, reject H
0
, otherwise, do not reject H
0
0
Do not reject H
0
2
U
Reject H
0
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
2
Chap 12-8
Computing the
Average Proportion
The average proportion is: p
X
1 n
1
X
2
n
2
X n
120 Females, 12 were left handed
180 Males, 24 were left handed
Here: p
12
24
120
180
36
300
0 .
12 i.e., the proportion of left handers overall is 0.12, that is, 12%
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-9
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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-10
Observed vs. Expected
Frequencies
Gender
Female
Male
Hand Preference
Left
Observed = 12
Expected = 14.4
Right
Observed = 108
Expected = 105.6
Observed = 24
Expected = 21.6
Observed = 156
Expected = 158.4
36 264
120
180
300
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-11
The Chi-Square Test Statistic
Gender
Female
Male
Hand Preference
Left
Observed = 12
Expected = 14.4
Observed = 24
Expected = 21.6
Right
Observed = 108
Expected = 105.6
Observed = 156
Expected = 158.4
120
180
36 264 300
The test statistic is:
χ 2
all cells
(f o
f e
) 2 f e
(12
14.4) 2
14.4
(108
105.6) 2
105.6
(24
21.6)
21.6
2
(156
158.4) 2
158.4
0.7576
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-12
Decision Rule
The test statistic is χ 2
0.7576
, χ
U
2 with 1 d.f.
3.841
0
Do not reject H
0
Reject H
0
2
U
=3.841
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Decision Rule:
If
2 > 3.841, reject H
0
, otherwise, do not reject H
0
2
Here,
2 = 0.7576 <
2
U
= 3.841, so we do not reject H
0 and conclude that there is not sufficient evidence that the two proportions are different at
= 0.05
Chap 12-13
2 Test for 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)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-14
The Chi-Square Test Statistic
The Chi-square test statistic is:
2 all cells
( f o
f e
)
2 f e
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 (2-1)(c-1) = c - 1 degrees of freedom
(Assumed: each cell in the contingency table has expected frequency of at least 1)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-15
Computing the
Overall Proportion
The overall proportion is: p
X
1 n
1
X
2
n
2
X c
n c
X n
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 chi-squared distribution with c – 1 degrees of freedom
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-16
The Marascuilo Procedure
Used when the null hypothesis of equal proportions is rejected
Enables you to make comparisons between all pairs
Start with the observed differences, p all pairs (for j ≠ j ’ ) . . .
j
– p j ’
, for
. . .then compare the absolute difference to a calculated critical range
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-17
The Marascuilo Procedure
(continued)
Critical Range for the Marascuilo Procedure:
Critical range
χ 2
U p j
(1
p j
) n j
p j '
(1
p j '
) n j '
(Note: the critical range is different for each pairwise comparison)
A particular pair of proportions is significantly different if
| p j
– p j ’
| > critical range for j and j ’
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-18
Marascuilo Procedure Example
A University is thinking of switching to a trimester academic calendar. A random sample of 100 administrators, 50 students, and 50 faculty members were surveyed
Opinion Administrators Students Faculty
Favor 63 20 37
Oppose
Totals
37
100
30
50
13
50
Using a 1% level of significance, which groups have a different attitude?
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-19
Marascuilo Procedure: Solution
Excel Output: compare
Marascuilo Procedure
Sample Sample Absolute Std. Error Critical
Group Proportion Size Comparison Difference of Difference Range Results
1
2
3
0.63
0.4
0.74
100
50
50
1 to 2
1 to 3
2 to 3
0.23
0.11
0.34
0.08444525
0.07860662
0.09299462
0.256 Means are not different
0.239 Means are not different
0.282 Means are different
Level of significance d.f
Q Statistic
0.01
2
Other Data
Chi-sq Critical Value in attitude between students and faculty
9.21
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-20
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)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-21
2 Test of Independence
(continued)
The Chi-square test statistic is:
2 all cells
( f o
f e
)
2 f e
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 (r-1)(c-1) degrees of freedom
(Assumed: each cell in the contingency table has expected frequency of at least 1)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-22
Expected Cell Frequencies
Expected cell frequencies: f e
row total
column total n
Where: row total = sum of all frequencies in the row column total = sum of all frequencies in the column n = overall sample size
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-23
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 chi-squared distribution with (r – 1)(c – 1) degrees of freedom
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-24
Example
The meal plan selected by 200 students is shown below:
Class
Standing
Fresh.
Number of meals per week
20/week 10/week none
24 32 14
Soph.
Junior
22
10
26
14
12
6
Senior
Total
14
70
16
88
10
42
Total
70
60
30
40
200
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-25
Example
(continued)
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)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-26
Example:
Expected Cell Frequencies
Class
Standing
Fresh.
Soph.
Junior
Senior
Total
Observed:
Number of meals per week
20/wk 10/wk none
24
22
32
26
14
12
10
14
70
14
16
88
6
10
42
Example for one cell: f e
row total
column total n
30
70
10 .
5
200
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Total
70
60
30
40
200
(continued)
Class
Standing
Fresh.
Soph.
Junior
Senior
Total
Expected cell frequencies if H
0 is true:
Number of meals per week
20/wk 10/wk none
24.5
30.8
14.7
21.0
26.4
12.6
10.5
13.2
6.3
14.0
17.6
8.4
70 88 42
Total
70
60
30
40
200
Chap 12-27
Example: The Test Statistic
(continued)
The test statistic value is:
2 all cells
( f o
f e
)
2 f e
( 24
24 .
5 )
2
24 .
5
( 32
30 .
8 )
2
30 .
8
( 10
8 .
4 )
2
8 .
4
0 .
709
2
U
= 12.592 for
= 0.05 from the chi-squared distribution with (4 – 1)(3 – 1) = 6 degrees of freedom
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-28
Example:
Decision and Interpretation
(continued)
The test statistic is
2
0 .
709 ,
2
U
with 6 d.f.
12.592
Decision Rule:
If
2 > 12.592, reject H
0
, otherwise, do not reject H
0
0
Do not reject H
0
Reject H
0
2
U
=12.592
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
2
Here,
2 = 0.709 <
2
U
= 12.592, so do not reject H
0
Conclusion: there is not sufficient evidence that meal plan and class standing are related at
= 0.05
Chap 12-29
McNemar Test (Related Samples)
Used to determine if there is a difference between proportions of two related samples
Uses a test statistic the follows the normal distribution
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-30
McNemar Test (Related Samples)
(continued)
Consider a 2 X 2 contingency table:
Condition 2
Condition 1 Yes
Yes A
No C
Totals A+C
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
No
B
D
B+D
Totals
A+B
C+D n
Chap 12-31
McNemar Test (Related Samples)
(continued)
The sample proportions of interest are p
1
A
B
proportion of respondent s who answer yes to condition 1 n p
2
A
C
proportion of respondent s who answer yes to condition 2 n
Test H
0
: π
1
= π
2
(the two population proportions are equal)
H
1
: π
1
≠ π
2
(the two population proportions are not equal)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-32
McNemar Test (Related Samples)
(continued)
The test statistic for the McNemar test:
Z
B
C
B
C where the test statistic Z is approximately normally distributed
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-33
Chi-Square Test for a Variance or
Standard Deviation
A χ 2 test statistic is used to test whether or not the population variance or standard deviation is equal to a specified value:
χ 2
(n 1)S
2
σ 2
Where n = sample size
S 2 = sample variance
σ 2 = hypothesized population variance
χ 2 follows a chi-square distribution with n – 1 d.f.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-34
Chi-Square Goodness-of-Fit Test
Does sample data conform to a hypothesized distribution?
Examples:
Are technical support calls equal across all days of the week? (i.e., do calls follow a uniform distribution?)
Do measurements from a production process follow a normal distribution?
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-35
Chi-Square Goodness-of-Fit Test
(continued)
Are technical support calls equal across all days of the week? (i.e., do calls follow a uniform distribution?)
Sample data for 10 days per day of week:
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Sum of calls for this day:
290
250
238
257
265
230
192
= 1722
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-36
Logic of Goodness-of-Fit Test
If calls are uniformly distributed, the 1722 calls would be expected to be equally divided across the 7 days:
1722
246 expected calls per day if uniform
7
Chi-Square Goodness-of-Fit Test: test to see if the sample results are consistent with the expected results
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-37
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
TOTAL
Observed vs. Expected
Frequencies
Observed f o
290
250
238
257
265
230
192
1722
Expected f e
246
246
246
246
246
246
246
1722
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-38
Chi-Square Test Statistic
H
0
: The distribution of calls is uniform over days of the week
H
1
: The distribution of calls is not uniform
The test statistic is
2 k
(f o
f e
)
2
(where df f e
k
p
1) where: k = number of categories f o f e
= observed frequency
= expected frequency p = number of parameters estimated from the data
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-39
The Rejection Region
H
0
: The distribution of calls is uniform over days of the week
H
1
: The distribution of calls is not uniform
Reject H
0 if
2 k
(f o
f e
)
2 f e
2 2
α
k – 2 degrees of freedom, since p = 1 here (the mean was estimated)
0
Do not reject H
0
2
Reject H
0
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
2
Chap 12-40
Chi-Square Test Statistic
H
0
: The distribution of calls is uniform over days of the week
H
1
: The distribution of calls is not uniform
2
(290
246)
2
246
(250
246)
2
246
...
(192
246)
2
246
23.05
k – 2 = 5 (k = 7 days of the week) so use 5 degrees of freedom:
2
.05
= 11.0705
= .05
Conclusion:
2 = 23.05 >
2
reject H
0
= 11.0705 so and conclude that the distribution is not uniform
0
Do not reject H
0
Reject H
0
2
.05
= 11.0705
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
2
Chap 12-41
Normal Distribution Example
Do measurements from a production process follow a normal distribution with
μ = 50 and σ = 15?
Process:
Get sample data
Group sample results into classes (cells)
(Expected cell frequency must be at least
5 for each cell)
Compare actual cell frequencies with expected cell frequencies
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-42
Normal Distribution Example
(continued)
Sample data and values grouped into classes:
150 Sample
Measurements
80
65
36
66
50
38
57
77
59
…etc…
Class less than 30
30 but < 40
40 but < 50
50 but < 60
60 but < 70
70 but < 80
80 but < 90
90 or over
TOTAL
Frequency
10
21
33
41
26
10
7
2
150
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-43
Normal Distribution Example
(continued)
What are the expected frequencies for these classes for a normal distribution with μ = 50 and σ = 15?
Expected
Frequency Class less than 30
30 but < 40
40 but < 50
50 but < 60
60 but < 70
70 but < 80
80 but < 90
90 or over
TOTAL
Frequency
10
21
33
41
26
10
7
2
150
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
?
Chap 12-44
Expected Frequencies
Value less than 30
30 but < 40
40 but < 50
50 but < 60
60 but < 70
70 but < 80
80 but < 90
90 or over
TOTAL
P(X < value)
0.09121
0.16128
0.24751
0.24751
0.16128
0.06846
0.01892
0.00383
1.00000
Expected frequency
13.68
24.19
37.13
37.13
24.19
10.27
2.84
0.57
150.00
Combine class groups so no class has expected frequency <1
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Expected frequencies in a sample of size n=150 , from a normal distribution with
μ=50, σ=15
Example:
P(x
30)
P
z
30
50
15
P(z
1.3333)
.0912
(.0912)(15 0)
13.68
Chap 12-45
The Test Statistic
Class less than 30
30 but < 40
40 but < 50
50 but < 60
60 but < 70
70 but < 80
80 or over
Frequency
(observed, f o
)
10
21
33
41
26
10
9
Expected
Frequency, f e
13.68
24.19
37.13
37.13
24.19
10.27
3.41
TOTAL 150
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
150.00
The test statistic is
2 k
(f o
f e
)
2 f e
Reject H
0
2 2
α if
(with k – p – 1 degrees of freedom)
Chap 12-46
The Rejection Region
H
0
: The distribution of values is normal with μ = 50 and σ = 15
H
1
: The distribution of calls does not have this distribution
χ 2 k
(f o
f e
)
2 f e
(10
13.68)
2
13.68
...
(9
3.41)
2
3.41
11.580
8 classes so use 8 – 2 – 1 = 5 d.f.:
2
.05
= 11.0705
=.05
Conclusion:
2 = 11.580 >
2
= 11.0705 so reject H
0
:
There is sufficient evidence that the data are not normal with μ = 50 and σ = 15
0
Do not reject H
0
Reject H
0
2
.05
= 11.0705
2
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-47
Wilcoxon Rank-Sum Test for
Differences in 2 Medians
Test two independent population medians
Populations need not be normally distributed
Distribution free procedure
Used when only rank data are available
Must use normal approximation if either of the sample sizes is larger than 10
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-48
Wilcoxon Rank-Sum Test:
Small Samples
Can use when both n
1
, n
2
≤ 10
Assign ranks to the combined n
1 observations
+ n
2 sample
If unequal sample sizes, let n
1 sample refer to smaller-sized
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)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-49
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
T
1
T
2
n(n
1)
2 where n = n
1
+ n
2
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-50
Wilcoxon Rank-Sum Test:
Hypothesis and Decision Rule
M
1
= median of population 1; M
2
= median of population 2
Test statistic = T
1
(Sum of ranks from smaller sample)
Two-Tail Test
H
0
: M
1
H
1
: M
1
= M
2
M
2
Left-Tail Test
H
H
0
1
: M
: M
1
1
M
2
M
2
Right-Tail Test
H
0
H
1
: M
: M
1
1
M
2
M
2
Reject Do Not
Reject
T
1L
Reject
T
1U
Reject H
0 if T
1
< T
1L or if T
1
> T
1U
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Reject
T
1L
Do Not Reject
Reject H
0 if T
1
< T
1L
Do Not Reject Reject
T
1U
Reject H
0 if T
1
> T
1U
Chap 12-51
Wilcoxon Rank-Sum Test:
Small Sample Example
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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-52
Wilcoxon Rank-Sum Test:
Small Sample Example
(continued)
Ranked
Capacity values:
Tie in 3 rd and
4 th places
Capacity Rank
Factory A Factory B Factory A Factory B
71
77
82
1
2
3.5
82
85
3.5
5
88 6
92 7
94 8
97
Rank Sums: 20.5
9
24.5
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-53
Wilcoxon Rank-Sum Test:
Small Sample Example
(continued)
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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-54
Lower and
Upper
Critical
Values for
T
1 from
Appendix table E.8:
Wilcoxon Rank-Sum Test:
Small Sample Example
(continued)
n
1 n
2
4
5
One-
Tailed
.05
.025
.01
Two-
Tailed
4 5
.10
12, 28 19, 36
.05
11, 29 17, 38
.02
10, 30 16, 39
.005
.01
--, -15, 40
6
T
1L
= 11 and T
1U
= 29
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-55
Wilcoxon Rank-Sum Test:
Small Sample Solution
(continued)
= .05
n
1
= 4 , n
2
= 5
Two-Tail Test
H
0
: M
1
H
1
: M
1
= M
2
M
2
Test Statistic (Sum of ranks from smaller sample):
T
1
= 24.5
Decision:
Do not reject at
= 0.05
Reject Do Not
Reject
Reject
T
1L
=11 T
1U
=29
Reject H
0 if T
1
< T
1L
=11 or if T
1
> T
1U
=29
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Conclusion:
There is not enough evidence to prove that the medians are not equal.
Chap 12-56
Wilcoxon Rank-Sum Test
(Large Sample)
For large samples, the test statistic T
1 is approximately normal with mean and
T
1
T
1
μ
T
1
n
1
( n
1 )
2
σ
T
1
n
1 n
2
( n
1 )
12
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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-57
Wilcoxon Rank-Sum Test
(Large Sample)
(continued)
The Z test statistic is
Z
T
1
μ
T
1
σ
T
1
T
1
n
1
(n
n
1 n
2
(n
2
1)
1)
12
Where Z approximately follows a standardized normal distribution
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-58
Wilcoxon Rank-Sum Test:
Normal Approximation Example
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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-59
Wilcoxon Rank-Sum Test:
Normal Approximation Example
(continued)
μ
T
1
n
1
( n
1 )
2
4 ( 9
1 )
20
2
σ
T
1
n
1 n
2
( n
1 )
12
4 ( 5 ) ( 9
1 )
2 .
739
12
The test statistic is
Z
T
1
μ
T
1
σ
T
1
24 .
5
20
2.739
1 .
64
Z = 1.64 is not greater than the critical Z value of 1.96
(for α = .05) so we do not reject H
0
– there is not sufficient evidence that the medians are not equal
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-60
Wilcoxon Signed Ranks Test
A nonparametric test for two related populations
2.
3.
4.
Steps:
1.
5.
6.
For each of n sample items, compute the difference,
D i
, between two measurements
Ignore + and – signs and find the absolute values, |D i
|
Omit zero differences, so sample size is n ’
Assign ranks R i ties) from 1 to n ’ (give average rank to
Reassign + and – signs to the ranks R i
Compute the Wilcoxon test statistic W as the sum of the positive ranks
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-61
Wilcoxon Signed Ranks
Test Statistic
The Wilcoxon signed ranks test statistic is the sum of the positive ranks:
W
i n'
1
R ( i
)
For small samples (n ’ < 20), use Table E.9 for the critical value of W
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-62
Wilcoxon Signed Ranks
Test Statistic
For samples of n ’ > 20, W is approximately normally distributed with
μ
W
n' (n'
1)
4
σ
W
n' (n'
1)(2n'
1)
24
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-63
Wilcoxon Signed Ranks Test
The large sample Wilcoxon signed ranks Z test statistic is
Z
W n' (n'
n' (n'
4
1)(2n'
1)
1)
24
The appropriate hypothesis test is
H
0
: M
D
≤ 0
H
1
: M
D
> 0
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-64
Kruskal-Wallis 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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-65
Kruskal-Wallis Test Procedure
Obtain relative 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
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-66
Kruskal-Wallis Test Procedure
(continued)
The Kruskal-Wallis H-test statistic:
(with c – 1 degrees of freedom)
H
12 n ( n
1 ) c j
1
T j
2 n j
3 ( n
1 ) where: n = sum of sample sizes in all samples c = Number of samples
T n j j
= Sum of ranks in the j th sample
= Number of values in the j th sample (j = 1, 2, … , c)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-67
Kruskal-Wallis Test Procedure
(continued)
Complete the test by comparing the calculated H value to a critical
2 value from the chi-square distribution with c – 1 degrees of freedom
0
Do not reject H
0
2
U
Reject H
0
2
Decision rule
Reject H
0 if test statistic H >
2
U
Otherwise do not reject H
0
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-68
Kruskal-Wallis Example
Do different departments have different class sizes?
Class size
(Math, M)
23
45
54
78
66
Class size
(English, E)
55
60
72
45
70
Class size
(Biology, B)
30
40
18
34
44
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-69
Kruskal-Wallis Example
(continued)
Do different departments have different class sizes?
Class size
(Math, M)
Ranking
23
41
54
78
66
2
6
9
15
12
= 44
Class size
(English, E)
55
60
72
45
70
Ranking
10
11
14
8
13
= 56
Class size
(Biology, B)
30
40
18
34
44
Ranking
3
5
1
4
7
= 20
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-70
Kruskal-Wallis Example
(continued)
H
0
: Median
M
Median
E
Median
B
H
1
: Not all population Medians are equal
The H statistic is
H
12 n(n
1) c j
1
T j
2 n j
3(n
1)
12
15(15
1)
44 2
5
56 2
5
20 2
5
3(15
1)
6.72
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-71
Kruskal-Wallis Example
(continued)
Compare H = 6.72 to the critical value from the chi-square distribution for 3 – 1 = 2 degrees of freedom and
= 0.05:
χ
U
2
5.991
Since H = 6.72 >
U
2
5.991
, reject H
0
There is sufficient evidence to reject that the population medians are all equal
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-72
Friedman Rank Test
Use the Friedman rank test to determine whether c groups (i.e., treatment levels) have been selected from populations having equal medians
H
0
: M
.1
= M
.2
= . . . = M
.c
H
1
: Not all M
.j
are equal (j = 1, 2, …, c)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-73
Friedman Rank Test
(continued)
Friedman rank test for differences among c medians:
F
R
rc(c
12
1) c j
1
R
.j
2
3r(c
1)
R
.j
r = the number of blocks c = the number of groups
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-74
Friedman Rank Test
(continued)
The Friedman rank test statistic is approximated by a chi-square distribution with c – 1 d.f.
Reject H
0 if F
R
U
2
Otherwise do not reject H
0
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-75
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 Wilcoxon rank sum test for two population medians
Small Samples
Large sample Z approximation
Applied the Kruskal-Wallis H-test for multiple population medians
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.
Chap 12-76