I need help to find the error in the WINBUGS code (version 1.4.3).
So far, the model looks correct in the step "Model specification". However, trying to load data, I got this error:
array index is greater than upper bound of array for phi3
Can someone please help me? My model is below:
model { for(w in 1: W){ m[w] <- n[w]-y1[w] h[w] <- n[w]-y1[w]-y2[w] y1[w] ~ dbin(delta[w],n[w]) y2[w] ~ dbin(theta[w],m[w]) y3[w] ~ dbin(eta[w],h[w]) y4[w] <- n[w]-y1[w]-y2[w]-y3[w] logit(delta[w]) <- mu1+theta1[a[w]]+phi1[p[w]]+psi1[c[w]] logit(theta[w]) <- mu2+theta2[a[w]]+phi2[p[w]]+psi2[c[w]] logit(eta[w]) <- mu3+theta3[a[w]]+phi3[p[w]]+psi3[c[w]] }
source share