### Mauscript: A Bayesian framework for performance assessment and comparison ### of imaging biomarker quantification methods ### Authors: Brian J Smith and Reinhard R Beichel ### File Description: R code for manuscript results ### Date Modified: October 13, 2017 ### Installation of companion R package qibm ### Source and instructions: https://github.com/brian-j-smith/qibm library(devtools) install_github("brian-j-smith/qibm") ### Load required packages ### Note that required software JAGS (http://mcmc-jags.sourceforge.net/) ### must be installed separately library(dplyr) library(ggplot2) library(qibm) ### Load dataset data(hnc) ### Figure 1 x11(7,6) ggplot(hnc, aes(method, Volume)) + geom_boxplot() + labs(x = "Segmentation Method", y = "Volume (ml)") ### Bayesian model fit ### Burnin includes an adaptation sequence of 1000 non-MCMC iterations help(qibm) fit <- qibm(log(Volume) ~ method, lesion, operator, data = hnc, n.burnin = 6000, n.iter = 205000, n.thin = 20, n.chains = 1, priors = list(sigma.opr.lim = c(0, 2), sigma.imgopr.lim = c(0, 2), sigma.err.lim = c(0, 2))) ### Table 2 with(fit, exp(mu)) %>% describe %>% print(digits = 2) with(fit, exp(sqrt(diag(Sigma.img)))) %>% describe %>% print(digits = 2) with(fit, exp(sqrt(sigma.opr^2 + sigma.imgopr^2))) %>% describe %>% print(digits = 2) with(fit, exp(sigma.err)) %>% describe %>% print(digits = 2) ### Table 3 Cor(fit) %>% describe %>% print(digits = 3) ### Table 4 Bias(fit, log = TRUE) %>% describe %>% print(digits = 2) CIndex(fit) %>% describe %>% print(digits = 2) ICC(fit) %>% describe %>% print(digits = 2) wCV(fit, log = TRUE) %>% describe %>% print(digits = 2) RDC(fit) %>% describe %>% print(digits = 2) RC(fit) %>% describe %>% print(digits = 2) ### Table 5 x <- describe(with(fit, mu))$Mean[1] scale <- describe(with(fit, sqrt(diag(Sigma.img))))$Mean[1] coef <- LRMCoef(1.5, scale = scale, p = 0.5, x = x) fit.LRM <- LRM(fit, N = c(250, 500), coef = coef) fit.LRM %>% describe(scale = scale) %>% print(digits = 3) ### Posterior predictive p-values GOF(fit) %>% describe %>% print(digits = 3) ### Figure 2 x11(7,6) plot(GOF(fit, select = 1))