model { Tau.noninformative <- 1.0E-4 P.gamma <- 1.0E-4 Tau.err <- 25 for (i in 1:N) { Y[i] ~ dnorm(y[i], Tau.err) # above ground weight X[i] ~ dnorm(x[i], Tau.err) # below ground weight y[i] <- q[i] * w[i] x[i] <- (1 - q[i]) * w[i] logit(q[i]) <- a + re[i] w[i] <- exp(log.w[i]) log.w[i] ~ dnorm(0, Tau.noninformative) # total weight } a ~ dnorm(0, Tau.noninformative) for (i in 1:N) { re[i] ~ dnorm(0, tau) } tau ~ dgamma(P.gamma, P.gamma) }