*Bounty: 100*

*Bounty: 100*

The 2-by-2 contingency table test provides an alternate hypothesis testing approach to the $z$ test for proportion difference. Conveniently enough, a 2-by-*k* contingency table test provides an omnibus test for proportion difference, akin to the one-way ANOVA’s test for mean difference:

One-way ANOVA $H_{0}: mu_{1} = mu_{2} = cdots = mu_{k}$

2-by-$k$ contingency table test $H_{0}: p_{1} = p_{2} = cdots = p_{k}$

If we reject the null hypothesis in the 2-by-$k$ contingency table test, we could proceed to conduct *post hoc* pairwise comparisons using the *z* test for proportion difference between groups $i$ and $j$, where the test statistic is given by:

$$z = frac{hat{p}*{i}-hat{p}*{j}}{sqrt{hat{p}left(1-hat{p}right)left[frac{1}{n_{i}}+frac{1}{n_{j}}right]}}$$

And where (I *think*) $hat{p}$ creates the pooled estimate assuming the contingency table’s null hypothesis is true (i.e. $hat{p}$ is the total number of events divided by the total sample size across all $k$ groups).

**Question 1: How to incorporate this pooled estimate into post hoc pairwise 2-by-2 contingency table tests (i.e. $chi^{2}$ tests)? (bonus points if you can speak to continuity corrections)**

Contingency table tests are also useful for posing questions about evidence of association between two categorical variables where *both* have more than 2 categories. For an $l$-by-$k$ contingency table test, where $l>2$ and $k>2$, if we reject the null hypothesis and wish to proceed to conduct *post hoc* subgroup tests:

**Question 2a: How do we incorporate the pooled variance under the $l$-by-$k$ contingency table test’s null hypothesis for post hoc 2-by-2 table tests (i.e. $chi^{2}$ tests)? (bonus for continuity corrections)**

**Question 2b: How do we incorporate the pooled variance under the $l$-by-$k$ contingency table test’s null hypothesis for post hoc $m$-by-$n$ contingency table tests (i.e. $chi^{2}$ tests), either $2<mle l$ OR $2<nle k$, or $2<mle l$ AND $2<nle k$, and these tests ARE disjoint (i.e. they do not overlap on the $l$-by-$k$ contingency table).**

**Question 2c: How do we incorporate the pooled variance under the $l$-by-$k$ contingency table test’s null hypothesis for post hoc $m$-by-$n$ contingency table tests (i.e. $chi^{2}$ tests), either $2<mle l$ OR $2<nle k$, or $2<mle l$ AND $2<nle k$, and these tests ARE NOT disjoint (i.e. they do overlap on the $l$-by-$k$ contingency table).**