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

dani orchidn at live.com
Mon Oct 23 10:28:48 CEST 2017


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]]



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