Saaa
Saaa

Reputation: 11

How to use binomial family for non-integers in GLMMTMB?

Here's my model:

revisitsm0 <- glmmTMB(cbind(revisits_per_bout, tot_visits_bout - revisits_per_bout) ~ experiment_type * foraging_bout + (1|colony/bee_id), data=table_training, family=binomial)

My model doesn't fit so well because of dispersion, so I square-rooted my variables "revisits_per_bout" and "tot_visits_bout", hence giving me non-integers.

Since quasibinomial is not available in GLMMTMB, how can I fix this?

Thanks!

Upvotes: 0

Views: 1044

Answers (1)

Ben Bolker
Ben Bolker

Reputation: 226532

This really belongs on CrossValidated, because it is a question of "what to do" more than "how to do it".

  • family = "betabinomial" should be the simplest way to handle overdispersion (I would not recommend transforming the response variable. It is a good rule of thumb that if you have count-type (non-negative integer) responses, it's best to model them on the original scale).
  • if overdispersion seems to be associated with particular predictors (e.g. dispersion is different for different experiment types, even after taking the mean-variance relationship of the beta-binomial into account; you can use the location-scale plot [sqrt(abs(pearson_resids)) vs. the predictor of interest) to assess this, you can use family = "betabinomial" plus a dispformula = argument
  • you could also use an observation-level random effect
  • you can also do a post hoc conversion of a binomial fit to a quasi-binomial fit following the recipe in the GLMM FAQ 'fitting models with overdispersion' section (this link has more general advice/info on methods for dealing with overdispersion)

Upvotes: 3

Related Questions