model{ for(i in 1:N){ k[i]~dbin(theta[i],n) theta[i]<-thetalow[i]*(g[i]==0)+thetaup[i]*(g[i]==1) } # Prios for(i in 1:N){ g[i]~dbern(0.5) thetaup[i]~dnorm(muup,lambda) thetalow[i]~dnorm(mulow,lambda) } mulow~dbeta(1,1) muup~dunif(mulow,1) lambda~dgamma(0.001,0.001) }