model {
for (i in 2:N) { # remove Bristol
y[i] ~ dbin(theta, n[i])
}
theta ~ dunif(0, 1)
# predicted number of deaths in centre 1 (Bristol)
y1.pred ~ dbin(theta, n[1])
P.bris <- step(y1.pred-y[1]-0.00001) + 0.5*equals(y1.pred, y[1])
}
Data:
list(N = 12, y=c(41,25,24,23,25,42,24,53,26,25,58,31),
n=c(143,187,323,122,164,405,239,482,195,177,581,301))
node mean sd MC error 2.5% median 97.5% start sample
P.bris 0.0 0.0 1.0E-12 0.0 0.0 0.0 1001 10000
y1.pred 16.05 3.81 0.04069 9.0 16.0 24.0 1001 10000