8. Factorial Designs#

This page contributed by Jason Naramore!

Factorial Designs (Two-way ANOVA)#

In two-way ANOVA we are looking at the treament effects based on 2 factors. The model is defined as:

\[\begin{split}\begin{align*} y_{ijk} & = \mu + \alpha_i + \beta_j + (\alpha \beta )_{ij} + \epsilon_{ijk} \\ \mu_i & = \mu + \alpha_i + \beta_j + (\alpha \beta )_{ij} \\ \epsilon_{ijk} & \sim N(0,\sigma^2) \end{align*}\end{split}\]

where \(\alpha_i\) represents the treatment effects of Factor 1 with levels \(i=1,2,...,a\) and \(\beta_j\) represents the treatment effect of Factor 2 with levels \(j=1,2,...,b\). Notice there is also an interaction term \((\alpha \beta )_{ij}\). Like one-way ANOVA, \(\mu\) is the grand mean of \(y\) for all data. \(\epsilon\) is the error, and assumed to be normally distributed with a common variance \(\sigma^2\).

Again, like one-way ANOVA, we need to use either sum-to-zero (STZ) or corner constraints to have an acceptable degrees of freedom. STZ constraints involve setting \(\sum\alpha_i = 0\), \(\sum\beta_i = 0\), and \(\sum(\alpha \beta)_{ij} = 0\). Corner constraints involve setting \(\alpha_1 = 0\), \(\beta_1 = 0\), \((\alpha \beta)_{1j} = (\alpha \beta)_{i1} = 0\).

The first null hypothesis to test is the interaction terms \(H_{01}: (\alpha \beta)_{ij} = 0\). If \(H_{01}\) is not rejected, then we can proceed to test the null hypotheses of the main effects \(H_{02}: \alpha_i = 0\) and \(H_{03}: \beta_i = 0\).

The Bayesian model can be constructed as :

\[\begin{split} \begin{align*} y_{ij} & \sim N(\mu_{ij},\sigma^2) && \text{likelihood}\\ \\ \mu & \sim N(0,\sigma_0^2) && \text{prior: grand mean}\\ \mu_{ij} & = \mu + \alpha_i + \beta_j + (\alpha \beta )_{ij} && \text{deterministic relationship}\\ \alpha_i & \sim N(0,\sigma_i^2) && \text{prior: } \alpha_i\\ \beta_j & \sim N(0,\sigma_j^2) && \text{prior: } \beta_j\\ \tau &\sim Ga(0.001,0.001) && \text{prior: } \tau\\ \sigma^2 & = 1/\tau && \text{deterministic relationship}\\ \\ \text{Subject to: } & \sum \alpha_i = 0 && \text{STZ constraint for } \alpha\\ & \sum \beta_i = 0 && \text{STZ constraint for } \beta\\ & \sum (\alpha \beta)_{ij} = 0 && \text{STZ constraint for } \alpha \beta \text{ interaction}\\ \end{align*}\end{split}\]

\(\sigma_0^2\), \(\sigma_i^2\), anf \(\sigma_j^2\) are representing prior variances of the grand mean and treatment groups for each factor. Non-informative variances might be something like \(\sigma_0^2 = \sigma_i^2 = \sigma_j^2 = 1000\).