SlideShare a Scribd company logo
1 of 47
Statistics for Managers 
Using Microsoft® Excel 
4th Edition 
Chapter 11 
Chi-Square Tests and 
Nonparametric Tests 
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1
Chapter Goals 
After completing this chapter, you should be 
able to: 
 Perform a c2 test for the difference between two 
proportions 
 Use a c2 test for differences in more than two proportions 
 Perform a c2 test of independence 
 Apply and interpret the Wilcoxon rank sum test for the 
difference between two medians 
 Perform nonparametric analysis of variance using the 
Kruskal-Wallis rank test for one-way ANOVA 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-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. 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-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 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-4
Contingency Table Example 
(continued) 
Sample results organized in a contingency table: 
Gender 
Hand Preference 
Left Right 
Female 12 108 120 
Male 24 156 180 
36 264 300 
sample size = n = 300: 
120 Females, 12 
were left handed 
180 Males, 24 were 
left handed 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-5
c2 Test for the Difference 
Between Two Proportions 
H0: p1 = p2 (Proportion of females who are left 
handed is equal to the proportion of 
males who are left handed) 
H1: p1 ≠ p2 (The two proportions are not the same – 
Hand preference is not independent 
of gender) 
 If H0 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 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-6
The Chi-Square Test Statistic 
The Chi-square test statistic is: 
(f f ) 
c = å - 
2 o e 
f 
all cells e 
2 
 where: 
fo = observed frequency in a particular cell 
fe = expected frequency in a particular cell if H0 is true 
c2 for the 2 x 2 case has 1 degree of freedom 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-7 
(Assumed: each cell in the contingency table has expected 
frequency of at least 5)
Decision Rule 
c2 
The c2 test statistic approximately follows a chi-squared 
distribution with one degree of freedom 
Statistics for Managers Using 
c2 
Microsoft Excel, 4e © 2004 
U 
Prentice-Hall, Inc. Chap 11-8 
Decision Rule: 
If c2 > c2 
U, reject H0, 
otherwise, do not 
reject H0 
0 
a 
Reject H0 Do not 
reject H0
Computing the 
Average Proportion 
p = X + 
X 
1 2 = 
+ 
n n 
The average 
proportion is: 
120 Females, 12 Here: 
were left handed 
180 Males, 24 were 
left handed 
X 
n 
1 2 
0.12 
p 12 24 = 36 
= 
300 
= + 
120 + 
180 
i.e., the proportion of left handers overall is 12% 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-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 
Statistics for Managers (.Using 
12)(180) = 21.6 males to be left handed 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-10
Observed v. Expected 
Frequencies 
Observed frequencies vs. expected frequencies: 
Gender 
Hand Preference 
Left Right 
Female 
Observed = 12 
Expected = 14.4 
Observed = 108 
Expected = 105.6 
120 
Male 
Observed = 24 
Expected = 21.6 
Observed = 156 
Expected = 158.4 
180 
36 264 300 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-11
The Chi-Square Test Statistic 
Gender 
Hand Preference 
Left Right 
Female 
Observed = 12 
Expected = 14.4 
Observed = 108 
Expected = 105.6 
120 
Male 
Observed = 24 
Expected = 21.6 
Observed = 156 
Expected = 158.4 
180 
36 264 300 
The test statistic is: 
(f f ) 
c = å - 
f 
Statistics (12 for 14.4) 
Managers 2 (108 Using 
105.6) 
2 (24 21.6) 
2 (156 158.4) 
2 
Microsoft Excel, 14.4 
4e © 2004 
0.6848 
105.6 
21.6 
158.4 
Prentice-Hall, Inc. Chap 11-12 
all cells e 
2 
2 o e 
= - + - + - + - =
Decision Rule Example 
The test statistic is c2 = 0 . 6848 , c with 1 d.f. = 
3.841 2U 
Decision Rule: 
If c2 > 3.841, reject H0, 
otherwise, do not reject H0 
Here, 
c2 = 0.6848 < c2 
U = 3.841, 
so we do not reject H0 
and conclude that there is 
not sufficient evidence 
that the two proportions 
are different at a = .05 
c2 
a 
Reject H0 Do not 
reject H0 
U=3.841 
c2 
0 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-13
c2 Test for the Difference Between 
More Than Two Proportions 
 Extend the c2 test to the case with more than 
two independent populations: 
H0: p1 = p2 = … = pc 
H1: Not all of the pj are equal (j = 1, 2, …, c) 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-14
The Chi-Square Test Statistic 
The Chi-square test statistic is: 
(f f ) 
c = å - 
2 o e 
f 
all cells e 
2 
 where: 
