Skip to main content
. Author manuscript; available in PMC: 2012 Dec 12.
Published in final edited form as: Stat Interface. 2011;4(1):27–36. doi: 10.4310/sii.2011.v4.n1.a4
model {
for (i in 1:N) {
 # Model specification
 # y[i] is disease status
 y[i]~dbern(delta)
 # change outcome to 1 and 2 for matrix
 # indexing rather than 0 and 1
 ix[i] <- y[i] + 1
 # joint distal and neck BMD conditional
 # distributions, lgx is log(BMD), mu/tau are
 # prior mean/var vectors of distal and neck BMD
 lgx[i,1:2]~dmnorm(mu[ix[i],1:2],tau[ix[i],1:2,1:2])
 }
 smallnumber <- 1.0E-5
 # theta is marginal probability of disease
 # in study population
 theta~dbeta(smallnumber, smallnumber)
 for(j in 1:2) {
  # hyper-parameters of Mean/Precision from R
  mu[j,1:2]~dmnorm(Mean[],Prec[,])
  # hyper-parameters of Omega/degFdm from R
  tau[j,1:2,1:2]~dwish(Omega[,],degFdm)
 }
}