Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
288 Some Elementary Statistical Inferences

experiment is repeatednindependent times andXijdenotes the frequency of the
eventAi∩Bj. Since there arek=absuch events asAi∩Bj, the random variable

Qab− 1 =

∑b

j=1

∑a

i=1

(Xij−npij)^2
npij

has an approximate chi-square distribution withab−1 degrees of freedom, provided
thatnis large. Suppose that we wish to test the independence of theAand theB
attributes, i.e., the hypothesisH 0 :P(Ai∩Bj)=P(Ai)P(Bj),i=1, 2 ,...,a;j=
1 , 2 ,...,b. Let us denoteP(Ai)bypi.andP(Bj)byp.j. It follows that

pi.=

∑b

j=1

pij,p.j=

∑a

i=1

pij,and 1 =

∑b

j=1

∑a

i=1

pij=

∑b

j=1

p.j=

∑a

i=1

pi..

Then the hypothesis can be formulated asH 0 :pij=pi.p.j,i=1, 2 ,...,a;j=
1 , 2 ,...,b.TotestH 0 ,wecanuseQab− 1 withpij replaced bypi.p.j.Butif
pi.,i=1, 2 ,...,a,andp.j,j=1, 2 ,...,b, are unknown, as they frequently are
in applications, we cannot computeQab− 1 once the frequencies are observed. In
such a case, we estimate these unknown parameters by


pˆi·=Xni·,whereXi·=

∑b

j=1

Xij,fori=1, 2 ,...,a,

and

pˆ·j=Xn·j,whereX·j=

∑a

i=1

Xij,forj=1, 2 ,...,b.

Since


ipi.=


jp.j= 1, we have estimated onlya−1+b−1=a+b−2 parameters.
So if these estimates are used inQab− 1 ,withpij=pi.p.j, then, according to the
rule that has been stated in this section, the random variable

∑b

j=1

∑a

i=1

[Xij−n(Xi./n)(X.j/n)]^2
n(Xi./n)(X.j/n)

(4.7.2)

has an approximate chi-square distribution withab− 1 −(a+b−2) = (a−1)(b−1)
degrees of freedom provided thatH 0 is true. For a specified levelα,thehypothesis
H 0 is then rejected if the computed value of this statistic exceeds the 1−αquantile
of aχ^2 -distribution with (a−1)(b−1) degrees of freedom. This is theχ^2 - testfor
independence.
For an illustration, reconsider Example 4.1.5 in which we presented data on hair
color of Scottish children. The eye colors of the children were also recorded. The
complete data are in the following contingency table (with additionally the marginal
sums). The contingency table is also in the filescotteyehair.rda.

Free download pdf