fo = observed frequency in a particular cell of the 2 x c table 
fe = expected frequency in a particular cell if H0 is true 
c2 for the 2 x c case has (2-1)(c-1) = c - 1 degrees of freedom 
Statistics Microsoft (Assumed: for Managers each cell Using 
Excel, 4e © 2004 
in the contingency table has expected 
frequency of at least 1) 
Prentice-Hall, Inc. Chap 11-15
Computing the 
Overall Proportion 
X 
n 
p = X + X + + 
X 
The overall  
proportion is: 
1 2 c = 
+ + + 
n n  
n 
1 2 c 
 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 c2 > c2 
U, reject H0, 
otherwise, do not 
reject H0 
Where c2 
U is from the 
chi-squared distribution 
with c – 1 degrees of 
freedom 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-16
c2 Test of Independence 
 Similar to the c2 test for equality of more than 
two proportions, but extends the concept to 
contingency tables with r rows and c columns 
H0: The two categorical variables are independent 
(i.e., there is no relationship between them) 
H1: The two categorical variables are dependent 
(i.e., there is a relationship between them) 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-17
c2 Test of Independence 
The Chi-square test statistic is: 
(f f ) 
c = å - 
2 o e 
f 
all cells e 
2 
 where: 
fo = observed frequency in a particular cell of the r x c table 
fe = expected frequency in a particular cell if H0 is true 
c2 for the r x c case has (r-1)(c-1) degrees of freedom 
Statistics (Assumed: for Managers each cell in Using 
the contingency table has expected 
Microsoft frequency Excel, 4e of at © least 2004 
1) 
Prentice-Hall, Inc. Chap 11-18 
(continued)
Expected Cell Frequencies 
 Expected cell frequencies: 
f row total column total e 
n 
= ´ 
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, 4e © 2004 
Prentice-Hall, Inc. Chap 11-19
Decision Rule 
 The decision rule is 
If c2 > c2 
U, reject H0, 
otherwise, do not reject H0 
Where c2 
U is from the chi-squared distribution 
with (r – 1)(c – 1) degrees of freedom 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-20
Example 
 The meal plan selected by 200 students is shown below: 
Class 
Standing 
Number of meals per week 
20/week 10/week none Total 
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, 4e © 2004 
Prentice-Hall, Inc. Chap 11-21
Example 
 The hypothesis to be tested is: 
(continued) 
H0: Meal plan and class standing are independent 
(i.e., there is no relationship between them) 
H1: Meal plan and class standing are dependent 
(i.e., there is a relationship between them) 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-22
Class 
Standing 
Observed: 
Number of meals 
per week 
Total 
20/wk 10/wk 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 
Expected cell 
frequencies if H0 is true: 
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 
Example for one cell: 
f = row total ´ 
column total e 
Statistics 30 for 70 
Managers Using 
Microsoft 10.5 
200 
Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-23 
n 
= ´ = 
Example: 
Expected Cell Frequencies 
(continued)
Example: The Test Statistic 
 The test statistic value is: 
(continued) 
0.709 
2 
2 2 2 
(10 8.4) 
c = å - 
= - + - + + - = 
8.4 
(32 30.8) 
30.8 
(f f ) 
2 o e 
f 
all cells e 
(24 24.5) 
24.5 
 
c2 
= 12.592 for α = .05 from the chi-squared 
U distribution with (4 – 1)(3 – 1) = 6 degrees of 
freedom 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-24
Example: 
Decision and Interpretation 
(continued) 
The test statistic is c2 = 0 . 709 , c with 6 d.f. = 
12.592 2U 
Decision Rule: 
If c2 > 12.592, reject H0, 
otherwise, do not reject H0 
Here, 
c2 = 0.709 < c2 
U = 12.592, 
so do not reject H0 
Conclusion: there is not 
sufficient evidence that meal 
plan and class standing are 
related at a = .05 
c2 
a 
Reject H0 Do not 
reject H0 
U=12.592 
c2 
0 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-25
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 is available 
 Must use normal approximation if either of the 
sample sizes is larger than 10 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-26
Wilcoxon Rank-Sum Test: 
Small Samples 
 Can use when both n1 , n2 ≤ 10 
 Assign ranks to the combined n1 + n2 sample 
observations 
 If unequal sample sizes, let n1 refer to smaller-sized 
sample 
 Smallest value rank = 1, largest value rank = n1 + n2 
 Assign average rank for ties 
 Sum the ranks for each sample: T1 and T2 
Statistics for Managers Using 
Microsoft  Obtain Excel, test 4e © statistic, 2004 
T(from smaller sample) 
1 Prentice-Hall, Inc. Chap 11-27
Checking the Rankings 
 The sum of the rankings must satisfy the 
formula below 
 Can use this to verify the sums T1 and T2 
