View source: R/compute.threshold.AROC.bnp.R
compute.threshold.AROC.bnp | R Documentation |
Estimates AROC-based threshold values using the nonparametric Bayesian approach proposed by Inacio de Carvalho and Rodriguez-Alvarez (2018).
compute.threshold.AROC.bnp(object, newdata, FPF = 0.5)
object |
An object of class |
newdata |
Data frame with the covariate values at which threshold values are required. |
FPF |
Numeric vector with the FPF at which to calculate the AROC-based threshold values. Atomic values are also valid. |
Estimation of the covariate-adjusted ROC curve (AROC) using the nonparametric Bayesian approach proposed by Inacio de Carvalho and Rodriguez-Alvarez (2018) involves the estimation of the conditional distribution function for the diagnostic test outcome in the healthy population
F_{\bar{D}}(y|\mathbf{X}_{\bar{D}}) = Pr\{Y_{\bar{D}} ≤q y | \mathbf{X}_{\bar{D}}\}.
This function makes use of this estimate in order to calculate AROC-based threshold values. In particular, for a covariate value \mathbf{x} and a FPF = t, the AROC-based threshold value at the s-th posterior sample (s = 1,…,S) is calculated as follows
c^{(s)}_{\mathbf{x}} = \hat{F}^{-1(s)}_{\bar{D}}(1-t|\mathbf{X}_{\bar{D}} = \mathbf{x}).
from which the posterior mean can be computed
\hat{c}_{\mathbf{x}} = \frac{1}{S}∑_{s = 1}^{S}c^{(s)}_{\mathbf{x}}.
As a result, the function provides a list with the following components:
thresholds.est |
A matrix with the posterior mean of the AROC-based threshold values. The matrix has as many columns as different covariate vector values, and as many rows as different FPFs. |
thresholds.ql |
A matrix with the posterior 2.5% quantile of the AROC-based threshold values. The matrix has as many columns as different covariate vector values, and as many rows as different FPFs. |
thresholds.qh |
A matrix with the posterior 97.5% quantile of the AROC-based threshold values. The matrix has as many columns as different covariate vector values, and as many rows as different FPFs. |
Inacio de Carvalho, V., and Rodriguez-Alvarez, M. X. (2018). Bayesian nonparametric inference for the covariate-adjusted ROC curve. arXiv preprint arXiv:1806.00473.
AROC.bnp
library(AROC) data(psa) # Select the last measurement newpsa <- psa[!duplicated(psa$id, fromLast = TRUE),] # Log-transform the biomarker newpsa$l_marker1 <- log(newpsa$marker1) m0 <- AROC.bnp(formula.healthy = l_marker1 ~ f(age, K = 0), group = "status", tag.healthy = 0, data = newpsa, scale = TRUE, p = seq(0,1,l=101), compute.lpml = TRUE, compute.WAIC = TRUE, a = 2, b = 0.5, L = 10, nsim = 5000, nburn = 1000) # Compute the threshold values FPF = c(0.1, 0.3) newdata <- data.frame(age = seq(52, 80, l = 50)) th_bnp <- compute.threshold.AROC.bnp(m0, newdata, FPF) names(th_bnp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.