I have been trying this run this command to estimate two parameters pop.mean and tau.
model
{
for( i in 1 : N )
{
r[i] ~ dbin(p[i], n[i]) #Model
b[i] ~ dnorm(mu, prec.tau2)
logit(p[i]) <- b[i]
}
mu ~ dnorm(0.0,1.0E-6) #Priors
prec.tau2 ~dgamma(0.001,0.001)
tau <- sqrt(1/prec.tau2)
pop.mean <- exp(mu)/(1+exp(mu))
}
#Data
list(n = c(47, 148, 119, 810, 211, 196, 148, 215, 207, 97, 256, 360),
r = c(0, 18, 8, 46, 8, 13, 9, 31, 14, 8, 29, 24), N = 12)
#Initial Values
list(p = c(0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1),
mu = 0, prec.tau2 = 1)
However an error pops up stating "this initial value does not correspond to a stochastic node" Can anyone help me with this solution.
I tried changing the initial values however I am unable to load the units and further proceed in estimating the two parameters.