11.3 The two-factor random effects model
Suppose both factors of a two-factor experiment are random: \(a\) levels of \(A\) and \(b\) levels of \(B\), each sampled from a population, with \(n\) replicates of every combination. The model is \[ y_{ijk} = \mu + \tau _i + \beta _j + (\tau \beta )_{ij} + \varepsilon _{ijk} , \] where \(\tau _i \sim N(0, \sigma ^2_\tau )\), \(\beta _j \sim N(0, \sigma ^2_\beta )\), \((\tau \beta )_{ij} \sim N(0, \sigma ^2_{\tau \beta })\) and \(\varepsilon _{ijk} \sim N(0, \sigma ^2)\), all independent. Then \(\Var (y_{ijk}) = \sigma ^2_\tau + \sigma ^2_\beta + \sigma ^2_{\tau \beta } + \sigma ^2\), and the hypotheses are \(\sigma ^2_\tau = 0\), \(\sigma ^2_\beta = 0\) and \(\sigma ^2_{\tau \beta } = 0\). The sums of squares are those of the fixed effects analysis. One lemma does most of the work.
Lemma 11.3.1. If the random vector \(w \in \mathbb R^m\) has \(E(w) = 0\) and \(\Var (w) = vI\), and \(P\) is an orthogonal projection, then \(E\|Pw\|^2 = v\operatorname {rank}(P)\).
Proof. \(E\|Pw\|^2 = E(w^\top Pw) = \operatorname {tr}(P\Var (w)) = v\operatorname {tr}(P)\), and the trace of a projection is its rank. □
Two cases are used repeatedly. If \(w_1, \dots , w_m\) are independent with variance \(v\), centring is a projection of rank \(m - 1\), so \(E\sum _i(w_i - \bar w)^2 = (m - 1)v\). For an \(a \times b\) array of independent \(w_{ij}\) of variance \(v\), the double centring \(w_{ij} - \bar w_{i\cdot } - \bar w_{\cdot j} + \bar w_{\cdot \cdot }\) is a projection of rank \((a - 1)(b - 1)\), and the map from \(w\) to the array of row-mean deviations \(\bar w_{i\cdot } - \bar w_{\cdot \cdot }\) (each repeated \(b\) times) is a projection of rank \(a - 1\), so \begin {gather*} E\sum _i\sum _j(w_{ij} - \bar w_{i\cdot } - \bar w_{\cdot j} + \bar w_{\cdot \cdot })^2 = (a - 1)(b - 1)v , \\ E\sum _i(\bar w_{i\cdot } - \bar w_{\cdot \cdot })^2 = \frac {(a - 1)v}b . \end {gather*}
Theorem 11.3.2. In the two-factor random effects model, \begin {align*} E(MS_A) &= \sigma ^2 + n\sigma ^2_{\tau \beta } + bn\sigma ^2_\tau , & E(MS_B) &= \sigma ^2 + n\sigma ^2_{\tau \beta } + an\sigma ^2_\beta , \\ E(MS_{AB}) &= \sigma ^2 + n\sigma ^2_{\tau \beta } , & E(MSE) &= \sigma ^2 . \end {align*}
Each \(SS/E(MS)\) is a \(\chi ^2\) variable on its degrees of freedom, and the four sums of squares are independent.
Proof. Averaging the model, \[ \bar y_{i\cdot \cdot } - \bar y_{\cdot \cdot \cdot } = (\tau _i - \bar \tau ) + \bigl (\overline {(\tau \beta )}_{i\cdot } - \overline {(\tau \beta )}_{\cdot \cdot }\bigr ) + (\bar \varepsilon _{i\cdot \cdot } - \bar \varepsilon _{\cdot \cdot \cdot }) , \] the \(\beta _j\) cancelling. The three terms are independent with mean zero, so the expected sum of squares over \(i\) is the sum of three expectations, which the lemma gives as \((a - 1)\sigma ^2_\tau \), \((a - 1)\sigma ^2_{\tau \beta }/b\) and \((a - 1)\sigma ^2/(bn)\) (the \(\bar \varepsilon _{i\cdot \cdot }\) are independent with variance \(\sigma ^2/(bn)\)). As \(SS_A = bn\sum _i(\bar y_{i\cdot \cdot } - \bar y_{\cdot \cdot \cdot })^2\), \[ E(SS_A) = (a - 1)(bn\sigma ^2_\tau + n\sigma ^2_{\tau \beta } + \sigma ^2) . \] \(B\) is the same with the roles of the factors exchanged. For the interaction, all main effects cancel from the double centring of the cell means \(\bar y_{ij\cdot }\), leaving the double centrings of \((\tau \beta )_{ij}\) and of \(\bar \varepsilon _{ij\cdot }\), so \[ E(SS_{AB}) = n\bigl [(a - 1)(b - 1)\sigma ^2_{\tau \beta } + (a - 1)(b - 1)\sigma ^2/n\bigr ] , \] and \(E(SSE) = ab(n - 1)\sigma ^2\) as before.
For the distributions, write \(\bar J_m = \frac 1m\mathbf 1\mathbf 1^\top \) and order \(y\) by \(i\), then \(j\), then \(k\). The covariance matrix of \(y\) is \[ \Var (y) = \sigma ^2_\tau \,I_a \otimes J_b \otimes J_n + \sigma ^2_\beta \,J_a \otimes I_b \otimes J_n + \sigma ^2_{\tau \beta }\,I_a \otimes I_b \otimes J_n + \sigma ^2 I , \] with \(J_m = m\bar J_m\). Writing each \(I_m = \bar J_m + (I_m - \bar J_m)\) and expanding expresses \(\Var (y)\) as \(\sum _X\lambda _XP_X\), where \(P_A = (I_a - \bar J_a) \otimes \bar J_b \otimes \bar J_n\) and the other \(P_X\) are the mutually orthogonal projections whose squared lengths \(\|P_Xy\|^2\) are the sums of squares, and the coefficient \(\lambda _X\) is exactly the expected mean square above. Then \(P_Xy\) is normal with covariance \(\lambda _XP_X\), the vectors \(P_Xy\) are uncorrelated and hence independent, and \(\|P_Xy\|^2/\lambda _X \sim \chi ^2_{\operatorname {rank}P_X}\). □
The expected mean squares determine the tests. The interaction is tested against error, but the main effects are tested against the interaction: \begin {gather*} H_0 : \sigma ^2_{\tau \beta } = 0 : \quad F_0 = \frac {MS_{AB}}{MSE} , \\ H_0 : \sigma ^2_\tau = 0 : \quad F_0 = \frac {MS_A}{MS_{AB}} , \qquad H_0 : \sigma ^2_\beta = 0 : \quad F_0 = \frac {MS_B}{MS_{AB}} . \end {gather*} In each case the two mean squares have equal expectations under \(H_0\) and are independent scaled \(\chi ^2\) variables, so \(F_0\) has an \(F\) distribution. Using \(MSE\) as the denominator for the main effects, as in the fixed effects analysis, would be wrong whenever \(\sigma ^2_{\tau \beta } > 0\): the test would reject too often. The reason is visible in the model: with new levels of \(B\), the apparent effect of a level of \(A\) changes by an amount of variance \(\sigma ^2_{\tau \beta }/b\), and that is the noise against which a main effect of \(A\) must be judged. The variance components are estimated by \begin {gather*} \hat \sigma ^2 = MSE , \qquad \hat \sigma ^2_{\tau \beta } = \frac {MS_{AB} - MSE}n , \\ \hat \sigma ^2_\tau = \frac {MS_A - MS_{AB}}{bn} , \qquad \hat \sigma ^2_\beta = \frac {MS_B - MS_{AB}}{an} . \end {gather*}
Example 11.3.3. To estimate the sources of variability in a filtration process, concentration (%) was measured for each combination of four operators (\(A\)) and three filters (\(B\)), both chosen at random, with two runs on each combination. The data, with cell totals in brackets, are
| filter | operator \(1\) | operator \(2\) | operator \(3\) | operator \(4\) | total |
| \(1\) | \(62\), \(68\) \((130)\) | \(59\), \(51\) \((110)\) | \(56\), \(59\) \((115)\) | \(49\), \(52\) \((101)\) | \(456\) |
| \(2\) | \(66\), \(69\) \((135)\) | \(60\), \(63\) \((123)\) | \(61\), \(60\) \((121)\) | \(54\), \(46\) \((100)\) | \(479\) |
| \(3\) | \(67\), \(69\) \((136)\) | \(65\), \(69\) \((134)\) | \(64\), \(74\) \((138)\) | \(61\), \(54\) \((115)\) | \(523\) |
| total | \(401\) | \(367\) | \(374\) | \(316\) | \(1458\) |
With \(a = 4\), \(b = 3\), \(n = 2\) and \(C = 1458^2/24 = 88573.5\), \begin {gather*} SS_A = \frac {401^2 + 367^2 + 374^2 + 316^2}6 - C = 630.1667 , \\ SS_B = \frac {456^2 + 479^2 + 523^2}8 - C = 289.75 , \end {gather*} and from the cell totals \(SS_{AB} = 77.5833\); the total is \(SST = 1182.5\), so \(SSE = 185\).
| source | SS | df | MS | \(E(MS)\) | \(F_0\) |
| operators \(A\) | \(630.17\) | \(3\) | \(210.06\) | \(\sigma ^2 + 2\sigma ^2_{\tau \beta } + 6\sigma ^2_\tau \) | \(16.24\) |
| filters \(B\) | \(289.75\) | \(2\) | \(144.88\) | \(\sigma ^2 + 2\sigma ^2_{\tau \beta } + 8\sigma ^2_\beta \) | \(11.20\) |
| \(AB\) | \(77.58\) | \(6\) | \(12.93\) | \(\sigma ^2 + 2\sigma ^2_{\tau \beta }\) | \(0.84\) |
| error | \(185.00\) | \(12\) | \(15.42\) | \(\sigma ^2\) | |
| total | \(1182.50\) | \(23\) |
The interaction is not significant (\(F_0 = 12.93/15.42 = 0.84\), \(F_{0.05, 6, 12} = 3.00\)). Both main effects are, tested against \(MS_{AB}\): \(F_0 = 210.06/12.93 = 16.24\) for operators (\(F_{0.05, 3, 6} = 4.76\), \(P = 0.003\)) and \(F_0 = 144.88/12.93 = 11.20\) for filters (\(F_{0.05, 2, 6} = 5.14\), \(P = 0.009\)). Operators and filters both add to the variability of the process. The variance components are \begin {gather*} \hat \sigma ^2_\tau = \frac {210.06 - 12.93}6 = 32.85 , \qquad \hat \sigma ^2_\beta = \frac {144.88 - 12.93}8 = 16.49 , \\ \hat \sigma ^2 = 15.42 , \end {gather*} and \(\hat \sigma ^2_{\tau \beta } = (12.93 - 15.42)/2 = -1.24\).
The negative interaction estimate says that the interaction component is negligible, and it suggests a reduced model without it. Since the \(F\) statistic for the interaction is below \(1\) (\(P = 0.56\)), a common rule is to pool \(SS_{AB}\) with \(SSE\): the pooled mean square is \((77.58 + 185)/(6 + 12) = 14.59\) on \(18\) degrees of freedom, and in the reduced model \(E(MS_A) = \sigma ^2 + bn\sigma ^2_\tau \), so \begin {align*} \text {operators: } F_0 &= 210.06/14.59 = 14.40 , & \hat \sigma ^2_\tau &= 195.47/6 = 32.58 , \\ \text {filters: } F_0 &= 144.88/14.59 = 9.93 , & \hat \sigma ^2_\beta &= 130.29/8 = 16.29 . \end {align*}
The conclusions are unchanged, but the denominators now have \(18\) degrees of freedom instead of \(6\). Pooling is a decision made after looking at the data, and it is safe only when the evidence for dropping the term is strong: a large \(P\)-value (above about \(0.25\)) and a good reason to expect no interaction. Operators contribute the largest component, about twice the run-to-run error.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.