Random effects and fixed effects in GLMM I have the following model written. I have chosen for field as a random factor. I understood that an interaction between a fixed and random will be written as a fixed effect. As a result, I have the following model:
myGLMM4R <- glmmTMB(spp.richness ~ treatment + moment_datacollection + treatment * moment_datacollection +
                      (1|field) + field*treatment + field * moment_datacollection  ,
                   data = metaspecies, na.action = na.fail)

After model selection (dredge) the following model is selected: Model: spp.richness ~ field + moment_datacollection + treatment + (1 | field) + field:moment_datacollection
I was wondering why field is included in this model both as fixed and random. Is that because the interaction includes field and is a fixed effect? Is it a problem that field is now twice in the model? I included field as a random effect, to lower the df. But now it is included also as a fixed effect so will increase the df. Is there a way to solve this?
Thanks!

I found the problem myself and is actually quite simple. Due to the fact that I have written the model the following
spp.richness ~ treatment + moment_datacollection + treatment*moment_datacollection +(1|field) + field*treatment + field*moment_datacollection

Here I have written the interaction using an asterisk (*). Therefor R will take the interaction field&treatment and both factors also separate field and treatment . Because the interaction is written as a fixed factor, both separated factors are also fixed factors.
By using a colon (:) instead of an asterisk (*) in the model, R will take only the interaction, and not both factors also septerated.
spp.richness ~ treatment + moment_datacollection + treatment:moment_datacollection +(1|field) + field:treatment + field:moment_datacollection

therfore after model selection I get now the following model
Model: spp.richness ~ moment_datacollection + treatment + (1 | field) + field:moment_datacollection