T + T = n(n + 
1) 1 2 
2 
where n = n1 + n2 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-28
Wilcoxon Rank-Sum Test: 
Hypothesis and Decision Rule 
M1 = median of population 1; M2 = median of population 2 
Test statistic = T1 (Sum of ranks from smaller sample) 
Two-Tail Test Left-Tail Test Right-Tail Test 
H0: M1 = M2 
H1: M1 ¹ M2 
H0: M1 £ M2 
H1: M1 > M2 
H0: M1 ³ M2 
H1: M1 < M2 
Reject 
Do Not Reject 
Reject 
T1L T1U 
Reject 
T1L 
Do Not Reject 
Do Not Reject Reject 
T1U 
Statistics Reject Hif for T< Managers TUsing 
0 1 1L 
Microsoft or if Excel, T> T4e © 2004 
1 1U 
Prentice-Hall, Inc. Chap 11-29 
Reject H0 if T1 < T1L Reject H0 if T1 > T1U
Wilcoxon Rank-Sum Test: 
Small Sample Example 
Sample data is 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 sample medians 
at the 0.05 significance level 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-30
Wilcoxon Rank-Sum Test: 
Small Sample Example 
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 
Ranked 
Capacity 
values: 
Statistics for Managers Using 
97 9 
Microsoft Excel, 4e © 2004 
Rank Sums: 20.5 24.5 
Prentice-Hall, Inc. Chap 11-31 
Tie in 3rd and 
4th places 
(continued)
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: 
T1 = 24.5 
The sample sizes are: 
n1 = 4 (factory B) 
n2 = 5 (factory A) 
Statistics for Managers Using 
Microsoft Excel, 4e © The 2004 
level of significance is α = .05 
Prentice-Hall, Inc. Chap 11-32
Wilcoxon Rank-Sum Test: 
Small Sample Example 
n2 
a n1 
One- 
Tailed 
(continued) 
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 
T1 from 
Appendix 
table E.8: 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. T1L = 11 and T1U Chap = 29 
11-33
Wilcoxon Rank-Sum Test: 
Small Sample Solution 
 a = .05 
 n1 = 4 , n2 = 5 
Two-Tail Test 
H0: M1 = M2 
H1: M1 ¹ M2 
Do Not Reject 
Reject 
Reject 
T1L=11 T1U=29 
(continued) 
Do not reject at a = 0.05 
Statistics Reject Hif for T< Managers T=11 
Using 
0 1 1LMicrosoft or if Excel, T> T=4e 29 
© 2004 
1 1UPrentice-Hall, Inc. Chap 11-34 
Test Statistic (Sum of 
ranks from smaller sample): 
T1 = 24.5 
Decision: 
Conclusion: 
There is not enough evidence 
that medians are not equal.
Wilcoxon Rank-Sum Test 
(Large Sample) 
 For large samples, the test statistic Tis 
1 approximately normal with mean μ 
T1 and 
standard deviation σ 
T1 : 
μ = n1(n + 
1) 
T1 
2 
σ = n1n2 (n + 
1) 
T1 
12 
 Must use the normal approximation if either n1 
or n2 > 10 
 Can use the normal approximation for small samples 
 Assign n1 to be the smaller of the two sample sizes 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-35
Wilcoxon Rank-Sum Test 
(Large Sample) 
 The Z test statistic is 
T - 
μ 
1 T 
σ 
T 
1 
1 
Z 
= 
 Where Z approximately follows a 
standardized normal distribution 
(continued) 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-36
Wilcoxon Rank-Sum Test: 
Normal Approximation Example 
Use the setting of the prior example: 
The sample sizes were: 
n1 = 4 (factory B) 
n2 = 5 (factory A) 
The level of significance was α = .05 
The test statistic was T1 = 24.5 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-37
Wilcoxon Rank-Sum Test: 
Normal Approximation Example 
20 
μ = n1(n + 1) 
= 4(9 + 1) 
= 
T1 2 
2 
σ = n1n2 (n + 1) 
= 4(5)(9 + 1) 
= 
T1 12 
12 
 The test statistic is 
2.739 
(continued) 
1.64 
24.5 20 
- 
1 T = - = 
2.739 
T μ 
σ 
Z 
T 
1 
1 
= 
 Z = 1.64 is not greater than the critical Z value of 1.96 
(for α = .05) so we do not reject H0 – there is not 
sufficient evidence that the medians are not equal 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-38
Kruskal-Wallis Rank Test 
 Tests the equality of more than 2 population 
medians 
 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, 4e © 2004 
Prentice-Hall, Inc. Chap 11-39
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 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-40
Kruskal-Wallis Test Procedure 
 The Kruskal-Wallis H test statistic: (with c – 1 degrees of freedom) 
ù 
2 
j - + 
3(n 1) 
T 
n 
é 
H 12 
= å= 
n(n 1) 
c 
j 1 j 
ú úû 
ê êë 
+ 
where: 
n = sum of sample sizes in all samples 
c = Number of samples 
Tj = Sum of ranks in the jth sample 
nj = Size of the jth sample 
(continued) 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-41
Kruskal-Wallis Test Procedure 
 Complete the test by comparing the 
