8
$\begingroup$

I am interested in using a generalised linear mixed model with a response variable (values ranging from 0.001-0.999) that best fits a beta distribution when checked using the 'fitdistrplus' package and the 'descdist()' function in R.

enter image description here

I understand that with mixed-models it is the distribution of the residuals that is important, not the distribution of the raw data points. A QQ-plot of the model residuals also indicates non-normality.

enter image description here

I'm hesitant to transform the data. From what I have seen, the beta distribution is not listed as an option in 'glmer'. I also believe that the package 'betareg' does not allow inclusion of random effects. I've come across two other packages: 'GLMMadaptive' and 'glmmTMB', both of which permit specification of 'family=beta' in the model. The manuals for these packages are very high level and I'm struggling to understand whether either of these packages, or an alternative, would help me to run a mixed-model on this non-normally distributed data.

Can anyone advise about the use of these packages ('GLMMadaptive' or 'glmTMB') or recommend a package or code for a generalised linear mixed model that allows a beta distribution?

Thanks very much in advance!

$\endgroup$

1 Answer 1

7
$\begingroup$

Please note that there is no requirement, condition, or assumption regarding the distribution of the variables in any regression model. When the data are strictly positive and bounded then the beta distribution is often a very good choice.

GLMMadaptive and glmmTMB both allow for the beta distribution. Since you seem to be familiar with glmer then glmmTMB would be the easist choice for you since all you have to do is specify family = beta_family()

As for the residuals, since it's a beta model there is not expectation that the residuals would be normally distributed. The DHARMa package has some good functionality for assessing the residuals from a beta model.

$\endgroup$
3
  • $\begingroup$ Thank you Robert, that's a great help. I ran the model with both lmer and glmTMB (beta_family) and I get similar results (i.e., there were no surprises), which I think is a good sign. $\endgroup$
    – sbooth
    Commented Jun 30, 2021 at 10:59
  • $\begingroup$ You're welcome. Glad I could help ! $\endgroup$ Commented Jun 30, 2021 at 12:59
  • $\begingroup$ Apologies, I'm new to this. Upvoted and marked as answered, thanks again! $\endgroup$
    – sbooth
    Commented Jul 25, 2021 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.