Chap 11-1 Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall Chapter 11 Chi-Square...
-
Upload
rosamond-waters -
Category
Documents
-
view
213 -
download
0
Transcript of Chap 11-1 Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall Chapter 11 Chi-Square...
Chap 11-1Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Chapter 11
Chi-Square Tests
Business Statistics: A First Course
6th Edition
Chap 11-2Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Learning Objectives
In this chapter, you learn: How and when to use the chi-square test for
contingency tables The 2 test for the difference between two proportions The 2 test for differences in more than two proportions The 2 test for independence
Chap 11-3Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Contingency Tables
Contingency Tables Useful in situations comparing multiple
population proportions Used to classify sample observations according
to two or more characteristics Also called a cross-classification table.
DCOVA
Chap 11-4Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Contingency Table Example
Left-Handed vs. Gender
Dominant Hand: Left vs. Right
Gender: Male vs. Female
2 categories for each variable, so this is called a 2 x 2 table
Suppose we examine a sample of 300 children
DCOVA
Chap 11-5Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Contingency Table Example
Sample results organized in a contingency table:
(continued)
Gender
Hand Preference
Left Right
Female 12 108 120
Male 24 156 180
36 264 300
120 Females, 12 were left handed
180 Males, 24 were left handed
sample size = n = 300:
DCOVA
Chap 11-6Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
2 Test for the Difference Between Two Proportions
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
H0: π1 = π2 (Proportion of females who are left
handed is equal to the proportion of
males who are left handed)
H1: π1 ≠ π2 (The two proportions are not the same –
hand preference is not independent
of gender)
DCOVA
Chap 11-7Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
The Chi-Square Test Statistic
where:
fo = observed frequency in a particular cell
fe = expected frequency in a particular cell if H0 is true
(Assumed: each cell in the contingency table has expectedfrequency of at least 5)
cells
22 )(
all e
eoSTAT f
ff
The Chi-square test statistic is:
freedom of degree 1 has case 2x 2 thefor 2STAT
DCOVA
Chap 11-8Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Decision Rule
2
2α
Decision Rule:
If , reject H0, otherwise, do not reject H0
The test statistic approximately follows a chi-squared distribution with one degree of freedom
0
Reject H0Do not reject H0
2STAT
χ
22αSTAT
χ χ
DCOVA
Chap 11-9Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Computing the Average Proportion
Here: 120 Females, 12 were left handed
180 Males, 24 were left handed
i.e., based on all 300 children the proportion of left handers is 0.12, that is, 12%
n
X
nn
XXp
21
21
12.0300
36
180120
2412
p
The average proportion is:
DCOVA
Chap 11-10Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
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
DCOVA
Chap 11-11Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Observed vs. Expected Frequencies
Gender
Hand Preference
Left Right
FemaleObserved = 12
Expected = 14.4Observed = 108
Expected = 105.6120
MaleObserved = 24
Expected = 21.6Observed = 156
Expected = 158.4180
36 264 300
DCOVA
Chap 11-12Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Gender
Hand Preference
Left Right
FemaleObserved = 12
Expected = 14.4Observed = 108
Expected = 105.6120
MaleObserved = 24
Expected = 21.6Observed = 156
Expected = 158.4180
36 264 300
0.7576158.4
158.4)(156
21.6
21.6)(24
105.6
105.6)(108
14.4
14.4)(12
f
)f(fχ
2222
cells all e
2eo2
STAT
The Chi-Square Test Statistic
The test statistic is:
DCOVA
Chap 11-13Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Decision Rule
Decision Rule:If > 3.841, reject H0, otherwise, do not reject H0
3.841 d.f. 1 with ; 0.7576 is statistictest The 205.0
2 χχSTAT
Here, =0.7576 < = 3.841, so we do not reject H0 and conclude that there is not sufficient evidence that the two proportions are different at = 0.05
2
20.05 = 3.841
0
0.05
Reject H0Do not reject H0
2STAT
2STATχ 2
05.0χ
DCOVA
Chap 11-14Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Chi-Square Test In ExcelChi-Square Test
Observed Frequencies
Hand Preference CalculationsGender Left Right Total f0 - feFemale 12 108 120 -2.4 2.4Male 24 156 180 2.4 -2.4Total 36 264 300
Expected Frequencies Hand Preference
Gender Left Right Total (f0 - fe)^2/feFemale 14.4 105.6 120 0.40 0.05Male 21.6 158.4 180 0.27 0.04Total 36 264 300
DataLevel of Significance 0.05Number of Rows 2Number of Columnns 2Degrees of Freedom 1=(B19-1)*(B20-1)
ResultsCritical Value 3.8415=CHIINV(B18,B21)Chi-Square Test Statistic 0.7576=SUM(F13:G14)p-Value 0.3841=CHIDIST(B25,B21)
Do not reject the null hypothesis =IF(B26<B18,"Reject the null hypothesis","Do not reject the null hypothesis")
Expected Frequency assumption is met. =IF(OR(B13<5,C13<5,B14<5,C14<5),
" is violated."," is met.")
DCOVA
Chap 11-15Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Chi-Square Test In Minitab
Tabulated statistics: Gender, Hand
(Expected counts are below observed)
(Chi-Square cell contribution below expected counts)
Rows: Gender Columns: Hand
Left Right All
Female 12 108 120
14.4 105.6 120.0
0.40000 0.05455 *
Male 24 156 180
21.6 158.4 180.0
0.26667 0.03636 *
All 36 264 300
36.0 264.0 300.0
* * *
Pearson Chi-Square = 0.758, DF = 1, P-Value = 0.384
DCOVA
Chap 11-16Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Extend the 2 test to the case with more than two independent populations:
2 Test for Differences Among More Than Two Proportions
H0: π1 = π2 = … = πc
H1: Not all of the πj are equal (j = 1, 2, …, c)
DCOVA
Chap 11-17Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
The Chi-Square Test Statistic
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
(Assumed: each cell in the contingency table has expectedfrequency of at least 1)
cells
22 )(
all e
eoSTAT f
ff
The Chi-square test statistic is:
freedom of degrees 1-c 1)-1)(c-(2 has case cx 2 thefor χ 2 STAT
DCOVA
Chap 11-18Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Computing the Overall Proportion
n
X
nnn
XXXp
c
c
21
21 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:
Where is from the chi-squared distribution with c – 1 degrees of freedom
Decision Rule:If , reject H0, otherwise, do not reject H0
22αSTAT
χ χ
2α
χ
DCOVA
Chap 11-19Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Example of 2 Test for Differences Among More Than Two Proportions
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 37 30 13
Totals 100 50 50
Using a 1% level of significance, which groups have a different attitude?
DCOVA
Chap 11-20Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Chi-Square Test Results
Chi-Square Test: Administrators, Students, Faculty
Admin Students Faculty Total
Favor 63 20 37 120
60 30 30
Oppose 37 30 13 80
40 20 20
Total 100 50 50 200
ObservedExpected
H0: π1 = π2 = π3
H1: Not all of the πj are equal (j = 1, 2, 3)
02
0102 Hreject so 9.2103 79212
.STATχ.χ
DCOVA
Chap 11-21Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Excel Output For The ExampleDCOVA
Chi-Square Test
Observed Frequencies Role Calculations
Opinion Admin Students Faculty Total fo - feFavor 63 20 37 120 3.0000 -10.0000 7
Oppose 37 30 13 80 -3.0000 10.0000 -7Total 100 50 50 200
Expected Frequencies Role
Opinion Admin Students Faculty Total (fo - fe)^2/feFavor 60.0 30.0 30.0 120 0.1500 3.3333 1.6333
Oppose 40.0 20.0 20.0 80 0.2250 5.0000 2.4500Total 100 50 50 200
DataLevel of Significance 0.01Number of Rows 2Number of Columns 3Degrees of Freedom 2=($B$19 - 1) * ($B$20 - 1)
ResultsCritical Value 9.2103=CHIINV(B18, B21)Chi-Square Test Statistic 12.7917=SUM(G13:I14)p-Value 0.0017=CHIDIST(B25, B21)
Reject the null hypothesis =IF(B26<B18, "Reject the null hypothesis",Do not reject the null hypothesis")
Expected frequency assumption is met. =IF(OR(B13<1, C13<1, D13<1, B14<1, C14<1, D14<1),
" is violated.", " is met.")
Chap 11-22Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Minitab Output For The ExampleDCOVA
Tabulated statistics: Position, Role
Rows: Position Columns: Role
Admin Faculty Students All
Favor 63 37 20 120
60 30 30 120
0.150 1.633 3.333 *
Oppose 37 13 30 80
40 20 20 80
0.225 2.450 5.000 *
All 100 50 50 200
100 50 50 200
* * * *
Pearson Chi-Square = 12.792, DF = 2, P-Value = 0.002
Chap 11-23Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
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
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)
DCOVA
Chap 11-24Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
2 Test of Independence
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
(Assumed: each cell in the contingency table has expected
frequency of at least 1)
cells
22
)(
all e
eoSTAT f
ffχ
The Chi-square test statistic is:
(continued)
freedom of degrees 1)-1)(c-(r has case cr x for the χ 2STAT
DCOVA
Chap 11-25Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Expected Cell Frequencies
Expected cell frequencies:
n
total columntotalrow fe
Where:
row total = sum of all frequencies in the row
column total = sum of all frequencies in the column
n = overall sample size
DCOVA
Chap 11-26Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Decision Rule
The decision rule is
Where is from the chi-squared distribution with (r – 1)(c – 1) degrees of freedom
If , reject H0,
otherwise, do not reject H0
22αSTAT
χ χ
2α
χ
DCOVA
Chap 11-27Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Example
The meal plan selected by 200 students is shown below:
ClassStanding
Number of meals per weekTotal20/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
DCOVA
Chap 11-28Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
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)
DCOVA
Chap 11-29Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
ClassStanding
Number of meals per week
Total20/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
ClassStanding
Number of meals per week
Total20/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
Observed:
Expected cell frequencies if H0 is true:
5.10200
7030
n
total columntotalrow fe
Example for one cell:
Example: Expected Cell Frequencies
(continued)
DCOVA
Chap 11-30Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Example: The Test Statistic
The test statistic value is:
709048
4810
830
83032
524
52424 222
cells
22
..
).(
.
).(
.
).(
f
)ff(χ
all e
eoSTAT
(continued)
= 12.592 from the chi-squared distribution with (4 – 1)(3 – 1) = 6 degrees of freedom
2050.
χ
DCOVA
Chap 11-31Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Example: Decision and Interpretation
(continued)
Decision Rule:If > 12.592, reject H0, otherwise, do not reject H0
12.592 d.f. 6 with ; 7090 is statistictest The 2050
2 .STAT
χ.χ
Here, = 0.709 < = 12.592, so do not reject H0 Conclusion: there is not sufficient evidence that meal plan and class standing are related at = 0.05
2
20.05=12.592
0
0.05
Reject H0Do not reject H0
2STAT
χ
2STAT
χ 2050.
χ
DCOVA
Chap 11-32Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Excel Output Of ExampleDCOVAChi-Square Test of Independence
Observed Frequencies Meals Per Week Calculations
Class Standing 20/wk 10/wk None Total fo - feFresh. 24 32 14 70 -0.5000 1.2000 -0.7000Soph. 22 26 12 60 1.0000 -0.4000 -0.6000Junior 10 14 6 30 -0.5000 0.8000 -0.3000Senior 14 16 10 40 0.0000 -1.6000 1.6000Total 70 88 42 200
Expected Frequencies Meals Per Week
Class Standing 20/wk 10/wk None Total (fo - fe)^2/feFresh. 24.5000 30.8000 14.7000 70 0.0102 0.0468 0.0333Soph. 21.0000 26.4000 12.6000 60 0.0476 0.0061 0.0286Junior 10.5000 13.2000 6.3000 30 0.0238 0.0485 0.0143Senior 14.0000 17.6000 8.4000 40 0.0000 0.1455 0.3048Total 70 88 42 200
DataLevel of Significance 0.05Number of Rows 4Number of Columns 3Degrees of Freedom 6=($B$23 - 1) * ($B$24 - 1)
ResultsCritical Value 12.5916=CHIINV(B22, B25)Chi-Square Test Statistic 0.7093=SUM($G$15:$I$18)p-Value 0.9943=CHIDIST(B29, B25)
Do not reject the null hypothesis =IF(B30<B22, "Reject the null hypothesis",Do not reject the null hypothesis)
Expected frequency assumption is met. =IF(OR(B15<1, C15<1, D15<1, B16<1, C16<1, D16<1, B17<1, C17<1,
D17<1, B18<1, C18<1, D18<1), " is violated.", " is met.")
Chap 11-33Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
Minitab Output Of ExampleDCOVA
Tabulated statistics: Class, Meals
Rows: Class Columns: Meals
0 10 20 All
Fresh 14 32 24 70
14.70 30.80 24.50 70.00
0.03333 0.04675 0.01020 *
Junior 6 14 10 30
6.30 13.20 10.50 30.00
0.01429 0.04848 0.02381 *
Senior 10 16 14 40
8.40 17.60 14.00 40.00
0.30476 0.14545 0.00000 *
Soph 12 26 22 60
12.60 26.40 21.00 60.00
0.02857 0.00606 0.04762 *
All 42 88 70 200
42.00 88.00 70.00 200.
* * * *
Pearson Chi-Square = 0.709, DF = 6, P-Value = 0.994
Chap 11-34Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
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
Chap 11-35Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying,
recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.