Hi, I'm getting the following error when trying to compile my BUGS code: "error for node phi[1] of type SpatialCARNormal.Node first argument vector has wrong length.' Here, phi is a vector that has the car.normal prior of the form: phi[1:N] ~ car.normal(Adj[],Wts[],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 - Wts is a vector of length = sum of Num[], with each entry being 1. I'm pasting the model code below. 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 v 3.10 on Windows 7 x64. Thanks,Sathya.
model{ for (i in 1:N) { Y[i] ~ dbin(p[i], NumBinom) theta[i] ~ dnorm(0, tau.h) logit(p[i]) <- b.int[i] + b.inc[i]*income[i] + b.pov[i]*poverty[i] + b.une[i]*unemployment[i] + phi[i] + theta[i] } phi[1:N] ~ car.normal(Adj[],Wts[],Num[],tau.c) for (i in 1:NumCounties) { b.int[i] ~ dflat() b.inc[i] ~ dflat() b.une[i] ~ dflat() b.pov[i] ~ dflat() } tau.h ~ dgamma(0.001, 0.001) tau.c ~ dgamma(0.001, 0.001) } [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo