# GLMM for unbalanced design, nested random factor or fixed factor?

The Goal Determine if the abundance of ectos differ between sites.

The set up The data is percent abundance of ectomycorrhizal fungi from soil samples. There are ten soil samples per plot and there are three plots per site, except for the last site which only has one plot ( I know, bad design....). Finally there are three sites. If I have to remove the last site with one plot I can. Currently I am running my model with plot nested within site. However I believe I don't have enough levels within the nested factor to do this? My current model is

m2<-glmmTMB(percent~site+(1|site/plot),data=percentabund,family=beta_family(link = "logit"))


I could change the nested random factor plot to a fixed factor?

m2<-glmmTMB(percent~site+(1|plot),data=percentabundunknown,family=beta_family(link = "logit"))


Questions

Have I specified the model correctly?

How do I account for (the unbalanced design)?

I really appreciate any help.

The frst model:

percent~site+(1|site/plot),data=percentabund,family=beta_family(link = "logit")


does not make much sense because you have site as a fixed effect and also a grouping variable for random intercepts.

Also, since you have only 3 sites you would be asking the software to estimate a variance for a normally distributed variable from only 3 observations.

So, here you would want to fit site as a fixed effect, that is, your second model:

percent~site+(1|plot),data=percentabundunknown,family=beta_family(link = "logit")


Edit:

Following some discussion it turns out there are only 3 plots per site (with one exception). I didn't read the question properly :(

So there is a real problem here with insufficient sample size. I think the best you can do is:

percent ~ site + plot


with no random effects. That is, just a GLM model.

It could also be interesting to investigate the GLMM model:

percent ~ site + plot + (1 | site:plot)


With the sample size you have, I wouldn't be too concerned with residual plots. If the GLM gives similar inferences to the GLMM, all is good.

• Thank you! I appreciate you taking the time to answer my question. I am a novice at GLMMs. Just so I know understand the 2nd model correctly. Site is a fixed effect and plot is a nested fixed effect? Sep 29, 2020 at 19:43
• You're welcome, no problem :) In the 2nd model, yes, site is a fixed effect, but plot is a random effect. You can think of plot as nested within site, but that is not important here because we are fitting fixed effects for site. Sep 29, 2020 at 19:53
• Does the fact that I have only 3 plots nested within site and that its unbalanced raise an issue? Sep 29, 2020 at 19:54
• I have a set of abundances and I used the package DHARMa to simulate the residuals which look pretty awful. In my model I am using family=beta_family(link = "logit"). What steps should I take to make fix my residuals? Do I transform the raw data? Also when I run my model I get the summary. I've seen that you can run an ANOVA type three after. When I am reporting the results of my study what do I need to report? Can I say the sites differ? Sorry for so many questions! Sep 29, 2020 at 20:04
• How many plots do you have ? Sep 29, 2020 at 20:06