modelIPDmeta <- function(){
for (i in 1:nIPD) { # loop through studies
for(j in 1: npIPD[i]){ # loop through participants
# binomial likelihood
y[i,j] ~ dbern(p[i,j])
# model for linear predictor
logit(p[i,j]) <- u[i]+ delta[i]*treat[i,j]
}
}
# control arm: common effect
for (i in 1:nIPD) {
u[i]~ dnorm(0,0.001)
}
# tretament arm: random effect
for (i in 1:(nIPD) ) {
delta[i]~dnorm(mu,inv.tau.sq)
}
# prior distributions
mu~dnorm(0,1e-6)
inv.tau.sq <- 1/(tau.sq)
tau.sq <- tau*tau
tau~dunif(0,0.1)
}
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.