I’m working with proportion data and have tried several models to address issues of overdispersion and underdispersion. Initially, I used a binomial distribution model which showed overdispersion. After introducing an OLRE (Overdispersed Random Effect), I encountered underdispersion. Then, I fitted the model using beta_family, which resolved the overdispersion and underdispersion issues. However, when checking the residual plot, a pattern appears.
`The variables are scaled, and the model I’m using is as follows:
bdd$prop <- (bdd$tot_paras) / bdd$puesta
y <- cbind(bdd$tot_paras, bdd$nac)
bdd$prop <- pmax(pmin(bdd$prop, 1 - 1e-5), 1e-5)
y <- pmax(pmin(bdd$prop, 1 - 1e-5), 1e-5)
mpt5 <- glmmTMB(y ~ altsca * coastsca * infestsca * NAO_t1sca +
(1|site) + (altsca|year) + (1|id),
family = beta_family(),
data = bdd)
Here are the results from the summary of the model:
summary(mpt5)
Family: beta ( logit )
Formula: y ~ altsca * coastsca * infestsca * NAO_t1sca + (1 | sitio) +
(altsca | year) + (1 | id)
Data: bdd
AIC BIC logLik deviance df.resid
-3046.9 -2910.8 1545.5 -3090.9 3581
Random effects:
Conditional model:
Groups Name Variance Std.Dev. Corr
sitio (Intercept) 0.32707 0.5719
year (Intercept) 0.04375 0.2092
altsca 0.02278 0.1509 0.84
id (Intercept) 0.65928 0.8120
Number of obs: 3603, groups: sitio, 35; year, 12; id, 3603
Dispersion parameter for beta family (): 7.25
Conditional model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.85460 0.14358 -5.952 2.65e-09 ***
altsca -0.59531 0.13203 -4.509 6.52e-06 ***
coastsca -0.09911 0.12997 -0.763 0.445730
infestsca 0.15908 0.03603 4.415 1.01e-05 ***
NAO_t1sca -0.08945 0.06985 -1.281 0.200322
altsca:coastsca -0.39947 0.17170 -2.327 0.019987 *
altsca:infestsca 0.01210 0.04966 0.244 0.807511
coastsca:infestsca -0.10618 0.06121 -1.735 0.082811 .
altsca:NAO_t1sca 0.08227 0.05643 1.458 0.144869
coastsca:NAO_t1sca -0.09151 0.03187 -2.871 0.004088 **
infestsca:NAO_t1sca 0.08243 0.02259 3.649 0.000263 ***
altsca:coastsca:infestsca -0.11711 0.07914 -1.480 0.138915
altsca:coastsca:NAO_t1sca -0.08114 0.04026 -2.015 0.043858 *
altsca:infestsca:NAO_t1sca -0.01356 0.02488 -0.545 0.585860
coastsca:infestsca:NAO_t1sca -0.02923 0.03031 -0.964 0.334825
altsca:coastsca:infestsca:NAO_t1sca -0.07461 0.03592 -2.077 0.037795 *
Results from the overdispersion check:
performance::check_overdispersion(mpt5)
Overdispersion test
dispersion ratio = 0.887
p-value = 0.12
No overdispersion detected.
Here is the residual plot showing the pattern:
enter image description here
And here is the plot of observed vs predicted values:
[enter image description here](https://i.sstatic.net/oXP7O4A4.png)
KSN2 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.