model {
for (i in 1:8) {
y[i] ~ dbin(p[i], n[i])
logit(p[i]) <- alpha + beta*(x[i] - mean(x[])) phat[i] <- y[i]/n[i] yhat[i] <- n[i]*p[i] } alpha ~ dnorm(0, 0.0001) beta ~ dnorm(0, 0.0001) } Data:
list(x = c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839),
n = c(59, 60, 62, 56, 63, 59, 62, 60),
y = c(6, 13, 18, 28, 52, 53, 61, 60))

Inits:
list(alpha = 50, beta = 0)

   node   mean   sd   MC error   2.5%   median   97.5%   start   sample
   alpha   0.7478   0.1377   0.001263   0.4806   0.7466   1.024   1001   10000
   beta   34.58   2.928   0.03235   29.12   34.51   40.58   1001   10000
   p[1]   0.05907   0.01592   1.598E-4   0.03296   0.0574   0.09385   1001   10000
   p[2]   0.1636   0.0279   2.604E-4   0.1134   0.1622   0.2218   1001   10000
   p[3]   0.361   0.03381   2.828E-4   0.2948   0.3608   0.428   1001   10000
   p[4]   0.6052   0.03133   2.72E-4   0.5417   0.6056   0.6657   1001   10000
   p[5]   0.7955   0.02616   2.637E-4   0.742   0.7959   0.8445   1001   10000
   p[6]   0.9031   0.01861   2.01E-4   0.8636   0.9043   0.9363   1001   10000
   p[7]   0.9548   0.01173   1.3E-4   0.9289   0.956   0.9745   1001   10000
   p[8]   0.9786   0.006963   7.81E-5   0.9628   0.9795   0.9897   1001   10000
   yhat[1]   3.485   0.9391   0.009426   1.945   3.387   5.537   1001   10000
   yhat[2]   9.815   1.674   0.01563   6.805   9.732   13.31   1001   10000
   yhat[3]   22.38   2.096   0.01753   18.28   22.37   26.53   1001   10000
   yhat[4]   33.89   1.755   0.01523   30.33   33.91   37.28   1001   10000
   yhat[5]   50.11   1.648   0.01661   46.75   50.14   53.2   1001   10000
   yhat[6]   53.29   1.098   0.01186   50.95   53.35   55.24   1001   10000
   yhat[7]   59.2   0.727   0.008062   57.59   59.27   60.42   1001   10000
   yhat[8]   58.72   0.4178   0.004686   57.77   58.77   59.38   1001   10000