[R-sig-ME] glmmTMB: Including variable in as fixed effect and in dispersion model
Ben Bolker
bbo|ker @end|ng |rom gm@||@com
Sat Jun 26 02:35:52 CEST 2021
I don't see why not, although to some extent the negative binomial
error structure should account for the phenomenon you're seeing: since
the variance of the nbinom(2) is var = mu*(1+mu/k), the coefficient of
variation is sqrt(var/mu^2) = sqrt(1/mu + k). I'm not sure what you
mean by "sample size decreasing", but for a large mean (mu), the CV
should be approximately constant (~ sqrt(k)), while for small mean the
CV should be increasing with decreasing mu (~ sqrt(1/mu)).
It might be worth trying truncated_nbinom1 as well?
On 6/25/21 6:32 AM, Andre Syvertsen wrote:
> Hi guys,
>
> Is it possible/meaningful to include a variable both as a fixed effect and in the dispersion model? For example, I have run the following model:
>
> m4DaysPlayed <- glmmTMB(daysPlayed ~ 1 + time + ageCategory * gender + (time | id), disp = ~time, dfLong, family = truncated_nbinom2)
>
> Rationale: I want to study the effect of time on the outcome variable, but I have also found evidence for heteorskedasticity when simulating through DHARMa. I suspect that the time variable influences this, the sample size decreases/variation increases as time goes on.
>
> Kind regards,
> Andr�
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list