# Log-linear model vs Multinomial-Dirichlet model for contingency table

Given a 1x3 contingency table of the form

$$[y_1,y_2,y_3]$$

where each $y_i$ represents a count on some random variable $$X\sim Multinomial(n, \pi_1,\pi_2,\pi_3)$$

We can estimate the vector of parameters $[\hat{\pi_1},\hat{\pi_2},\hat{\pi_3}]$ using a Bayesian Multinomial-Dirichlet conjugate model, and then get a sample estimate of the estimand.

$$\pi_1 - \pi_2$$

Could we also get an estimate of the difference of proportions using a glm and avoid MCMC?

Bayesian model taken from here

• Why Dirichlet when you state its a proportion of counts? Multinomial would suffice, no? – Firebug Nov 7 '17 at 18:47
• So maybe I am way over thinking this, but is the mle for $\theta_1 -\theta_2$ the mle for Multinomial($\theta_1$,$\theta_2$,$\theta_3$)? – user2879934 Nov 7 '17 at 18:48
• Basically, I don't get how contingency tables are related to GLMs? this question kind of got away from me – user2879934 Nov 7 '17 at 18:48

## 1 Answer

Yes, you can fit this model using maximum likelihood or as a maximum a-posteriori version and get some estimates. Most regression software would also directly provide you estimates for $\pi_1-\pi_2$ with confidence (or credible) intervals based on the delta method. In contrast to drawing samples from the posterior, you are assuming that a normal approximation to the sampling distribution of the estimates makes sense (possibly after some suitable transformation e.g. to the logit scale). This is not the case when there are very few events. On the other hand, this should be fine, if $x_1$, $x_2$ and $x_3$ are all large, in which case the answers will probably not differ between approaches unless you use quite informative priors in the Bayesian approach.

However, note that you do not really need to do MCMC sampling in the particular case you describe, conjugate updating gives you an analytic posterior for the joint distribution of $\pi_1$, $\pi_2$ and $\pi_3$. You can then either draw independent samples from this distribution and form the difference $\pi_1-\pi_2$ in the samples (no worries about convergence of the MCMC chains). It might even be possible to analytically derive the distribution of the difference $\pi_1-\pi_2$, but I assume that would get rather messy, but numerical integration should be entirely possible.

• I like every part of this answer, but how do GLMs fit in....why is this not a multinomial logistic regression with just an intercept (no covariates) – user2879934 Nov 7 '17 at 18:59
• I guess I was coming from the perspective that a GLM with only an intercept is still a GLM. – Björn Nov 7 '17 at 19:50
• Where is the glm in the answer ? – user2879934 Nov 7 '17 at 19:50