compute.threshold.pooledROC: Pooled ROC based threshold values.

View source: R/compute.threshold.pooledROC.R

compute.threshold.pooledROCR Documentation

Pooled ROC based threshold values.

Description

This function implements methods for estimating pooled ROC-based threshold values.

Usage

compute.threshold.pooledROC(object, criterion = c("FPF", "TPF", "YI"), FPF, TPF, 
  ci.level = 0.95, parallel = c("no", "multicore", "snow"), ncpus = 1, cl = NULL)

Arguments

object

An object of class pooledROC as produced by pooledROC.BB, pooledROC.emp, pooledROC.kernel, or pooledROC.dpm functions.

criterion

A character string indicating if the threshold value should be computed based on the Youden index (“YI”), or for fixed false positive fractions (“FPF”) or true positive fractions (“TPF”).

FPF

For criterion = "FPF", a numeric vector with the FPF at which to calculate the threshold values. Atomic values are also valid.

TPF

For criterion = "TPF", a numeric vector with the TPF at which to calculate the threshold values. Atomic values are also valid.

ci.level

An integer value (between 0 and 1) specifying the confidence level. The default is 0.95.

parallel

A characters string with the type of parallel operation: either "no" (default), "multicore" (not available on Windows) or "snow".

ncpus

An integer with the number of processes to be used in parallel operation. Defaults to 1.

cl

An object inheriting from class cluster (from the parallel package), specifying an optional parallel or snow cluster if parallel = "snow". If not supplied, a cluster on the local machine is created for the duration of the call.

Details

Estimates pooled ROC-based threshold values based on three different criteria, namely, the Youden index (YI), one that gives rise to a pre-specified FPF, and one that gives rise to a pre-specified TPF.

The Youden Index is defined as

YI = \max_{c}\{TPF(c) - FPF(c)\} = \max_{c}\{F_{\bar{D}}(c) - F_{D}(c)\},

where

F_{D}(y) = Pr(Y_{D} \leq y),

F_{\bar{D}}(y) = Pr(Y_{\bar{D}} \leq y).

The value c^{*} that achieves the maximum is called the optimal YI threshold. Regarding the criterion for a fixed FPF, the threshold value is obtained as follows

c = F_{\bar{D}}^{-1}(1-FPF).

and for a fixed TPF we have

c = F_{D}^{-1}(1-TPF).

Value

As a result, the function provides a list with the following components:

call

The matched call.

threshold

If method = "YI", the estimated (optimal) threshold corresponding to the Youden index (the one that maximises TPF/sensitivity + TNF/specificity). If method = "FPF", the estimated threshold corresponding to the specified FPF, and if method = "TPF", the estimated threshold corresponding to the specified TPF. For the Bayesian approaches (pooledROC.dpm and pooledROC.BB), and in both cases, in addition to the posterior mean, the ci.level*100% credible interval is also returned.

YI

If method = "YI", the estimated Youden index. For the Bayesian approaches (pooledROC.dpm and pooledROC.BB), in addition to the posterior mean, the ci.level*100% credible interval is also returned.

FPF

If method = "YI" or method = "TPF", the FPF corresponding to the estimated (optimal) threshold (For the Bayesian approaches (pooledROC.dpm and pooledROC.BB), in addition to the posterior mean, the ci.level*100% credible interval is also returned). If method = "FPF", the supplied FPF argument.

TPF

If method = "YI" or method = "FPF", the TPF/sensitivity corresponding to the estimated (optimal) threshold. For the Bayesian approaches (pooledROC.dpm and pooledROC.BB), in addition to the posterior mean, the ci.level*100% credible interval is also returned. If method = "TPF", the supplied TPF argument.

References

Rutter, C.M. and Miglioretti, D. L. (2003). Estimating the Accuracy of Psychological Scales Using Longitudinal Data. Biostatistics, 4, 97–107.

Youden, W. J. (1ci.level*1000). Index for rating diagnostic tests. Cancer, 3, 32–35.

See Also

pooledROC.BB, pooledROC.emp, pooledROC.kernel or pooledROC.dpm.

Examples

library(ROCnReg)
data(psa)
# Select the last measurement
newpsa <- psa[!duplicated(psa$id, fromLast = TRUE),]

# Log-transform the biomarker
newpsa$l_marker1 <- log(newpsa$marker1)

m0_dpm <- pooledROC.dpm(marker = "l_marker1", group = "status",
            tag.h = 0, data = newpsa, standardise = TRUE, 
            p = seq(0,1,l=101), compute.WAIC = TRUE, compute.lpml = TRUE, 
            compute.DIC = TRUE, 
            prior.h = priorcontrol.dpm(m0 = 0, S0 = 10, a = 2, b = 0.5, alpha = 1, 
            L =10),
            prior.d = priorcontrol.dpm(m0 = 0, S0 = 10, a = 2, b = 0.5, alpha = 1, 
            L =10),
            mcmc = mcmccontrol(nsave = 400, nburn = 100, nskip = 1))


## Threshold values based on the YI
th_m0_dpm_yi <- compute.threshold.pooledROC(m0_dpm, criterion = "YI")

th_m0_dpm_yi$threshold
th_m0_dpm_yi$YI

### Threshold values for a fixed FPF
th_m0_dpm_fpf <- compute.threshold.pooledROC(m0_dpm, criterion = "FPF", FPF = 0.1)

th_m0_dpm_fpf$threshold

  

ROCnReg documentation built on June 22, 2024, 9:18 a.m.