
Dear users,

  I'm getting the following error when trying to compile my BUGS code: "error for node v[1] of type SpatialCARNormal.Node first argument vector has wrong length.'
    Here, v is a vector that has the car.normal prior of the form: v[1:N] ~ car.normal(Adj[],weights[],Num[],tau.c)

Also,  - Num is vector of length N giving the number of neighbors for each node             - Adj is a vector of length = sum of Num[], with each entry being the index of a neighbor             - weights is a vector of length = sum of Num[], with each entry being 1. The model is syntactically correct and the data loads as well, but I get the above error when I compile. The data file is too large to attach here though I'd be happy to figure out a way to share it otherwise.      I've been stuck on this for over a month now and any help will be greatly appreciated.  I'm using OpenBUGS.


model{  for (i in 1:N) {                Y[i] ~ dbin(p[i], 1)
logit(p[i]) <- b0 + b1*income[i] + v[i]
}
 v[1:N] ~ car.normal(Adj[],weights [],Num[],tau.c)
b0 ~ dflat()
b1 ~ dflat
tau.c ~ dgamma(0.001, 0.001)
}

Regards,
Timothy
[L-Biostat]


	[[alternative HTML version deleted]]