calculated H value to a critical c2 value from 
the chi-square distribution with c – 1 
degrees of freedom 
 Decision rule 
(continued) 
 Reject H0 if test statistic H > c2 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-42 
U 
 Otherwise do not reject H0 
c2 
c2 
U 
0 
a 
Reject H0 Do not 
reject H0
Kruskal-Wallis Example 
 Do different departments have different class 
sizes? 
Class size 
(Math, M) 
Class size 
(English, E) 
Class size 
(History, H) 
23 
45 
54 
78 
66 
55 
60 
72 
45 
70 
30 
40 
18 
34 
44 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-43
Kruskal-Wallis Example 
 Do different departments have different class 
sizes? 
Class size 
(Math, M) Ranking Class size 
(English, E) Ranking Class size 
(History, H) Ranking 
23 
41 
54 
78 
66 
269 
15 
12 
55 
60 
72 
45 
70 
10 
11 
14 
8 
13 
30 
40 
18 
34 
44 
35147 
S = 44 S = 56 S = 20 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-44
Kruskal-Wallis Example 
H : Median Median Median 
0 M E H = = 
H : Not all population Medians are equal 
A 
 The H statistic is 
(continued) 
3(15 1) 6.72 
- + 
ù 
ú úû 
2 2 2 
20 
5 
3(n 1) 
56 
+ + 
5 
R 
n 
2j 
= å= 
j 1 j 
44 
5 
é 
H 12 
n(n + 
1) 
12 
c 
15(15 1) 
ù 
= + - úû 
ê êë 
é 
êë 
ö 
÷ ÷ø 
æ 
ç çè 
+ 
= 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-45
Kruskal-Wallis Example 
 Compare H = 6.72 to the critical value from the 
chi-square distribution for 5 – 1 = 4 degrees of 
freedom and a = .05: 
4877 . 9 2U 
c = 
Since H = 6.72 < 
4877 . 9 2U 
c = 
do not reject H0 
(continued) 
There is not sufficient evidence to reject 
that the population medians are all equal 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-46
Chapter Summary 
 Developed and applied the c2 test for the 
difference between two proportions 
 Developed and applied the c2 test for 
differences in more than two proportions 
 Examined the c2 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 
Statistics for Managers Using 
Microsoft Excel, 4e © 2004 
Prentice-Hall, Inc. Chap 11-47

More Related Content

What's hot

What's hot (20)

Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)
 
Chi square tests using SPSS
Chi square tests using SPSSChi square tests using SPSS
Chi square tests using SPSS
 
Tests of significance
Tests of significanceTests of significance
Tests of significance
 
Design of experiments
Design of experiments Design of experiments
Design of experiments
 
Linearity cochran test
Linearity cochran testLinearity cochran test
Linearity cochran test
 
Test of-significance : Z test , Chi square test
Test of-significance : Z test , Chi square testTest of-significance : Z test , Chi square test
Test of-significance : Z test , Chi square test
 
ANOVA Test
ANOVA TestANOVA Test
ANOVA Test
 
Regression
RegressionRegression
Regression
 
Anova copy
Anova   copyAnova   copy
Anova copy
 
Kolmogorov Smirnov good-of-fit test
Kolmogorov Smirnov good-of-fit testKolmogorov Smirnov good-of-fit test
Kolmogorov Smirnov good-of-fit test
 
Response Surface.pptx
Response Surface.pptxResponse Surface.pptx
Response Surface.pptx
 
Two Way ANOVA.pptx
Two Way ANOVA.pptxTwo Way ANOVA.pptx
Two Way ANOVA.pptx
 
The mann whitney u test
The mann whitney u testThe mann whitney u test
The mann whitney u test
 
Test of significance in Statistics
Test of significance in StatisticsTest of significance in Statistics
Test of significance in Statistics
 
Probability+distribution
Probability+distributionProbability+distribution
Probability+distribution
 
Chapter 5 experimental design for sbh
Chapter 5 experimental design for sbhChapter 5 experimental design for sbh
Chapter 5 experimental design for sbh
 
NON-PARAMETRIC TESTS by Prajakta Sawant
NON-PARAMETRIC TESTS by Prajakta SawantNON-PARAMETRIC TESTS by Prajakta Sawant
NON-PARAMETRIC TESTS by Prajakta Sawant
 
Wilcoxon Rank-Sum Test
Wilcoxon Rank-Sum TestWilcoxon Rank-Sum Test
Wilcoxon Rank-Sum Test
 
non parametric statistics
non parametric statisticsnon parametric statistics
non parametric statistics
 
95720357 a-design-of-experiments
95720357 a-design-of-experiments95720357 a-design-of-experiments
95720357 a-design-of-experiments
 

Similar to Chi square using excel

Chap11 chie square & non parametrics
Chap11 chie square & non parametricsChap11 chie square & non parametrics
Chap11 chie square & non parametricsUni Azza Aunillah
 
