2013_Ch.15_Notes
Transcript of 2013_Ch.15_Notes
-
8/17/2019 2013_Ch.15_Notes
1/5
QMDS 202 Data Analysis and Modeling
Chapter 15 Chi-Squared Tests
The Contingency Table Test
A Contingency table is one that shows all the classifications of the variables
being studied, that is, it accounts for all contingencies in a particular situation.
For a contingency table that has r rows and c columns, the χ2 test can be
generalized as a test of:
a !ndependence or
b "omogeneity.
The test statistic #( )
∑ −
=i
ii
e
e f 2
2 χ
v # (r – 1)(c – 1)
g
cr i
f
f f e =
f r # row total
f c # column total
f g # grand total
For a test of independence we have one population and we are testing whether two characteristics in the population are independent. $ith a test of homogeneity we
have more than one population and we are testing to see if a characteristic is the same
across populations.
!ndependence Test
"%: A and B are independent
A
a1 a2 a3
B b1
a1∩b1 f 11
a2∩b1 f 12
a3∩b1 f 13 fr 1
b2
a1∩b2
f 21
a2∩b2
f 22
a3∩b2
f 23 fr 2
fc1 fc2 fc3 f g
!f A and B are independent, then
g
r
g
c
f
f
f
f b P a P ba P &&&&&& ''' ×=×=∩
∴The e(pected fre)uency 'ei of 'a1∩b1
&
-
8/17/2019 2013_Ch.15_Notes
2/5
# g
cr g
g
r
g
c g
f
f f f
f
f
f
f f ba P &&&&&& ' =××=×∩
"omogeneity Test
"%: P 'm1| A # P 'm1| B # P 'm1|C
and P 'm2| A # P 'm2| B # P 'm2|C
Samples
A B C
M m1
'm1| A
f 11
'm1| B
f 12
'm1|C
f 13 fr 1
m2
'm2| A
f 21
'm2| B
f 22
'm2|C
f 23 fr 2
fc1 fc2 fc3 f g
fc1 # sample size of first sample
fc2 # sample size of second sample
fc3 # sample size of third sample
!f P 'm1| A# P 'm1| B# P 'm1|C , then all these probabilities e)ual to g
r
f
f m P && ' =
.
*imilarly, P 'm2| A # P 'm2| B # P 'm2|C # g
r
f
f m P 22 ' = .
∴ +(pected fre)uency 'ei of m& in sample A
# ei of 'm1| A # P 'm1| A × sample size of A # &&
c
g
r f f
f ×
+(pected fre)uency 'ei of m2 in sample A
# ei of 'm2| A # P 'm2| A × sample size of A # &2
c
g
r f f
f ×
+(ample & A random sample of % men and -% women were ased whether or not
they lie a certain brand of product. Their responses are shown in the
following table:
/es 0o Total
1en & 2 %$omen 22 34 -%
Total 35 -3 &%%
6se the Chi7s)uare test to test that the liing of both se(es are not
related, using α # %.%.
*olution: "%: The liing of both se(es are not related 'independent
"&: The liing of both se(es are related 'dependentα # %.%
2
-
8/17/2019 2013_Ch.15_Notes
3/5
χ27distribution will be used as the testing distribution.
r # 2 c # 2
v # 'r 8 &'c 8 & # &
9eect "% if T* ; 3.4ei:
4.&,&%%
35,%=
×2.2
&%%
-3,%=
×
2.22&%%
35-%=
×4.35
&%%
-3-%=
×
( ) ( ) ( ) ( )%%52.%
4.35
4.3534
2.22
2.2222
2.2
2.22
4.&,
4.&,& 2222
=−
+−
+−
+−
=TS
T* # %.%%52 is not greater than 3.4 ⇒ Cannot reect "%Conclusion: The liing of both se(es are not related.
+(ample 2 A business firm wants to determine whether the )uality of its product is
the same at all five of its production units. For this purpose it taes a
sample of &%% items at each of its production units and after testing the
items for )uality, obtains the following data. Test whether the
probability of obtaining a satisfactory item is the same for all five
production units, using α # %.%.
6nit & 6nit 2 6nit 3 6nit 6nit Total
*atisfactory items 42
-
8/17/2019 2013_Ch.15_Notes
4/5
( ) ( ) ( )&5.&&
&2
&2&-...
44
44s product have a significant effect in
losing weight, using α # %.%&.
*olution: The re)uired contingency table:
"%:
"&:
α # %.%&
χ27distribution will be used as the testing distribution.
r # c #
v # 'r 8 &'c 8 & #
9eect "% if T* ;
ei:
-
8/17/2019 2013_Ch.15_Notes
5/5
T* #
*tatistical decision:
Conclusion:
9eview ?roblems: &.24, &.2