Chapter 7 Exercises
Kidney transplants
Solutions
In Example 7.3.1 (ordered logistic regression model for kidneys for transplantation), add BUGS code to calculate the probability that three or more indicators of organ damage are present after an agonal phase lasting a) 10 minutes, b) 2 hours and c) 12 hours? What are the posterior medians of these probabilities?
model {
for (i in 1:N) {
Score[i] ~ dcat(p[i,])
p[i,1] <- 1 - Q[i,1]
for (r in 2:5) {
p[i,r] <- Q[i,r-1] - Q[i,r]
}
p[i,6] <- Q[i,5]
for (r in 1:5) {
logit(Q[i,r]) <- b.apd*lAPD[i] - c[r]
}
}
logit(p3.10min) <- b.apd*log(10) - c[3]
logit(p3.2h) <- b.apd*log(2*60) - c[3]
logit(p3.12h) <- b.apd*log(12*60) - c[3]
for (i in 1:5) {
dc[i] ~ dunif(0, 20)
}
c[1] <- dc[1]
for (i in 2:5) {
c[i] <- c[i-1] + dc[i]
}
b.apd ~ dnorm(0, 1.0E-03)
or.apd <- exp(b.apd)
}
Click arrow for data and initial values
node mean sd MC error 2.5% median 97.5% start sample
p3.10min 0.1854 0.03 5.228E-4 0.1308 0.184 0.2477 501 10000
p3.12h 0.5296 0.07838 0.001861 0.3772 0.5294 0.6799 501 10000
p3.2h 0.3661 0.04761 7.603E-4 0.2756 0.3654 0.4628 501 10000
From the posterior medians, we estimate a 18%, 37% and 53% probability that there will be three or more indicators of organ damage after agonal phases of 10 minutes, 2 hours and 12 hours respectively.