Beruflich Dokumente
Kultur Dokumente
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.
Hand Preference
sample size = n = 300:
Gender Left Right
120 Females, 12
were left handed Female 12 108 120
180 Males, 24 were
left handed Male 24 156 180
36 264 300
STAT
2
for the 2 x 2 case has 1 degreeof freedom
Decision Rule:
2 2
χ
If STAT χ α , reject H0,
otherwise, do not reject
H0 0
Do not Reject H0 2
reject H0
2α
24-Oct-18 Chi square tests 8
Computing the
Average Proportion
The average X1 X 2 X
p
proportion is: n1 n2 n
i.e., based on all 300 persons the proportion of left handers is 0.12,
that is, 12%
24-Oct-18 Chi square tests 9
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Finding Expected Frequencies
Hand Preference
Gender Left Right
Observed = 12 Observed = 108
Female 120
Expected = 14.4 Expected = 105.6
Observed = 24 Observed = 156
Male 180
Expected = 21.6 Expected = 158.4
36 264 300
2
The test statisticis χ STAT 0.7576; χ02.05 with1 d.f. 3.841
Decision Rule:
If STAT > 3.841, reject H0,
2
Here,
0.05 2 2
χ STAT χ
=0.7576 < 0.05 = 3.841,
so we do not reject H0 and
0
Do not Reject H0 2 conclude that there is not
reject H0 sufficient evidence that the two
20.05 = 3.841 proportions are different at =
0.05
24-Oct-18 Chi square tests 13
2 Test of Independence
(continued)
Where:
row total = sum of all frequencies in the row
column total = sum of all frequencies in the column
n = overall sample size
If χ 2 χ 2 , reject H ,
0
STAT α
2
Where χ α is from the chi-squared distribution
with (r – 1)(c – 1) degrees of freedom
30 70 Total 70 88 42 200
10.5
24-Oct-18
200 Chi square tests 19
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Example: The Test Statistic
(continued)
( f o f e )2
2
χ STAT
all cells
fe
( 24 24 .5 ) 2 ( 32 30 .8 ) 2 ( 10 8.4 ) 2
0.709
24 .5 30 .8 8.4
2
The test statistic is χ STAT 0.709 ; χ 02.05 with 6 d.f. 12.592
Decision Rule:
2
If χ STAT > 12.592, reject H0,
otherwise, do not reject H0
0.05 Here,
2 2
χ STAT = 0.709 < χ 0.05 = 12.592,
so do not reject H0
0
Do not Reject H0 2 Conclusion: there is not
reject H0 sufficient evidence that meal
20.05=12.592 plan and class standing are
related at = 0.05
24-Oct-18 Chi square tests 21
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?
( fo fe ) 2
2
fe
• Reject H0 if
2 2
α
(with k – 1 degrees
of freedom) 0 2
Do not Reject H0
reject H0 2
24-Oct-18 Chi square tests 27
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Chi-Square Test Statistic
H0: The distribution of calls is uniform
over days of the week
HA: The distribution of calls is not uniform
(290 246) 2
(250 246) 2
(192 246) 2
2 ... 23.05
246 246 246
k – 1 = 6 (7 days of the week) so
use 6 degrees of freedom:
2.05 = 12.5916
= .05
Conclusion:
2 = 23.05 > 2 = 12.5916 so
reject H0 and conclude that the 0 2
Do not Reject H0
distribution is not uniform reject H0
2.05 = 14.0671
Conclusion: =.05
2 = 12.097 < 2 = 14.0671 so
0 2
do not reject H0 Do not Reject H0
reject H0
24-Oct-18 Chi square tests 2.05 = 14.0671 35
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Example
Decision Rule:
If the p-value is < , reject H0, otherwise, do not
reject H0
Here,
p=value not < so do not reject H0
Conclusion: There is not sufficient evidence that brand
preference and age group are related at = .05