0

I would like to know how to write random effects of two interacting factors. For example, I have 6 species which were planted in 48 plots and replicated in two blocks. There are in total 48 combinations (all possible 1, 2, 3, 5, and 6 species combinations ) for the 6 species.

By design, combinations are actually nested within diversity: the combinations are the correct replicates for each diversity level; hence the effect of diversity should be tested against the (random) variation among combinations within diversity levels.Since, diversity or species richness is a continuous variable I can't consider combinations are nested within diversity.

I would like to make the interaction between block and combination as random effect. I am not sure how to write in properly in mixed models in R. Thanks

1 Answers1

1

In the standard R mixed model notation (going back to Doug Bates's nlme package), treating the interaction between block and combination as a random effect would be (1|block:combination), i.e. the baseline (intercept) value of your response variable varies according to a Gaussian distribution across {block × combination} values.

This should work for most mixed-model packages in R: nlme, lme4, brms, GLMMadaptive ...

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453