Hi,

I am currently learning to use JAGS with rjags. I am starting by trying to

replicate some of the WinBUGS code and results from Royle and Dorazio's

Hierarchical Modeling and Inference in Ecology. The current model I am trying

to fit is a fairly simple hierarchical logistic regression. I am getting

stumped by an error message:

Error in node y

Observed node inconsistent with unobserved parents at initialization

At other times the error has occured in y or y, but these three nodes are the

first 3 non-zero nodes in the y variable. The model specification I am using

is:

model{ for(i in 1:M){ z[i]~ dbern(psi[i]) psi[i] <- ilogit( b0+b1*elev[i]+b2*elev2[i]+b3*forest[i]) y[i]~dbin(z[i]*p,J[i]) } p~dunif(0,1) b0~dnorm(0,.001) b1~dnorm(0,.001) b2~dnorm(0,.001) b3~dnorm(0,.001) }

I have posted my r code and the data here:

https://public.me.com/pokey54

Any help in interpreting or troubleshooting this error is appreciated.

Thanks!