1

I have a variable called "duration_bout" which corresponds to a duration in seconds. Here's what the distribution looks like:

distribution

It looks like a Poisson distribution, but my durations are a continuous variable. If I transform my data to integers, Poisson fits rather well: glmmTMB model

I think what I really have here is rather a gamma distribution, but I can't figure out how to use this family in glmmTMB! Several questions:

  • family=gamma() asks me to define an "x" parameter; what is it?
  • How come Poisson model fits? How correct is it to tranform my data to integers in order to use it?

Thanks!

Adam Quek
  • 6,973
  • 1
  • 17
  • 23
Saaa
  • 11
  • 2
  • Try with capital `g` e.g. `Gamma` – user20650 Jul 02 '22 at 13:24
  • Tried already, it is giving me this error: "Warning in (function (start, objective, gradient = NULL, hessian = NULL, : NA/NaN function evaluation" even though none of my variables contain empty data – Saaa Jul 02 '22 at 13:33
  • 1
    its giving a *Warning* not an *error*. But you could try to help the optimiser with a log link; `Gamma(link="log")` – user20650 Jul 02 '22 at 14:24
  • Thank you @user20650, that helped! I also square-rooted the data and my model fits really nicely now :) – Saaa Jul 02 '22 at 14:39
  • some links: https://cran.r-project.org/web/packages/glmmTMB/vignettes/troubleshooting.html ; https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#gamma-glmms – user20650 Jul 02 '22 at 21:18

0 Answers0