model{ for(i in 1:nattempts){ z.low[i]<-15*(y[i]==0)+0*(y[i]==1) z.up[i]<-25*(y[i]==0)+n*(y[i]==1) z[i]~dbin(theta,n)T(z.low[i],z.up[i]) } # Prior theta~dbeta(1,1)T(15/50,1) }