[R-sig-ME] Need help on zero-inflated beta model and post-hoc test

Yi-Ru Cheng yc2975 @end|ng |rom co|umb|@@edu
Sun Feb 2 22:08:36 CET 2020


Hi, everyone


I would like to compare the relatedness of individuals among plots. Since
relatedness is bound between 0 and 1 and most of them are zeros, I am
trying to fit with the zero-inflated beta model in the gamlss and glmmTMB
packages. After fitting the model, I want to perform the post-hoc test
between different plots. However, I have some conundrums here.


1.  gamlss

The beta model in the package gamlss gives a pretty good residual plot, but
the post-hoc tests in emmeans and multcomp don't work with the model...Here
is my model.



m1 <- gamlss(r ~ plot + random(year), family = BEINF, data = df)

emmeans(m1, pairwise ~ plot, type="response")

hist(resid(m1))


 "Error in emm_basis.gamlss(object, trms, xlev, grid, misc = attr(data,  :

  gamlss models with smoothing are not yet supported in 'emmeans'"



2. glmmTMB

I then tried the beta family in glmmTMB. For some reason, the simple
residual plot looks pretty skewed, but it looks alright with the scaled
residual plot in DHARMa. Otherwise, the post-hoc test in emmeas works fine.



m2 <- glmmTMB(r ~ plot + (1|year), ziformula =~ 1,  data=df,
family=beta_family(link="logit"))

emmeans(m2, pairwise ~ plot, type="response")

hist(resid(m2))  #skewed

DHARMa::simulateResiduals(m2)  ⇒ no significant deviation



I’m not quite sure why the residual plots give different patterns in two
models.  Is it not correct to look at the residual distribution for
diagnosis? Could I see it’s a green light to use the model in glmmTMB based
on the simulated residuals in the DHAMRMa package even though the simple
residual plot looks skewed? Or is there any other post-hoc test designed
for gamlss with the smoothing process? Any suggestions would be
appreciated. Thanks in advance!


Best,

Yiru

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list