3

I am running an experiment with 3 different factors arranged in a factorial arrangement 3x3x3 (randomized complete block design with 4 blocks). These experimental plots are also replicated spatially and temporally across 3 locations, and 3 years. Thus, there is a total of 9 siteyears (3 locations x 3 years) representing different growth environments. In order to study the effects of three fixed factors on response variable, I am using the mixed model below –

mixed.model <- lmer(rv ~ f1 + f2 + f3 + f1:f2 + f2:f3 + f3:f1 + (1|siteyear/block), data)

However, my supervisor asked if the effect of factors on response variable changes in different siteyears i.e. if there is an interaction between siteyears and factors (f1, f2, f3). I ran a simple linear model with siteyear as fixed factor (given below) to check for the interaction and found significant interaction of f1 and f2 with siteyear.

l.model <- lm (rv ~ f1 + f2 + f3 + f1:f2 + f2:f3 + f3:f1 + siteyear + siteyear:f1 + siteyear:f2 + siteyear:f3, data)

My main question is that is the mixed model still valid in the presence of interaction of fixed effect with random effect (siteyear)? My understanding is that, by including siteyear as random effect, the interaction is accounted for as well. Is that true, and can you please provide an explanation of how it happens? I am also wondering if there is information on such interaction in the output of mixed model, and that lm model was not required to check interaction. Thank you!

Robert Long
  • 53,316
  • 10
  • 84
  • 148
gsd
  • 143
  • 1
  • 1
  • 6

1 Answers1

2

My understanding is that, by including siteyear as random effect, the interaction is accounted for as well

I don't think this is correct. The random effects (1|siteyear/block) will account for interactions between siteyear and block but not between siteyear and the fixed factors.

Since you seem to have interest in the estimates for the interaction between siteyear and the fixed factors, I would not include siteyear as a grouping variable for random intercepts. Further, since you have only 4 blocks, this is insuficient for fitting random interecepts so I would include block as a fixed effect as well, ie, the second model, but with block as a fixed effect too. If you believe there is additional variation in the response due to the siteyear:block interaction, you might also consider a mixed model with that interaction as a grouping factor:

rv ~ f1 + f2 + f3 + f1:f2 + f2:f3 + f3:f1 + siteyear + siteyear:f1 + siteyear:f2 + siteyear:f3 + (1|siteyear:block)
Robert Long
  • 53,316
  • 10
  • 84
  • 148
  • Thank you for your answer! I guess I am not interested in the estimation of interaction between siteyear and fixed factors, but mindful of their presence. So I guess my question is that, knowing that those interactions are present and significant in my data, does that invalidate the output of my mixed model or not? ie. in the presence of significant interactions between fixed factors and siteyear, are the estimates of F (and p) values for fixed factors by mixed.model still ok, or do I need to change the random effect structure or something else? – gsd Oct 04 '20 at 15:04
  • I am not interested in the estimation of interaction between siteyear and fixed factors, but worried that their presence invalidates the mixed.model listed above in the question? Is that correct, and if yes, what changes can I make in it? Thank you once again for your help! – gsd Oct 04 '20 at 15:07
  • Yes, if there are moderating effects (ie interactions) and you are not incorporating them into your model in some way, then the model will be deficient. Whether or not it is "invalid" will depend on how strong these interactions are and whether you can safely ignore them. So I would recommend including them as fixed effects as in your second model (but with `block` included), and if the inferences that you are interested in are very much the same as the mixed model, then you can go back to the mixed model, since that is more parsimonious and will have more statistical power. – Robert Long Oct 04 '20 at 15:15
  • Ok. Since I am not interested in the main effect of siteyear (it is almost always going to be significant and is not interesting wrt the study), is the following approach alright as well? (in order to keep the model parsimonious and with higher statisitcal power) mm2 – gsd Oct 04 '20 at 17:38
  • I am sorry for too many questions, but interaction b/w fixed effects and a random effect is completely new territory for me. Thanks for your patience! – gsd Oct 04 '20 at 17:39
  • No problem. You are welcome. Even when you are not interested in the main effect of a variable that is included in an interaction, it very rarely makes sense to exclude it from the model. The main effects and the interactions are linked. This has been discussed quite a few times here, for example here: https://stats.stackexchange.com/questions/11009/including-the-interaction-but-not-the-main-effects-in-a-model – Robert Long Oct 04 '20 at 17:44
  • One last point. Did you not recommend random slopes mixed model since it will get too complicated with two separate fixed factors changing across siteyear, or was there another different consideration? – gsd Oct 05 '20 at 17:52
  • Your post didn't mention anything about random slopes. I wouldn't try to fit random slopes unless I had a good *a priori* reason to. With random interecpts, we typically have repeated measures / clustering of observations, and that is an *a priori* reason to fit them. – Robert Long Oct 05 '20 at 18:32