Thank you for the feedback. I have attempted NB1 without any luck (model did not converge). Adding "time" to the dispersion model did not seem to influence the resulting simulation either. I have been trying several different adjustments to the models without success. The more general issue that motivated my question is covered in depth at https://stats.stackexchange.com/questions/523171/model-misfit-with-dharma-what-needs-can-be-done Kind Regards, Andre ________________________________ Fra: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> p? vegne av r-sig-mixed-models-request at r-project.org <r-sig-mixed-models-request at r-project.org> Sendt: l?rdag 26. juni 2021 12:00 Til: r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org> Emne: R-sig-mixed-models Digest, Vol 174, Issue 21 Send R-sig-mixed-models mailing list submissions to r-sig-mixed-models at r-project.org To subscribe or unsubscribe via the World Wide Web, visit https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models or, via email, send a message with subject or body 'help' to r-sig-mixed-models-request at r-project.org You can reach the person managing the list at r-sig-mixed-models-owner at r-project.org When replying, please edit your Subject line so it is more specific than "Re: Contents of R-sig-mixed-models digest..." Today's Topics: 1. glmmTMB: Including variable in as fixed effect and in dispersion model (Andre Syvertsen) 2. Re: glmmTMB: Including variable in as fixed effect and in dispersion model (Ben Bolker) ---------------------------------------------------------------------- Message: 1 Date: Fri, 25 Jun 2021 10:32:49 +0000 From: Andre Syvertsen <Andre.Syvertsen at uib.no> To: "r-sig-mixed-models at r-project.org" <r-sig-mixed-models at r-project.org> Subject: [R-sig-ME] glmmTMB: Including variable in as fixed effect and in dispersion model Message-ID: <AM0PR0102MB31726D5E121BCF3BE4F6FF5A9E069 at AM0PR0102MB3172.eurprd01.prod.exchangelabs.com> Content-Type: text/plain; charset="utf-8" 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? ------------------------------ Message: 2 Date: Fri, 25 Jun 2021 20:35:52 -0400 From: Ben Bolker <bbolker at gmail.com> To: r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] glmmTMB: Including variable in as fixed effect and in dispersion model Message-ID: <8213affb-ee0d-7839-325e-cdd69630d454 at gmail.com> Content-Type: text/plain; charset="utf-8"; Format="flowed" 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 at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
------------------------------ Subject: Digest Footer _______________________________________________ R-sig-mixed-models mailing list R-sig-mixed-models at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models ------------------------------ End of R-sig-mixed-models Digest, Vol 174, Issue 21 ***************************************************