Bayes factor for independence in the 2×3 table

Section of Bayesian hypotheses and model comparison, part of Bayesian statistics

Bayes factor for independence in the 2×3 table

Type Section
Taught in Bayesian hypotheses and model comparison
Part Bayesian statistics

Let M_1 be the unrestricted six-cell multinomial and M_2 impose independence of gender and response. We assign equal model probabilities, so the prior odds are one. This is a stated modelling choice, not an automatic default.

Unrestricted model M_1

Main article: Unrestricted model M₁

Under

{\boldsymbol{p}}\mid M_1\sim\operatorname{Dirichlet}(1,1,1,1,1,1),

the prior density is

\frac{\Gamma(6)}{\Gamma(1)^6}=120.

The fact that a uniform density equals 120 rather than 1 reflects the volume of the five-dimensional simplex.

Let C=501!/\prod_{k=1}^6x_k! be the multinomial coefficient. Then \begin{aligned} p({\boldsymbol{x}}\mid M_1) &=\int C\prod_{k=1}^6p_k^{x_k}\,120\,\mathrm{d}{\boldsymbol{p}}\\ &=120C\,B(x_1+1,\ldots,x_6+1)\\ &=120\frac{501!}{\prod_kx_k!} \frac{\prod_k\Gamma(x_k+1)}{\Gamma(501+6)}\\ &=120\frac{501!}{\prod_kx_k!} \frac{\prod_kx_k!}{\Gamma(507)}\\ &=\frac{501!\Gamma(6)}{\Gamma(507)}\\ &=\binom{506}{5}^{-1}\\ &=3.690091\times10^{-12}. \end{aligned} The cell factorials cancel, so this prior predictive probability is the same for every six-cell count vector with total 501.

Independence model M_2

Main article: Independence model M₂

Write

p_{ij}=r_i c_j, \qquad r_1+r_2=1, \qquad c_1+c_2+c_3=1.

Use independent uniform priors

(r_1,r_2)\sim\operatorname{Dirichlet}(1,1), \qquad (c_1,c_2,c_3)\sim\operatorname{Dirichlet}(1,1,1).

Their joint density is

\frac{\Gamma(2)}{\Gamma(1)^2} \frac{\Gamma(3)}{\Gamma(1)^3}=1\cdot2=2.

Substituting p_{ij}=r_ic_j into the cell likelihood and grouping row and column exponents gives \begin{align*} \prod_{i=1}^2\prod_{j=1}^3p_{ij}^{x_{ij}} &=\prod_{i,j}(r_ic_j)^{x_{ij}}\\ &=\prod_i r_i^{\sum_jx_{ij}} \prod_j c_j^{\sum_ix_{ij}}\\ &=r_1^{257}r_2^{244} c_1^{146}c_2^{95}c_3^{260}. \end{align*} The marginal likelihood separates into two Dirichlet integrals: \begin{aligned} p({\boldsymbol{x}}\mid M_2) &=2C \int r_1^{257}r_2^{244}\,\mathrm{d}{\boldsymbol{r}} \int c_1^{146}c_2^{95}c_3^{260}\,\mathrm{d}{\boldsymbol{c}}\\ &=2C\,B(258,245)B(147,96,261)\\ &=9.212201\times10^{-15}. \end{aligned}

The Bayes factor is therefore \begin{align*} \operatorname{BF}_{12} &=\frac{3.690091\times10^{-12}} {9.212201\times10^{-15}}\\ &=400.57. \end{align*} With equal prior odds, the posterior odds are 400.57:1, giving

\mathbb{P}(M_1\mid{\boldsymbol{x}}) =\frac{400.57}{1+400.57}\approx0.9975, \qquad \mathbb{P}(M_2\mid{\boldsymbol{x}})\approx0.0025.

Under the specified models and priors, the table is strong evidence that response depends on gender.

A frequentist likelihood-ratio or Pearson \chi^2 analysis of the same table would probably reach the same qualitative conclusion by different workings. A frequentist comparison is not carried out here, so this is calibration, not a claim that the two inferential statements or their assumptions are identical.

The departure is visible in the raw rates:

\frac{147}{257}\approx0.572, \qquad \frac{113}{244}\approx0.463.

Under independence, the expected male-negative count based on observed margins is

\frac{257\cdot146}{501}\approx74.9,

compared with 53 observed.

Bayes factors automatically average over unused parameter space, creating a complexity penalty. They are also sensitive to parameter priors because Equation (4) in Bayesian hypotheses and model comparison averages over the whole prior. A responsible model comparison therefore checks defensible alternatives such as uniform, Jeffreys, and weakly informative Dirichlet concentrations.

Used in

See also

Posterior hypothesis probability · Bayes action for two hypotheses · Posterior-odds factorisation · Marginal likelihood and Bayes factor · A hypothesis region is not a separate model · Probability statements and decisions · Poisson imperfect-fruit example · Bayes factors and posterior odds

Glossary and index