Dear List, I was trying to use a sum function. Somehow, the error message of 'multiple definition' always comes up. And my model would not compile. I could not figure out where the problem is. Here is my code. model { for (j in 1:N) { for (k in 1:I) { p[j,k] <- (exp(theta[j]-b[k])/(1+exp(theta[j]-b[k]))); r[j,k] ~ dbern(p[j,k] } theta[j] ~ dnorm(0,1); score[j] <- sum(r[j, ]) } for (k in 1:I) { b[k] ~ dnorm(0, .25); sb[k] <- sum(r[,k]) } } Any suggestion about the problem would be highly appreciated. Ru ------------------------------------------------------------------- This list is for discussion of modelling issues and the BUGS software. For help with crashes and error messages, first mail [log in to unmask] To mail the BUGS list, mail to [log in to unmask] Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments to the list. To leave the BUGS list, send LEAVE BUGS to [log in to unmask] If this fails, mail [log in to unmask], NOT the whole list