Test of k proportions

the chi-squared test of a single proportion is the square of the z-test

2 choices

Binomial Distribution

H0:θ1=θ2==θk=(θ0) vs Ha:ij,θiθj

If the ni are sufficiently large for each population, we construct k independent test statistics

E(Xi)=niθi,Var(Xi)=niθi(1θi)

By CLT:

Zi=xiniθiniθi(1θi)approxN(0,1)i=1KZi2χk2=(xiniθiniθi(1θi))2

Reject H0 if (fix, 130,131)

χobs2=(xiniθi)2niθi(1θi)χk,1α2

When θ0 is not given (testing only if they are not the same), we need to estimate it first

θ^0=xiniχ2=(xiniθi)2niθi(1θi)χk12

X1,,Xk observations from k independent trials of size n1,,nk

successes failures
sample 1 x1 n1x1
sample 2 x2 n2x2
sample k xk nkxk
Let fij be the observed frequency in the ith row and jth column
Under the hypothesis that θ1=θ2==θk=θ0, the expected cell frequencies Eij's are given by
E(Xi1)=niθ0=Ei1,E(Xi2)=ni(1θ0)=Ei2χ2=i=1kj=12(fijEij)2Eij easier formula=i=1k[(xiniθ0)2niθ0+(nixini(1θ0))2ni(1θ0)]=ik[(xiniθ0)2(1θ0)+(nixini+niθ0)2θ0niθ0(1θ0)]=i=1k[(xiniθ0)2(1θ0)+(xiniθ0)2θ0niθ0(1θ0)]χ2=i=1k(xiniθ0)2niθ0(1θ0)actual definition

when θ0 is given or specified, χ2χk2 under H0
when θ0 is not given, θ^=xini to compute Eij's, then χ2χ12 under H0

With more than 2 choices

If instead of success and failure we have multiple choices, a Multinomial Distribution instead

choice 1 choice 2 choice 3
sample 1 x1 y1 z1
sample 2 x2 y2 z2
sample k xk yk zk

Not testing the rows

(Xi,Yi,Zi)Multinomial(ni,(θi1,θi2,(1θi1θi2))) (last term not estimated)

H0: all θi1's are equal, all θi2's are equal, ...
Ha: not all θi1's are equal or not all θi2's are equal or ...

Under the H0:θi1=θ1,,θij1=θj1, where θj's are not specified: (the last column has no freedom)

θ^j=fijniχ2=ij(fijEij)2Eijχdf2df=(k1)(c1)=#Has parameters#H0s parameters=i(j1)(j1)

Reject H0 if

χobs2>χdf,1α2

Testing rows

jθij=1, jXij=ni.

For each population i

(Xi1,Xi2,Xi3)Multinomial(ni.,(θi1,θi2,1θi1θi2))(Xi1,Xi2)Multinomial(ni.,(θi1,θi2)P(Xi1=xi1,Xi2=xi2)=ni.!xi1!xi2!(ni.xi1xi2)!θ

Testing if θi1's and θi2's are equal

H0:iθi1=θ1,θi2=θ2,Ha:iθi1θ1,or θi2θ2

When θj's are given, the df=k(c1)

Reject H0 if

χobs2=ij(fijEij)2Eij>χdf,1α2

Association Test between the rows and columns if we want to determine their independency