# [R-sig-ME] Incomplete two-way ANOVA

Chen, Gang (NIH/NIMH) [C] gangchen at mail.nih.gov
Fri Sep 30 23:05:14 CEST 2016

```Suppose that there are two experimental factors A and B, each of which has two levels, leading to 2 x 2 = 4 combinations: A1B1, 2A2B1, A1B2, and A2B2. Typically this would be analyzed with a two-way within-subject (or repeated-measures) ANOVA.

However, data has been only collected with A1B1 and A2B2 from one group with n1 subjects, and with A2B1 and A1B2 from the other group with n2 subjects. A two-way between-subjects ANOVA might be adopted, but that requires an independence assumption among the four combinations, which does not hold. On the other hand, how about a linear mixed-effects model like the
following?

dat <- read.table(text = "
Subj  A  B            y
S1 A1 B1 -0.214137949
S1 A2 B2 -1.714628408
S2 A1 B1 -1.229578334
S2 A2 B2 -1.664862753
S3 A1 B1  0.838064385
S3 A2 B2 -0.368188970
S4 A1 B1  0.002022487
S4 A2 B2  1.399422383
S5 A2 B1  0.995036719
S5 A1 B2  0.752182526
S6 A2 B1 -0.426498651
S6 A1 B2  0.771060004
S7 A2 B1 -1.274627158
S7 A1 B2 -0.256490231
S8 A2 B1 -0.175888411
S8 A1 B2  0.389261459
S9 A2 B1  0.629649580
S9 A1 B2 -0.885086803", header = TRUE)

xtabs(~A+B, data=dat)

B
A    B1 B2
A1  4  5
A2  5  4

fm <- lme(y ~ A*B, data=dat, random=~1|Subj)

anova(fm)
numDF denDF   F-value p-value
(Intercept)     1     8 0.2605135  0.6235
A               1     6 0.5945658  0.4699
B               1     6 0.0831877  0.7827
A:B             1     6 0.6234177  0.4598

Would the above LME approach be valid in this case with total missing data in two cells from each of the two groups? It seems this would violate the missing-at-random assumption. Nothing can be done other than collecting more data?

Thanks,
Gang
```