Chi Square Tests and Nonparametric Tests
Chi Square Tests and Nonparametric TestsChi Square Tests and Nonparametric Tests
Chi Square Tests and Nonparametric TestsYesica Adicondro
 
Bbs11 ppt ch12
Bbs11 ppt ch12Bbs11 ppt ch12
Bbs11 ppt ch12Tuul Tuul
 
Chap08 fundamentals of hypothesis
Chap08 fundamentals of  hypothesisChap08 fundamentals of  hypothesis
Chap08 fundamentals of hypothesisUni Azza Aunillah
 
Chap06 normal distributions & continous
Chap06 normal distributions & continousChap06 normal distributions & continous
Chap06 normal distributions & continousUni Azza Aunillah
 
Fundamentals of Testing Hypothesis
Fundamentals of Testing HypothesisFundamentals of Testing Hypothesis
Fundamentals of Testing HypothesisYesica Adicondro
 
chi square test lecture for nurses in pakistan
chi square test lecture for nurses in pakistanchi square test lecture for nurses in pakistan
chi square test lecture for nurses in pakistanmuhammad shahid
 
The Normal Distribution and Other Continuous Distributions
The Normal Distribution and Other Continuous DistributionsThe Normal Distribution and Other Continuous Distributions
The Normal Distribution and Other Continuous DistributionsYesica Adicondro
 
Chap14 multiple regression model building
Chap14 multiple regression model buildingChap14 multiple regression model building
Chap14 multiple regression model buildingUni Azza Aunillah
 
Numerical Descriptive Measures
Numerical Descriptive MeasuresNumerical Descriptive Measures
Numerical Descriptive MeasuresYesica Adicondro
 
Newbold_chap16.ppt
Newbold_chap16.pptNewbold_chap16.ppt
Newbold_chap16.pptcfisicaster
 
Chap03 numerical descriptive measures
Chap03 numerical descriptive measuresChap03 numerical descriptive measures
Chap03 numerical descriptive measuresUni Azza Aunillah
 
multiple regression model building
 multiple regression model building multiple regression model building
multiple regression model buildingYesica Adicondro
 

Similar to Chi square using excel (20)

Chap11 chie square & non parametrics
Chap11 chie square & non parametricsChap11 chie square & non parametrics
Chap11 chie square & non parametrics
 
Chi Square Tests and Nonparametric Tests
Chi Square Tests and Nonparametric TestsChi Square Tests and Nonparametric Tests
Chi Square Tests and Nonparametric Tests
 
Bbs11 ppt ch12
Bbs11 ppt ch12Bbs11 ppt ch12
Bbs11 ppt ch12
 
Chap10 anova
Chap10 anovaChap10 anova
Chap10 anova
 
Chap08 fundamentals of hypothesis
Chap08 fundamentals of  hypothesisChap08 fundamentals of  hypothesis
Chap08 fundamentals of hypothesis
 
Analysis of Variance
Analysis of VarianceAnalysis of Variance
Analysis of Variance
 
Chap06 normal distributions & continous
Chap06 normal distributions & continousChap06 normal distributions & continous
Chap06 normal distributions & continous
 
Fundamentals of Testing Hypothesis
Fundamentals of Testing HypothesisFundamentals of Testing Hypothesis
Fundamentals of Testing Hypothesis
 
chi square test lecture for nurses in pakistan
chi square test lecture for nurses in pakistanchi square test lecture for nurses in pakistan
chi square test lecture for nurses in pakistan
 
The Normal Distribution and Other Continuous Distributions
The Normal Distribution and Other Continuous DistributionsThe Normal Distribution and Other Continuous Distributions
The Normal Distribution and Other Continuous Distributions
 
Chap12 simple regression
Chap12 simple regressionChap12 simple regression
Chap12 simple regression
 
Chap14 multiple regression model building
Chap14 multiple regression model buildingChap14 multiple regression model building
Chap14 multiple regression model building
 
Chapter12
Chapter12Chapter12
Chapter12
 
Numerical Descriptive Measures
Numerical Descriptive MeasuresNumerical Descriptive Measures
Numerical Descriptive Measures
 
chap08.pptx
chap08.pptxchap08.pptx
chap08.pptx
 
Newbold_chap16.ppt
Newbold_chap16.pptNewbold_chap16.ppt
Newbold_chap16.ppt
 
Chap03 numerical descriptive measures
Chap03 numerical descriptive measuresChap03 numerical descriptive measures
Chap03 numerical descriptive measures
 
multiple regression model building
 multiple regression model building multiple regression model building
multiple regression model building
 
Contingency Tables
Contingency TablesContingency Tables
Contingency Tables
 
chap06-1.pptx
chap06-1.pptxchap06-1.pptx
chap06-1.pptx
 

Recently uploaded

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Recently uploaded (20)

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 

