getAccuracy {mcradds}R Documentation

Summary Method for MCTab Objects

Description

[Experimental]

Provides a concise summary of the content of MCTab objects. Computes sensitivity, specificity, positive and negative predictive values and positive and negative likelihood ratios for a diagnostic test with reference/gold standard. Computes positive/negative percent agreement, overall percent agreement and Kappa when the new test is evaluated by comparison to a non-reference standard. Computes average positive/negative agreement when the both tests are all not the reference, such as paired reader precision.

Usage

getAccuracy(object, ...)

## S4 method for signature 'MCTab'
getAccuracy(
  object,
  ref = c("r", "nr", "bnr"),
  alpha = 0.05,
  r_ci = c("wilson", "wald", "clopper-pearson"),
  nr_ci = c("wilson", "wald", "clopper-pearson"),
  bnr_ci = "bootstrap",
  bootCI = c("perc", "norm", "basic", "stud", "bca"),
  nrep = 1000,
  rng.seed = NULL,
  digits = 4,
  ...
)

Arguments

object

(MCTab)
input from diagTab function to create 2x2 contingency table.

...

other arguments to be passed to DescTools::BinomCI.

ref

(character)
reference condition. It is possible to choose one condition for your require. The r indicates that the comparative test is standard reference, nr indicates the comparative test is not a standard reference, and bnr indicates both the new test and comparative test are not references.

alpha

(numeric)
type-I-risk, \alpha.

r_ci

(string)
string specifying which method to calculate the confidence interval for a diagnostic test with reference/gold standard. Default is wilson. Options can be wilson, wald and clopper-pearson, see DescTools::BinomCI.

nr_ci

(string)
string specifying which method to calculate the confidence interval for the comparative test with non-reference standard. Default is wilson. Options can be wilson, wald and clopper-pearson, see DescTools::BinomCI.

bnr_ci

(string)
string specifying which method to calculate the confidence interval for both tests are not reference like reader precision. Default is bootstrap. But when the point estimate of ANA or APA is equal to 0 or 100%, the method will be changed to ⁠transformed wilson⁠.

bootCI

(string)
string specifying the which bootstrap confidence interval from boot.ci() function in boot package. Default is perc(bootstrap percentile), options can be norm(normal approximation), boot(basic bootstrap), stud(studentized bootstrap) and bca(adjusted bootstrap percentile).

nrep

(integer)
number of replicates for bootstrapping, default is 1000.

rng.seed

(integer)
number of the random number generator seed for bootstrap sampling. If set to NULL currently in the R session used RNG setting will be used.

digits

(integer)
the desired number of digits. Default is 4.

Value

A data frame contains the qualitative diagnostic accuracy criteria with three columns for estimated value and confidence interval.

Examples

# For qualitative performance
data("qualData")
tb <- qualData %>%
  diagTab(
    formula = ~ CandidateN + ComparativeN,
    levels = c(1, 0)
  )
getAccuracy(tb, ref = "r")
getAccuracy(tb, ref = "nr", nr_ci = "wilson")

# For Between-Reader precision performance
data("PDL1RP")
reader <- PDL1RP$btw_reader
tb2 <- reader %>%
  diagTab(
    formula = Reader ~ Value,
    bysort = "Sample",
    levels = c("Positive", "Negative"),
    rep = TRUE,
    across = "Site"
  )
getAccuracy(tb2, ref = "bnr")
getAccuracy(tb2, ref = "bnr", rng.seed = 12306)

[Package mcradds version 1.1.0 Index]