I’m trying to replicate the winbugs code below:
For the reference group they set it to d[1]<-0. I’m trying to get the same thing, but was having trouble putting a 0 and 6 Normal random variables in the same vector.
I don’t like that I’m creating a normal random variable and then ignoring it. This was going to be a follow-up question.
# Binomial likelihood, logit link
# Fixed effect model
model{ # *** PROGRAM STARTS
for(i in 1:ns){ # LOOP THROUGH STUDIES
mu[i] ~ dnorm(0,.0001) # vague priors for all trial baselines
for (k in 1:na[i]) { # LOOP THROUGH ARMS
r[i,k] ~ dbin(p[i,k],n[i,k]) # binomial likelihood
logit(p[i,k]) <- mu[i] + d[t[i,k]] - d[t[i,1]]
}
}
d[1]<-0 # treatment effect is zero for reference treatment
# vague priors for treatment effects
for (k in 2:nt){ d[k] ~ dnorm(0,.0001) }
} # *** PROGRAM ENDS