Chi square using excel

  • 1. Statistics for Managers Using Microsoft® Excel 4th Edition Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1
  • 2. Chapter Goals After completing this chapter, you should be able to:  Perform a c2 test for the difference between two proportions  Use a c2 test for differences in more than two proportions  Perform a c2 test of independence  Apply and interpret the Wilcoxon rank sum test for the difference between two medians  Perform nonparametric analysis of variance using the Kruskal-Wallis rank test for one-way ANOVA Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-2
  • 3. 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. Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-3
  • 4. 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 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-4
  • 5. Contingency Table Example (continued) Sample results organized in a contingency table: Gender Hand Preference Left Right Female 12 108 120 Male 24 156 180 36 264 300 sample size = n = 300: 120 Females, 12 were left handed 180 Males, 24 were left handed Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-5
  • 6. c2 Test for the Difference Between Two Proportions H0: p1 = p2 (Proportion of females who are left handed is equal to the proportion of males who are left handed) H1: p1 ≠ p2 (The two proportions are not the same – Hand preference is not independent of gender)  If H0 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 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-6
  • 7. The Chi-Square Test Statistic The Chi-square test statistic is: (f f ) c = å - 2 o e f all cells e 2  where: fo = observed frequency in a particular cell fe = expected frequency in a particular cell if H0 is true c2 for the 2 x 2 case has 1 degree of freedom Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-7 (Assumed: each cell in the contingency table has expected frequency of at least 5)
  • 8. Decision Rule c2 The c2 test statistic approximately follows a chi-squared distribution with one degree of freedom Statistics for Managers Using c2 Microsoft Excel, 4e © 2004 U Prentice-Hall, Inc. Chap 11-8 Decision Rule: If c2 > c2 U, reject H0, otherwise, do not reject H0 0 a Reject H0 Do not reject H0
  • 9. Computing the Average Proportion p = X + X 1 2 = + n n The average proportion is: 120 Females, 12 Here: were left handed 180 Males, 24 were left handed X n 1 2 0.12 p 12 24 = 36 = 300 = + 120 + 180 i.e., the proportion of left handers overall is 12% Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-9
  • 10. 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 Statistics for Managers (.Using 12)(180) = 21.6 males to be left handed Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-10
  • 11. Observed v. Expected Frequencies Observed frequencies vs. expected frequencies: Gender Hand Preference Left Right Female Observed = 12 Expected = 14.4 Observed = 108 Expected = 105.6 120 Male Observed = 24 Expected = 21.6 Observed = 156 Expected = 158.4 180 36 264 300 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-11
  • 12. The Chi-Square Test Statistic Gender Hand Preference Left Right Female Observed = 12 Expected = 14.4 Observed = 108 Expected = 105.6 120 Male Observed = 24 Expected = 21.6 Observed = 156 Expected = 158.4 180 36 264 300 The test statistic is: (f f ) c = å - f Statistics (12 for 14.4) Managers 2 (108 Using 105.6) 2 (24 21.6) 2 (156 158.4) 2 Microsoft Excel, 14.4 4e © 2004 0.6848 105.6 21.6 158.4 Prentice-Hall, Inc. Chap 11-12 all cells e 2 2 o e = - + - + - + - =
  • 13. Decision Rule Example The test statistic is c2 = 0 . 6848 , c with 1 d.f. = 3.841 2U Decision Rule: If c2 > 3.841, reject H0, otherwise, do not reject H0 Here, c2 = 0.6848 < c2 U = 3.841, so we do not reject H0 and conclude that there is not sufficient evidence that the two proportions are different at a = .05 c2 a Reject H0 Do not reject H0 U=3.841 c2 0 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-13
  • 14. c2 Test for the Difference Between More Than Two Proportions  Extend the c2 test to the case with more than two independent populations: H0: p1 = p2 = … = pc H1: Not all of the pj are equal (j = 1, 2, …, c) Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-14
  • 15. The Chi-Square Test Statistic The Chi-square test statistic is: (f f ) c = å - 2 o e f all cells e 2  where: fo = observed frequency in a particular cell of the 2 x c table fe = expected frequency in a particular cell if H0 is true c2 for the 2 x c case has (2-1)(c-1) = c - 1 degrees of freedom Statistics Microsoft (Assumed: for Managers each cell Using Excel, 4e © 2004 in the contingency table has expected frequency of at least 1) Prentice-Hall, Inc. Chap 11-15
  • 16. Computing the Overall Proportion X n p = X + X + + X The overall  proportion is: 1 2 c = + + + n n  n 1 2 c  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 c2 > c2 U, reject H0, otherwise, do not reject H0 Where c2 U is from the chi-squared distribution with c – 1 degrees of freedom Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-16
  • 17. c2 Test of Independence  Similar to the c2 test for equality of more than two proportions, but extends the concept to contingency tables with r rows and c columns H0: The two categorical variables are independent (i.e., there is no relationship between them) H1: The two categorical variables are dependent (i.e., there is a relationship between them) Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-17
  • 18. c2 Test of Independence The Chi-square test statistic is: (f f ) c = å - 2 o e f all cells e 2  where: fo = observed frequency in a particular cell of the r x c table fe = expected frequency in a particular cell if H0 is true c2 for the r x c case has (r-1)(c-1) degrees of freedom Statistics (Assumed: for Managers each cell in Using the contingency table has expected Microsoft frequency Excel, 4e of at © least 2004 1) Prentice-Hall, Inc. Chap 11-18 (continued)
  • 19. Expected Cell Frequencies  Expected cell frequencies: f row total column total e n = ´ 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, 4e © 2004 Prentice-Hall, Inc. Chap 11-19
  • 20. Decision Rule  The decision rule is If c2 > c2 U, reject H0, otherwise, do not reject H0 Where c2 U is from the chi-squared distribution with (r – 1)(c – 1) degrees of freedom Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-20
  • 21. Example  The meal plan selected by 200 students is shown below: Class Standing Number of meals per week 20/week 10/week none Total 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, 4e © 2004 Prentice-Hall, Inc. Chap 11-21
  • 22. Example  The hypothesis to be tested is: (continued) H0: Meal plan and class standing are independent (i.e., there is no relationship between them) H1: Meal plan and class standing are dependent (i.e., there is a relationship between them) Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-22
  • 23. Class Standing Observed: Number of meals per week Total 20/wk 10/wk 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 Expected cell frequencies if H0 is true: 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 Example for one cell: f = row total ´ column total e Statistics 30 for 70 Managers Using Microsoft 10.5 200 Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-23 n = ´ = Example: Expected Cell Frequencies (continued)
  • 24. Example: The Test Statistic  The test statistic value is: (continued) 0.709 2 2 2 2 (10 8.4) c = å - = - + - + + - = 8.4 (32 30.8) 30.8 (f f ) 2 o e f all cells e (24 24.5) 24.5  c2 = 12.592 for α = .05 from the chi-squared U distribution with (4 – 1)(3 – 1) = 6 degrees of freedom Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-24
  • 25. Example: Decision and Interpretation (continued) The test statistic is c2 = 0 . 709 , c with 6 d.f. = 12.592 2U Decision Rule: If c2 > 12.592, reject H0, otherwise, do not reject H0 Here, c2 = 0.709 < c2 U = 12.592, so do not reject H0 Conclusion: there is not sufficient evidence that meal plan and class standing are related at a = .05 c2 a Reject H0 Do not reject H0 U=12.592 c2 0 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-25
  • 26. 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 is available  Must use normal approximation if either of the sample sizes is larger than 10 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-26
  • 27. Wilcoxon Rank-Sum Test: Small Samples  Can use when both n1 , n2 ≤ 10  Assign ranks to the combined n1 + n2 sample observations  If unequal sample sizes, let n1 refer to smaller-sized sample  Smallest value rank = 1, largest value rank = n1 + n2  Assign average rank for ties  Sum the ranks for each sample: T1 and T2 Statistics for Managers Using Microsoft  Obtain Excel, test 4e © statistic, 2004 T(from smaller sample) 1 Prentice-Hall, Inc. Chap 11-27
  • 28. Checking the Rankings  The sum of the rankings must satisfy the formula below  Can use this to verify the sums T1 and T2 T + T = n(n + 1) 1 2 2 where n = n1 + n2 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-28
  • 29. Wilcoxon Rank-Sum Test: Hypothesis and Decision Rule M1 = median of population 1; M2 = median of population 2 Test statistic = T1 (Sum of ranks from smaller sample) Two-Tail Test Left-Tail Test Right-Tail Test H0: M1 = M2 H1: M1 ¹ M2 H0: M1 £ M2 H1: M1 > M2 H0: M1 ³ M2 H1: M1 < M2 Reject Do Not Reject Reject T1L T1U Reject T1L Do Not Reject Do Not Reject Reject T1U Statistics Reject Hif for T< Managers TUsing 0 1 1L Microsoft or if Excel, T> T4e © 2004 1 1U Prentice-Hall, Inc. Chap 11-29 Reject H0 if T1 < T1L Reject H0 if T1 > T1U
  • 30. Wilcoxon Rank-Sum Test: Small Sample Example Sample data is 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 sample medians at the 0.05 significance level Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-30
  • 31. Wilcoxon Rank-Sum Test: Small Sample Example 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 Ranked Capacity values: Statistics for Managers Using 97 9 Microsoft Excel, 4e © 2004 Rank Sums: 20.5 24.5 Prentice-Hall, Inc. Chap 11-31 Tie in 3rd and 4th places (continued)
  • 32. 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: T1 = 24.5 The sample sizes are: n1 = 4 (factory B) n2 = 5 (factory A) Statistics for Managers Using Microsoft Excel, 4e © The 2004 level of significance is α = .05 Prentice-Hall, Inc. Chap 11-32
  • 33. Wilcoxon Rank-Sum Test: Small Sample Example n2 a n1 One- Tailed (continued) 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 T1 from Appendix table E.8: Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. T1L = 11 and T1U Chap = 29 11-33
  • 34. Wilcoxon Rank-Sum Test: Small Sample Solution  a = .05  n1 = 4 , n2 = 5 Two-Tail Test H0: M1 = M2 H1: M1 ¹ M2 Do Not Reject Reject Reject T1L=11 T1U=29 (continued) Do not reject at a = 0.05 Statistics Reject Hif for T< Managers T=11 Using 0 1 1LMicrosoft or if Excel, T> T=4e 29 © 2004 1 1UPrentice-Hall, Inc. Chap 11-34 Test Statistic (Sum of ranks from smaller sample): T1 = 24.5 Decision: Conclusion: There is not enough evidence that medians are not equal.
  • 35. Wilcoxon Rank-Sum Test (Large Sample)  For large samples, the test statistic Tis 1 approximately normal with mean μ T1 and standard deviation σ T1 : μ = n1(n + 1) T1 2 σ = n1n2 (n + 1) T1 12  Must use the normal approximation if either n1 or n2 > 10  Can use the normal approximation for small samples  Assign n1 to be the smaller of the two sample sizes Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-35
  • 36. Wilcoxon Rank-Sum Test (Large Sample)  The Z test statistic is T - μ 1 T σ T 1 1 Z =  Where Z approximately follows a standardized normal distribution (continued) Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-36
  • 37. Wilcoxon Rank-Sum Test: Normal Approximation Example Use the setting of the prior example: The sample sizes were: n1 = 4 (factory B) n2 = 5 (factory A) The level of significance was α = .05 The test statistic was T1 = 24.5 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-37
  • 38. Wilcoxon Rank-Sum Test: Normal Approximation Example 20 μ = n1(n + 1) = 4(9 + 1) = T1 2 2 σ = n1n2 (n + 1) = 4(5)(9 + 1) = T1 12 12  The test statistic is 2.739 (continued) 1.64 24.5 20 - 1 T = - = 2.739 T μ σ Z T 1 1 =  Z = 1.64 is not greater than the critical Z value of 1.96 (for α = .05) so we do not reject H0 – there is not sufficient evidence that the medians are not equal Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-38
  • 39. Kruskal-Wallis Rank Test  Tests the equality of more than 2 population medians  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, 4e © 2004 Prentice-Hall, Inc. Chap 11-39
  • 40. 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 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-40
  • 41. Kruskal-Wallis Test Procedure  The Kruskal-Wallis H test statistic: (with c – 1 degrees of freedom) ù 2 j - + 3(n 1) T n é H 12 = å= n(n 1) c j 1 j ú úû ê êë + where: n = sum of sample sizes in all samples c = Number of samples Tj = Sum of ranks in the jth sample nj = Size of the jth sample (continued) Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-41
  • 42. Kruskal-Wallis Test Procedure  Complete the test by comparing the calculated H value to a critical c2 value from the chi-square distribution with c – 1 degrees of freedom  Decision rule (continued)  Reject H0 if test statistic H > c2 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-42 U  Otherwise do not reject H0 c2 c2 U 0 a Reject H0 Do not reject H0
  • 43. Kruskal-Wallis Example  Do different departments have different class sizes? Class size (Math, M) Class size (English, E) Class size (History, H) 23 45 54 78 66 55 60 72 45 70 30 40 18 34 44 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-43
  • 44. Kruskal-Wallis Example  Do different departments have different class sizes? Class size (Math, M) Ranking Class size (English, E) Ranking Class size (History, H) Ranking 23 41 54 78 66 269 15 12 55 60 72 45 70 10 11 14 8 13 30 40 18 34 44 35147 S = 44 S = 56 S = 20 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-44
  • 45. Kruskal-Wallis Example H : Median Median Median 0 M E H = = H : Not all population Medians are equal A  The H statistic is (continued) 3(15 1) 6.72 - + ù ú úû 2 2 2 20 5 3(n 1) 56 + + 5 R n 2j = å= j 1 j 44 5 é H 12 n(n + 1) 12 c 15(15 1) ù = + - úû ê êë é êë ö ÷ ÷ø æ ç çè + = Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-45
  • 46. Kruskal-Wallis Example  Compare H = 6.72 to the critical value from the chi-square distribution for 5 – 1 = 4 degrees of freedom and a = .05: 4877 . 9 2U c = Since H = 6.72 < 4877 . 9 2U c = do not reject H0 (continued) There is not sufficient evidence to reject that the population medians are all equal Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-46
  • 47. Chapter Summary  Developed and applied the c2 test for the difference between two proportions  Developed and applied the c2 test for differences in more than two proportions  Examined the c2 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 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-47