Professional Documents
Culture Documents
Chapter 10
Tests for Two or More Samples
with Categorical Data
Chap 10-2
© 2002 Prentice-Hall, Inc.
Z Test for Differences
in Two Proportions
Why is it used?
To determine whether there is a difference
between two population proportions and whether
one is larger than the other
Assumptions:
Independent samples
Population follows Binomial distribution
Sample size large enough: np 5 and n(1-p) 5 for
each population
Chap 10-3
© 2002 Prentice-Hall, Inc.
Z Test Statistic
( ps1 ps2 ) ( p1 p2 )
Z
1 1
p (1 p )
n1 n2
X1 X 2 Pooled Estimate of the
Where p
n1 n2 Population Proportion
Research Questions
Hypothesis No Difference Prop 1 Prop 2 Prop 1 Prop 2
Any Difference Prop 1 < Prop 2 Prop 1 > Prop 2
H0 p1 - p2 p1 - p 2 0 p1 - p2 0
H1 p1 - p 2 0 p1 - p2 < 0 p 1 - p2 > 0
Chap 10-5
© 2002 Prentice-Hall, Inc.
Z Test for Differences in Two
Proportions: Example
63
As personnel director, you PS1 .808 n1 78
78
want to test the perception
49
of fairness of two methods PS2 .598 n2 82
82
of performance evaluation.
63 of 78 employees rated np 5 n 1 p 5
method one as fair. Forty-
for both pop.
nine of 82 rated method
two as fair. At the 0.01
significance level, is there a
difference in perceptions?
Chap 10-6
© 2002 Prentice-Hall, Inc.
Calculating the Test Statistic
( ps1 ps2 ) ( p1 p2 )
Z
1 1
p (1 p )
n1 n2
(.808 .598) 0
2.90
1 1
(.70)(.30)
78 82
X 1 X 2 63 49
p .70
n1 n2 78 82
Chap 10-7
© 2002 Prentice-Hall, Inc.
Z Test for Differences in Two
Proportions: Solution
H0: p1 - p2 = 0 Test Statistic:
H1: p1 - p2 0 Z 2.90
= 0.01
n1 = 78 n2 = 82 Decision:
Reject at = 0.01
Critical Value(s):
Reject H 0 Reject H 0 Conclusion:
.005 .005 There is evidence of a
difference in proportions.
-2.58 0 2.58 Z
Chap 10-8
© 2002 Prentice-Hall, Inc.
Z Test for Difference in Two
Proportions in PHStat
PHStat | two-sample tests | Z test for
differences in two proportions …
Example solution in excel spreadsheet
Microsoft Excel
Worksheet
Chap 10-9
© 2002 Prentice-Hall, Inc.
2 Test for Two Proportions:
Basic Idea
Compares observed frequencies to expected
frequencies if null hypothesis is true
The closer the observed frequencies are to
the expected frequencies, the more likely the
H0 is true
Measured by squared difference relative to
expected frequency
Sum of relative squared differences is the test
statistic
Chap 10-10
© 2002 Prentice-Hall, Inc.
2 Test for Two Proportions:
Contingency Table
Contingency table (observed frequencies)
for comparing fairness of performance
evaluation methods
Two populations
Evaluation Method
Perception 1 2 Total
Fair 63 49 112
Unfair 15 33 48
Total 78 82 160
Levels of variable
Chap 10-11
© 2002 Prentice-Hall, Inc.
2 Test for Two Proportions:
Expected Frequencies
112 of 160 total are “fair” ( p 112 /160)
78 used evaluation method 1
Expect (78 112/160) = 54.6 to be ‘fair’
Evaluation Method
Perception 1 2 Total
Fair 63 49 112
Unfair 15 33 48
Total 78 82 160
Chap 10-12
© 2002 Prentice-Hall, Inc.
The 2 Test Statistic
f0 fe
2
2
All Cells fe
f o : Observed frequency in cell
f e : Theoretical or expected frequency
= row total column total / n
Chap 10-13
© 2002 Prentice-Hall, Inc.
Computation of the
2 Test Statistic
Microsoft Excel
Worksheet
Chap 10-17
© 2002 Prentice-Hall, Inc.
2 Test for c Proportions
Extends the 2 test to the general case of c
independent populations
Tests for equality (=) of proportions only
One variable with several groups or levels
Uses contingency table
Assumptions:
Independent random samples
“Large” sample size
All expected frequencies 1
Chap 10-18
© 2002 Prentice-Hall, Inc.
2 Test for c Proportions:
Hypotheses and Statistic
Hypotheses
H0: p1 = p2 = ... = pc
H1: Not all pj are equal
Observed frequency
Test statistic
fo fe
2
2
all cells fe Expected frequency
1. Set Hypotheses:
H0: p1 = p2 = p3 All expected
H1: Not All pj Are Equal frequencies
are large.
2. Contingency Table:
Opinion Under Grad Faculty Totals
Favor 63 27 30 120
Oppose 37 23 20 80
Totals 100 50 50 200
Chap 10-21
© 2002 Prentice-Hall, Inc.
2 Test for c Proportions:
Example (continued)
(100)(120)/200=60
(50)(80)/200=20
Chap 10-22
© 2002 Prentice-Hall, Inc.
2 Test for c Proportions:
Example (continued)
H0: p1 = p2 = p3 df = (c – 1)(r - 1) = 3 - 1 =
H1: Not All pj Are Equal 2
Reject
Decision:
Do Not Reject H0
= .01
0 9.210 2
Conclusion:
Since 2 =1.125, there is no evidence of a
difference in attitude among the groups.
Chap 10-24
© 2002 Prentice-Hall, Inc.
2 Test for c Proportions
in PHStat
PHStat | c-sample tests | chi-square test …
Example solution in excel spreadsheet
Microsoft Excel
Worksheet
Chap 10-25
© 2002 Prentice-Hall, Inc.
2 Test of Independence
Shows whether a relationship exists between
two factors of interest
One sample drawn
Each factor has two or more levels of responses
Does not show nature of relationship
Does not show causality
Is similar to testing p1 = p2 = … = pc
Is used widely in marketing
Uses contingency table
Chap 10-26
© 2002 Prentice-Hall, Inc.
2 Test of Independence:
Example
1. Set hypothesis:
H0: the two categorical variables (architectural
style and location) are independent
H1: the two categorical variables are related
2. Contingency table:
House Location
House Style Urban Rural Total
Levels of Split-Level 63 49 112
Variable 1 Ranch 15 33 48
Total 78 82 160
f0 fe
2
Chap 10-30
© 2002 Prentice-Hall, Inc.
2 Test of Independence:
Example Solution
H0: The two categorical variables (Architectural Style and
Location) are independent
H1: The two categorical variables are related
df = (r - 1)(c - 1) = 1 Reject
Decision: = .01
Reject H0 at = .01
0 6.635 2
Conclusion:
Since 2 =8.404, there is evidence that the choice of
architectural design and location are related.
Chap 10-31
© 2002 Prentice-Hall, Inc.
2 Test of Independence in
PHStat
PHStat | c-sample tests | chi-square test …
Example solution in excel spreadsheet
Microsoft Excel
Worksheet
Chap 10-32
© 2002 Prentice-Hall, Inc.
Chapter Summary
Performed Z test for differences in two
proportions (independent samples)
Discussed test for differences in two
proportions (independent samples)
Addressed 2 test for differences in c
proportions (independent samples)
Described 2 test of independence
Chap 10-33
© 2002 Prentice-Hall, Inc.