Skip to content

zero-inflated poisson in MCMCglmm: error in if (any(rterms == "animal"))

2 messages · Adrian Jaeggi, Jarrod Hadfield

#
Dear all,

I'm having some troubles running zero-inflated poisson models in  
MCMCglmm and after reading the MCMCglmm Course Notes and the Hadfield  
2010 J Stat Software paper and discussing with colleagues I still  
couldn't figure out the problem so any help here would be greatly  
appreciated!

I am analyzing data from an indigenous population in Bolivia, and in  
this example I'm testing the influence of a person's highest school  
grade on their annual monetary income. Because access to wage labor is  
very limited and recent in this remote population, most people score 0  
on income which is why I want to use zero-inflated poisson. I also  
want to include sampling location (community and region) as random  
effects.

Following a previous thread on this list  
(https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q2/002283.html)  
I used the following code:

   priors <- 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(AnnualIncome~trait+trait:grade-1,
   random=~idh(trait):data.Community+idh(trait):data.Region,
   rcov~idh(trait):units, prior=priors, pl=TRUE, family="zipoisson",
   data=mydata)

Running this code returns the following error message (roughly  
translated from German):
   error in if (any(rterms == "animal")) { :
    missing value where TRUE/FALSE is necessary

I have no idea what this error message refers to. I understand the  
"animal" comes from the blue tits example in the package but I don't  
see what it refers to here and why this evaluation fails to return  
TRUE or FALSE.

Thanks so much for any help with this!
Best regards,
Adrian
#
Hi Adrian,

rcov~idh(trait):units should read rcov=~idh(trait):units

Note that your priors may be quite informative with nu=2.

Cheers,

Jarrod
On 9 Mar 2011, at 17:18, Adrian Jaeggi wrote: