I am conducting a GLMM for a meta-analysis using the beta distribution with the package glmmTMB. My response variable is a vector of correlations (No exact 0 or 1), but Fisher’s transformation fails to normalize the data so this is why I use the beta distribution. Because this is a meta-analysis, I have included sample size as a weights argument. Below is the code:
model <- glmmTMB(Y ~ unit*class + (1|study/pair), weights = weights, family=list(family="beta",link="logit"), data = data)
where unit is a factor with two levels, class is a factor with four levels and pair is a random effect nested within study. Each study measured correlation for two traits, forming a “pair” within each “study”. Now, I am unsure as to the best approach for generating residuals for diagnostic purposes. Using the residuals function;
plot(y = residuals(model), fitted(model, type = "response"))
yields the following graph. I am however unsure if this approach is appropriate, given the general uncertainty about residuals of beta-distributed models.If it is appropriate, I am equally unsure as whether they violate the assumption of homogeneity or not, as there seems to be a downward trend. I assume the two parallel bounds are from the beta distribution, which is fine as far as I understand it. However, I do not know these models enough to be comfortable with diagnosing the residuals they provide.
Below is the plot of observed values against fitted values, which seems good to me (correlation of 0.776).
Alternatively, using DHARMa seems promising, but the simulate.glmmTMB() function does not seem to be implemented for the beta family.
I have also consulted the following papers, suggested here: Similar question on beta residuals, but I have no idea how they could be implemented in R.
Pereira (2017). On quantile residuals in beta regression. Communications in Statistics - Simulation and Computation. doi: doi.org/10.1080/03610918.2017.1381740. See https://arxiv.org/abs/1704.02917 for a pre-print.
Espinheira, Santos, & Cribari-Neto (2017). On nonlinear beta regression residuals. Biometrical Journal, 59. doi: 10.1002/bimj.201600136
Espinheira, Ferrari, Cribari-Neto (2008). On beta regression residuals. Journal of Applied Statistics, 35. doi: 10.1080/02664760701834931
Espnheira, Ferrari, & Cribari-Neto (2008). Influence diagnostics in beta regression. Computational Statistics and Data Analysis, 52. doi: 10.1016/j.csda.2008.02.028
Would anyone be able to suggest the best approach to generate the appropriate residuals for this type of model , for diagnostic purposes, and how to implement it in R? Or whether the ones I currently have are appropriate?