Why my posterior result always shows that the sigma and sigma.c estimates to be around 50? It should not be that large as I know from another approach of analysis and also summary of the data. Is it because I have only one observation for each year-country combination?
write("
model {
for(i in 1:n) {
life[i] ~ dnorm(a[Country[i]]+ b[Year[i]]+b7*fertrate[i], sigma^(-2))
}
b[1]~dnorm(0,0.0001)
b[2]~dnorm(0,0.0001)
b7~dnorm(0,0.0001)
sigma ~ dunif(0, 100)
for(j in 1:J) {
a[j] ~ dnorm(0 , sigma.c^(-2))
}
sigma.c ~ dunif(0, 100)
}
", "life3.jags")
mm3.jags = jags.model("life3.jags", data=list(J=194, n=376, Country=suit1213d$Country, Year=suit1213d$Year,fertrate=suit1213d$fertrate),n.adapt=100,n.chains=3)
mm3.vars = c("b","b7", "sigma", "sigma.c")
mm3.sim = coda.samples(mm3.jags, mm3.vars, n.iter = 50000,thin=100)
summary(mm3.sim)
Iterations = 5100:55000
Thinning interval = 100
Number of chains = 3
Sample size per chain = 500
1. Empirical mean and standard deviation for each variable,
plus standard error of the mean:
Mean SD Naive SE Time-series SE
b[1] -1.020 96.35 2.4877 2.5759
b[2] -1.447 102.76 2.6533 2.3972
b7 2.383 98.23 2.5362 2.5360
sigma 50.231 28.45 0.7346 0.7204
sigma.c 50.836 28.82 0.7440 0.7432