model{ theta ~ dbeta(1,1) for(j in 1:J){ y[j] ~ dbin(theta,m[j]) res[j] <- (y[j]-m[j]*theta)/sqrt(m[j]*theta*(1-theta)) } }