| 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) |
| } |
| } |