|
| 1 | +--- |
| 2 | +layout: definition |
| 3 | +mathjax: true |
| 4 | + |
| 5 | +author: "Joram Soch" |
| 6 | +affiliation: "BCCN Berlin" |
| 7 | +e_mail: "joram.soch@bccn-berlin.de" |
| 8 | +date: 2022-11-06 13:41:00 |
| 9 | + |
| 10 | +title: "Two-way analysis of variance" |
| 11 | +chapter: "Statistical Models" |
| 12 | +section: "Univariate normal data" |
| 13 | +topic: "Analysis of variance" |
| 14 | +definition: "Two-way ANOVA" |
| 15 | + |
| 16 | +sources: |
| 17 | + - authors: "Bortz, Jürgen" |
| 18 | + year: 1977 |
| 19 | + title: "Zwei- und mehrfaktorielle Varianzanalyse" |
| 20 | + in: "Lehrbuch der Statistik. Für Sozialwissenschaftler" |
| 21 | + pages: "ch. 12.2, pp. 538ff." |
| 22 | + url: "https://books.google.de/books?id=lNCyBgAAQBAJ" |
| 23 | + - authors: "ttd" |
| 24 | + year: 2021 |
| 25 | + title: "Proof on SSAB/s2~chi2(I-1)(J-1) under the null hypothesis HAB: dij=0 for i=1,...,I and j=1,...,J" |
| 26 | + in: "StackExchange CrossValidated" |
| 27 | + pages: "retrieved on 2022-11-06" |
| 28 | + url: "https://stats.stackexchange.com/questions/545807/proof-on-ss-ab-sigma2-sim-chi2-i-1j-1-under-the-null-hypothesis" |
| 29 | + |
| 30 | +def_id: "D182" |
| 31 | +shortcut: "anova2" |
| 32 | +username: "JoramSoch" |
| 33 | +--- |
| 34 | + |
| 35 | + |
| 36 | +**Definition:** Let there be two factors $A$ and $B$ with levels $i = 1, \ldots, a$ and $j = 1, \ldots, b$ that are used to group measurements $y_{ijk} \in \mathbb{R}$ from distinct objects $k = 1, \ldots, n_{ij}$ into $a \cdot b$ categories $(i,j) \in \left\lbrace 1, \ldots, a \right\rbrace \times \left\lbrace 1, \ldots, b \right\rbrace$. |
| 37 | + |
| 38 | +Then, in two-way analysis of variance (ANOVA), these measurements are assumed to come from [normal distributions](/D/norm) |
| 39 | + |
| 40 | +$$ \label{eq:anova2-p1} |
| 41 | +y_{ij} \sim \mathcal{N}(\mu_{ij}, \sigma^2) \quad \text{for all} \quad i = 1, \ldots, a, \quad j = 1, \ldots, b, \quad \text{and} \quad k = 1, \dots, n_{ij} |
| 42 | +$$ |
| 43 | + |
| 44 | +with |
| 45 | + |
| 46 | +$$ \label{eq:anova2-p2} |
| 47 | +\mu_{ij} = \mu + \alpha_i + \beta_j + \gamma_{ij} |
| 48 | +$$ |
| 49 | + |
| 50 | +where |
| 51 | + |
| 52 | +* $\mu$ is called the "grand mean"; |
| 53 | + |
| 54 | +* $\alpha_i$ is the additive "main effect" of the $i$-th level of factor $A$; |
| 55 | + |
| 56 | +* $\beta_j$ is the additive "main effect" of the $j$-th level of factor $B$; |
| 57 | + |
| 58 | +* $\gamma_{ij}$ is the non-additive "interaction effect" of category $(i,j)$; |
| 59 | + |
| 60 | +* $\mu_{ij}$ is the [expected value](/D/mean) in category $(i,j)$; and |
| 61 | + |
| 62 | +* $\sigma^2$ is common [variance](/D/var) across all categories. |
| 63 | + |
| 64 | +Alternatively, the model may be written as |
| 65 | + |
| 66 | +$$ \label{eq:anova2-alt} |
| 67 | +\begin{split} |
| 68 | +y_{ijk} &= \mu + \alpha_i + \beta_j + \gamma_{ij} + \varepsilon_{ijk} \\ |
| 69 | +\varepsilon_{ijk} &\sim \mathcal{N}(0, \sigma^2) |
| 70 | +\end{split} |
| 71 | +$$ |
| 72 | + |
| 73 | +where $\varepsilon_{ijk}$ is the [error term](/D/slr) corresponding to observation $k$ belonging to the $i$-th level of $A$ and the $j$-th level of $B$. |
| 74 | + |
| 75 | +As the two-way ANOVA model is underdetermined, the parameters of the model are additionally subject to the constraints |
| 76 | + |
| 77 | +$$ \label{eq:anova2-cons} |
| 78 | +\begin{split} |
| 79 | +\sum_{i=1}^{a} w_{ij} \alpha_i &= 0 \quad \text{for all} \quad j = 1, \ldots, b \\ |
| 80 | +\sum_{j=1}^{b} w_{ij} \beta_j &= 0 \quad \text{for all} \quad i = 1, \ldots, a \\ |
| 81 | +\sum_{i=1}^{a} w_{ij} \gamma_{ij} &= 0 \quad \text{for all} \quad j = 1, \ldots, b \\ |
| 82 | +\sum_{j=1}^{b} w_{ij} \gamma_{ij} &= 0 \quad \text{for all} \quad i = 1, \ldots, a |
| 83 | +\end{split} |
| 84 | +$$ |
| 85 | + |
| 86 | +where the weights are $w_{ij} = n_{ij}/n$ and the total sample size is $n = \sum_{i=1}^{a} \sum_{j=1}^{b} n_{ij}$. |
0 commit comments