[R-sig-ME] fitting a MCMCglmm zero-inflated model

Jarrod Hadfield j.hadfield at ed.ac.uk
Mon Oct 23 10:50:04 CEST 2017


Hi,

You've missed a comma after the random argument.

At the moment you are fitting a single effect of x4, x5,x6 and x7 for 
both the zi and the Possion processes. Presumably you only intend to fit 
effects for these terms for the Poisson part? I would use the formula:

y ~ trait - 1 + at.level(trait,1):(offset+x1+x2+x3+x4+x5+x6+x7)

Your priors are strong too - I would use nu=0.002 rather than nu=2.

Cheers,

Jarrod


On 23/10/2017 09:28, dani wrote:
> Dear list members,
>
>
> I need some advice regarding fitting a MCMCglmm zero-inflated model.
>
>
> I fitted a zero-inflated Poisson model with a single zero inflation parameter for all observations (ziformula~1) in glmmTMB. I would now like to run a similar model based on MCMCglmm.<http://aka.ms/weboutlook>
>
> I must confess I am not sure I understood how to use the at.level term to model interactions with covariates at level 1 in my model. It is not clear to me how to specify the prior.
>
> My model has an offset term and two cross-classified random groups, as well as the following variables:
>   - Level 1 variables:                   x1, x2, and x3
>   - Level 2 (group 1) variable:   x4
>   - Level 2 (group 2) variables: x5, x6, and x7
>
> Here is the code:
>
> priori <- list(R=list(V=diag(2), n=2,fix=2),
>                 G=list(G1=list(V=diag(2), n=2),G2=list(V=diag(2), n=2)))
>
> model <- MCMCglmm(y ~ trait - 1 + at.level(trait,1):offset +
>                    at.level(trait,1):x1 +
>                    at.level(trait,1):x2 +
>                    at.level(trait,1):x3 +
>                    x4+ x5 + x6+x7 ,
>                    random = ~idh(trait):group1 + idh(trait):group2
>                   family = "zipoisson",
>                   prior = priori,
>                   rcov = ~idh(trait):units,
>                   data = mydata)
>
> I am getting the following message:
> Error in cbind_all(x) : Argument 2 must have names
>
> As I am pretty sure that my prior and my at.level terms specification are all kinds of wrong:) , I am not worried at this point about the error message, but I would like to ask advice as to how to properly specify this model.
>
> Thank you all for your constant help, this list is amazing!
> Best regards, everyone,
> Dani NM
>
>
> 	[[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.



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