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:∃i≠j,θ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=xi−niθiniθi(1−θi)∼approxN(0,1)∑i=1KZi2∼χk2=∑(xi−niθiniθi(1−θi))2

Reject H0 if (fix, 130,131)

χobs2=∑(xi−niθ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=∑xi∑niχ2=∑(xi−niθi)2niθi(1−θi)∼χk−12

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

successes failures
sample 1 x1 n1−x1
sample 2 x2 n2−x2
⋮ ⋮ ⋮
sample k xk nk−xk
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=1k∑j=12(fij−Eij)2Eij easier formula=∑i=1k[(xi−niθ0)2niθ0+(ni−xi−ni(1−θ0))2ni(1−θ0)]=∑ik[(xi−niθ0)2(1−θ0)+(ni−xi−ni+niθ0)2θ0niθ0(1−θ0)]=∑i=1k[(xi−niθ0)2(1−θ0)+(xi−niθ0)2θ0niθ0(1−θ0)]χ2=∑i=1k(xi−niθ0)2niθ0(1−θ0)actual definition

when θ0 is given or specified, χ2∼χk2 under H0
when θ0 is not given, θ^=∑xi∑ni 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,…,θij−1=θj−1, where θj's are not specified: (the last column has no freedom)

θ^j=∑fij∑niχ2=∑i∑j(fij−Eij)2Eij∼χdf2df=(k−1)(c−1)=#Ha′s parameters−#H0′s parameters=i(j−1)−(j−1)

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.−xi1−xi2)!θ

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(c−1)

Reject H0 if

χobs2=∑i∑j(fij−Eij)2Eij>χdf,1−α2

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