I am attempting to fit a linear mixed-effect model in R using lme4
that is quite a bit more complex than any example I've seen in forums or in textbooks. I am having trouble finding the correct code for the random effects in particular. I have two fixed factors (parental environment and germination treatment) and random factor (genetic line); I want to test all 2 and 3-way interactions between these factors. I have two additional fixed factors that I want to test without interactions (provisioning and block). I want to specify random intercepts and slopes for genetic line, but I am not sure how to do this. The dependent variable is biomass.
Is this model specification correct?:
fullmod <- lmer(biomass ~ parental.environment* germination.treatment*
(1+parental.environment*germination.treatment|genetic.line)
+ provisioning + block, biomass.data)
I am also interested in testing the significance of the 3-way interaction parental environment x germination treatment x genetic line by comparing the fit of the reduced model to the full model. What would be the correct model specification for the full model minus this 3-way interaction?