# Two-way mixed effects ANOVA model

Consider the two-way ANOVA model with mixed effects : $$Y_{i,j,k} = \underset{M_{i,j}}{\underbrace{\mu + \alpha_i + B_j + C_{i,j}}} + \epsilon_{i,j,k},$$ with $\textbf{(1)}$ : $\sum \alpha_i = 0$, the random terms $B_j$, $C_{i,j}$ and $\epsilon_{i,j,k}$ are independent, $B_j \sim_{\text{iid}} {\cal N}(0, \sigma_\beta^2)$, $\epsilon_{i,j,k} \sim_{\text{iid}} {\cal N}(0, \sigma^2)$ ; and there are two possibilities for the random interactions : $\textbf{(2a)}$ : $C_{i,j} \sim_{\text{iid}} {\cal N}(0, \sigma_\gamma^2)$ or $\textbf{(2b)}$ : $C_{i,j} \sim {\cal N}(0, \sigma_\gamma^2)$ for all $i,j$, the random vectors $C_{(1:I), 1}$, $C_{(1:I), 2}$, $\ldots$, $C_{(1:I), J}$ are independent, and $C_{\bullet j}=0$ for all $j$ (which means that mean of each random vector $C_{(1:I), j}$ is zero).

Model $\textbf{(1)}$ + $\textbf{(2a)}$ is the one which is treated by the nlme/lme4 package in R or the PROC MIXED statement in SAS. Model $\textbf{(1)}$ + $\textbf{(2b)}$ is called the "restricted model", it satisfies in particular $M_{\bullet j} = \mu + B_j$. Do you think one of these two models is "better" (in which sense) or more appropriate than the other one ? Do you know whether it is possible to perform the fitting of the restricted model in R or SAS ? Thanks.

-

Is the question not clear ?.. – Stéphane Laurent Jan 12 '12 at 9:50
According to the book "Design and Analysis of Gauge R&R Studies" (Richard K. Burdick, Connie M. Borror, Douglas C. Montgomery) this question is discussed in Section 7.2 of the book "Confidence intervals on variance components" (Richard K. Burdick, Franklin A. Graybill). – Stéphane Laurent Apr 23 '12 at 19:19
So which model is better? – Henrik Apr 23 '12 at 21:01
I do not have the book ! – Stéphane Laurent Apr 24 '12 at 4:52

## 1 Answer

I will try to give an answer, but I am not sure if I understood your question correctly. Hence, first some clarification on what I tried to answer (as you will see, I am not mathematician/statistician).

We are talking about a classical split-plot design with the following factors: experimental unit $B$, repeated-measures factor $C$ (each experimental unit is observed under all levels of $C$), and fixed-effect factor $\alpha$ (each experimental unit is observed under only one level of $\alpha$; I am not sure why $\sum \alpha_i = 0$, but as there needs to be a fixed factor, it seems to be $\alpha$).

Model $\textbf{(1)}$ + $\textbf{(2a)}$ is the standard mixed-model with crossed-random effects of $B$ and $C$ and fixed effect $\alpha$.

Model $\textbf{(1)}$ + $\textbf{(2b)}$ is the standard split-plot ANOVA with a random effects for $B$, the repeated-measures factor $C$ and fixed effect $\alpha$.

That is, $\textbf{(1)}$ + $\textbf{(2a)}$ does not enforce/assumes a specific error strata, whereas $\textbf{(1)}$ + $\textbf{(2b)}$ enforces/assumes variance homogeneity and sphericity.

You could fit $\textbf{(1)}$ + $\textbf{(2a)}$ using `lme4`:

````m1 <- lmer(y ~ alpha +  (1|B) + (1|C))
````

You could fit $\textbf{(1)}$ + $\textbf{(2b)}$ using `nlme`:

````m2 <- lmer(y ~ alpha * C, random = ~1|C, correlation = corCompSymm(form = ~1|C))
````

Notes:

• Note that there is one difference between the two models namely that `m1` does not have the $B \times C$ interactions. Experts on `lme4` will probably be able to help you with it.
• To enforce the sphericity for $\textbf{(2b)}$ when using `lme` I use a compound correlation structure. See my answer to another question for more practical stuff on this use of `lme`. As far as I get it, it is kind of difficult/mpossible to extend this approach to more than one repeated-measures factor.
• You will need a `data` argument in both calls.
-
I don't believe your proposal for (1)+(2b) is correct. Nothing looks like the constraint $C_{\bullet j}=0$ in your model m2. – Stéphane Laurent Apr 24 '12 at 5:00

1
Hmm, I have to say that then, I dont get it. Can you clarify in a little less mathematical terms, what this constraint means? – Henrik Apr 24 '12 at 6:31
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 52, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9071180820465088, "perplexity_flag": "middle"}