[R-sig-ME] MCMCglmm zero-altered

Brickhill, Daisy r01db11 at abdn.ac.uk
Wed Aug 1 10:18:14 CEST 2012

Thanks Jarrod. I'm afraid it was a case of copying code without testing it and, as you say, it should have read
prior1ZA = list(R = list(V=diag(1), n=0.002), G = list(G1 = list(V=diag(1), n=0.002))) without fix=2. I have tried the trait:units model and I get significant traitza terms so I would like to use the zapoisson rather than the overdispersed poisson.
I suppose what I am asking is can I now go on to use my more complex model with rcov  = ~ idh(trait):units?
Thanks for your help.

-----Original Message-----
From: Jarrod Hadfield [mailto:j.hadfield at ed.ac.uk]
Sent: 31 July 2012 18:53
To: Brickhill, Daisy
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] MCMCglmm zero-altered


To use a ZAP model to test whether there is any zero inflation or deflation effects you want to hold the parameters constant across the Poisson and zero-altered part and compare them to a model in which they vary.

For the random effects this comparison would be random=~colony versus something more complex (idh(trait):colony or us(trait):colony). For the fixed effects you want to compare ~1 versus ~trait and
percent.grass2 versus trait:percent.grass2 etc.

  For the overdispersion term MCMCglmm will not allow you to have the same "residual" for both parts, but ~trait:units allows the "residuals" for both parts to have the same distribution (although
information regarding its variance only comes from the Poisson part).
I believe this still allows valid testing of whether there is any zero-alteration or not (but as always, could be wrong). In the trait:units model you do NOT want to fix the variance: in your second prior you had fix=2 despite estimating a single variance(V=diag(1)) so it was probably ignored anyway.  I thought I had implemented MCMCglmm so it would generate an error if fix>nrow(V) - did you not get this?



Quoting "Brickhill, Daisy" <r01db11 at abdn.ac.uk> on Tue, 31 Jul 2012
16:18:50 +0100:

> Hi,
> I am currently modelling the effect of different habitat variables on
> the numbers of tipulid larvae found in soil cores using MCMCglmm.
> The data is slightly zero inflated so I am trying a zero-altered model
> (among others). I have used the following priors and model:
> prior1ZA = list(R = list(V=diag(2), n=0.002, fix=2), G = list(G1 =
> list(V=diag(2), n=0.002)))
> model1ZA <- MCMCglmm(no._tips ~trait*(percent.grass2 + mean.veg.ht +
> mean.soil.moisture + juldate + year),random = ~ idh(trait):colony,rcov
> = ~ idh(trait):units, family = "zapoisson", data = data, prior =
> prior1ZA, burnin = 3000, nitt = 1003000, thin=1000)
> However I have read in a previous post by the immensely helpful Jarrod
> Hadfield that "It is usual in zero-altered models to have the zero bit
> and the truncated poisson bit have the same over-dispersion. You do
> this by fitting the  interaction rcov=~traits:units."
> I thought that ensuring the poisson and the zero process have the same
> over-dispersion would require priors and model of the form:
> prior1ZA = list(R = list(V=diag(1), n=0.002, fix=2), G = list(G1 =
> list(V=diag(1), n=0.002)))
> model1ZA <- MCMCglmm(no._tips ~trait*(percent.grass2 + mean.veg.ht +
> mean.soil.moisture + juldate + year),random = ~ trait:colony, rcov = ~
> trait:units, family = "zapoisson", data = data, prior = prior1ZA,
> burnin = 3000, nitt = 1003000, thin=1000)
> But looking at other posts I am beginning to think I am missing
> something and that I *can* use my priors and model (with different
> variances for the zero and poisson parts of the model). Is this true?
> Can anyone tell me which of the two residual variance and random
> effect structures is most advisable?
> Many thanks,
> Daisy
> The University of Aberdeen is a charity registered in Scotland, No SC013683.
>       [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

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

The University of Aberdeen is a charity registered in Scotland, No SC013683.

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