[R-sig-ME] zero-inflated models in MCMCglmm

Jarrod Hadfield j.hadfield at ed.ac.uk
Thu Dec 1 07:48:56 CET 2016

Hi Gustaf,

I don't have dat, so I can't run the final bit of code.

However, these are my thoughts.

1/ In the zap model you are allowing X1 to X3 to effect the level of 
zero alteration, whereas in the zip model you are just fitting a 
constant level  of zero inflation across X1 to X3. In this sense the zap 
model will provide a superior fit because it has more parameters. The 
warning message about dropping terms is fine, although the default 
contrast for the zip model is a bit annoying: I would have preferred the 
main effect for X1 to be yes rather than no, but I guess its no big deal.

2/ You have fitted a single nested_plot effect in the random effects. 
This is a little odd, except in the case where the data are not 
zero-inflated. In this case having a single nested_plot term in the zap 
model is equivalent to fitting a nested_plot term in the standard 
Poisson. If the data are zero-inflated, and/or the model is not a zap 
model, then the case for having a single term is not well justified. I 
would use us or idh and in the latter case consider fixing the second 
variance (associated with zero-inflation/alteration) close to zero.

3/ The marginal predictions do not take into account the covariances 
between traits. This is generally OK, but its not ideal when the traits 
refer to the multiple parameters of a single distribution as with 
za/zi/hu models. I should put a warning in. You can also use the 
simulate function on the model and then average over the draws to get 
the predictions, and this will take into account any covariances. Note 
that if you use idh(trait):nested_plot there are no covariances so 
predict should be fine.



On 30/11/2016 23:30, Gustaf Granath wrote:
> cbind(aggregate(y ~ X1*X2*X3_nest, zero.dat, mean),
>       zip = aggregate(p.zip ~ fire*retention*micro_hab.two, dat, 
> mean)$V1,
>       zap = aggregate(p.zap ~ fire*retention*micro_hab.two, dat, 
> mean)$V1,
>       pois = aggregate(p.pois ~ fire*retention*micro_hab.two, dat, 
> mean)$V1)

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

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