Skip to main content
7 of 10
added residual plots
Juanchi
  • 389
  • 5
  • 14

Two factor ANOVA with repeated measures by mixed model (lmer)

I did a simple experiment with trees: 5 species (sp) and two management (trt). I assessed the diameter (diam) through the time (month=1:24) and I'm interesting in the factors interaction effect, I mean if the management is suitable for some species.

The dataset has some limitations since it is not balanced, so in 2 out of 10 factors combinations (sp*trt) I have 4 trees (subjects) and for the rest there are 5 trees:

       sp    trt trees
1       A      L     5
2       A      W     5
3       B      L     5
4       B      W     5
5       C      L     5
6       C      W     5
7       P      L     4
8       P      W     5
9       T      L     5
10      T      W     4

I fitted the following model:

m1 <- lmer(diam ~ trt * sp * month + (1|tree), data = dat1)

I'm not sure if I'm doing right, mainly if the model is right...

enter image description here

Juanchi
  • 389
  • 5
  • 14