drizopoulos/GLMMadaptive

Support for effects-package

Closed this issue · 5 comments

I have read in the news-file from the dev-version that the effects-package is supported. I tried to compute effects from the first model in your ZI-vignette (https://drizopoulos.github.io/GLMMadaptive/articles/ZeroInflated_and_TwoPart_Models.html), but I get an error:

effects::Effect(c("sex", "time"), fm1)
#> Error: 'family' argument seems not to be a valid family object

Is support not fully working yet?

This is still under development indeed. For the standard families (i.e., binomial() and poisson()) is seems to work out of the box. However, the rest of the families provided in the package (e.g., zi.poisson(), zi.negative.binomial(), hurdle.poisson(), hurdle.negative.binomial()) are custom-made and do not include all the standard components of a family object.

It seems that effects::Effect.default() tries to fit a glm() using the provided family, and this is where it fails. However, it is not clear to me, why it is needed to re-fit a model given that all components can be extracted from the already fitted model. Also because the glm() fitted will not be a GLMM.

I just saw that emmeans is supported as well, so that would be sufficient. Which type options are available? Is it also possible to get emm's for the response from zero-inflated models where the emm's are conditioned on the ZI-part?

I have now implemented this in GLMMadaptive_0.4-99999. You can use emmeans(...) for the fixed effects in the non-zero part, and emmeans(..., mode = "zero_part") for the fixed effects in the zero part.

Thanks, I'll check this later and give feedback!

Thanks, works like a charme!

I have cross-checked the results with a similar ZI-model fitted with glmmTMB and they match very well.

I have started implementing support for GLMMadaptive models in my sjstats and ggeffects packages. GLMMadpative looks promising! And I thought it might be a good idea to feature MixMod-objects in my packages as well, despite the existing functions in GLMMadpative (like effectPlotData()).