I've got a completely randomized block design with 4 treatments and 3 replications (blocks). I figured that a mixed model with repeated measures as random terms should be appropriate to analyse this design. We have measured each plot (4 treatments x 3 replications = 12 plots), using means of 3 animals per plot, 4 times per year (Time, every 28 days). We are evaluating the average daily gain (ADG) of animals. Is my model correct?

fit1 <- lmer(ADG ~ Treatment + (1| BLOCO) + (1| Time), data = df)

1 Answer 1


Your model assumes that the measurements taken at different times are uncorrelated, which will probably not be the case in a repeated measures design. One way to handle this with lmer is to fit random slopes for Time:

 lmer(ADG ~ Treatment + (Time| BLOCO), data = df)

Another approach, which I would favour, is to specify a correlation structure for the residual error (within persons). Often an AR(1) structure is appropriate. My approach to this would first be to try a completely unstructured covariance matrix, thus allowing the data to inform the structure. Sometimes such a model encounters trouble with convergence, since there are many more parameters to estimate. lme4::lmer does not support any other than the default covariance structure, so if you want to try others, you can use the mmrm or glmmTMBpackages - both use essentially the same syntax as lmer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.