R/opCharMethodFunctions.R
Accuracy.Rd
Extract the accuracy measures from objects of class
"opchar" returned by operatingCharacteristics1
(opChar1)
or operatingCharacteristics2
(opChar2).
Accuracy(object, individual = TRUE, ...)
An object of class "opChar", from which the accuracy measures are to be extracted.
A logical argument that determines whether the accuracy measures for each individual (individual=TRUE) are to be included.
Additional arguments to be passed to Accuracy
(e.g.,
digits
to be passed to round
or signif
for appropriate
rounding).
A list containing:
matrix detailing the accuracy measures for each individual
from object (for objects returned by opChar1
).
matrix detailing the accuracy measures
pertaining to disease 1 for each individual from object
(for objects returned by opChar2
).
matrix detailing the accuracy measures
pertaining to disease 2 for each individual from object
(for objects returned by opChar2
).
matrix detailing the overall accuracy measures for the algorithm from object.
The Accuracy function gives the individual accuracy measures
for each individual in object and the overall accuracy measures for
the algorithm. If individual=TRUE, individual accuracy measures
are provided for each individual specified in the a
argument of the
call to operatingCharacteristics1
(opChar1)
or operatingCharacteristics2
(opChar2).
Accuracy measures included are the pooling sensitivity, pooling
specificity, pooling positive predictive value, and pooling negative
predictive value. The overall accuracy measures displayed are weighted
averages of the corresponding individual accuracy measures for all
individuals in the algorithm. Expressions for these averages are provided
in the Supplementary Material for Hitt et al. (2019). For more information,
see the Details' section for the operatingCharacteristics1
(opChar1) or operatingCharacteristics2
(opChar2)
function.
The rows in the matrices of individual accuracy measures correspond to each unique set of accuracy measures in the algorithm. Individuals with the same set of accuracy measures are displayed together in a single row of the matrix. The columns correspond to the pooling sensitivity, pooling specificity, pooling positive predictive value, pooling negative predictive value, and the indices for the individuals in each row of the matrix. Individual accuracy measures are provided only if individual=TRUE.
config.mat <- matrix(data = c(rep(1, 10), 1:10),
nrow = 2, ncol = 10, byrow = TRUE)
res1 <- opChar1(algorithm = "D2", p = 0.05, Se = 0.99, Sp = 0.99,
hier.config = config.mat)
#>
#> Number of minutes running: 0
#>
Accuracy(res1, individual = FALSE)
#> $Overall
#> PSe PSp PPPV PNPV
#> [1,] 0.9801 0.9963 0.9327 0.9989
#>
Accuracy(res1, individual = TRUE)
#> $Individual
#> PSe PSp PPPV PNPV individuals
#> 1 0.9801 0.9963 0.9327 0.9989 All
#>
#> $Overall
#> PSe PSp PPPV PNPV
#> [1,] 0.9801 0.9963 0.9327 0.9989
#>
res2 <- opChar2(algorithm = "A2M",
p.vec = c(0.92, 0.05, 0.02, 0.01),
Se = rep(0.95, 2), Sp = rep(0.99, 2),
rowcol.sz = 8)
#>
#> Number of minutes running: 0
#>
Accuracy(res2)
#> $`Disease 1 Individual`
#> PSe PSp PPPV PNPV individuals
#> 1 0.8704 0.9983 0.9709 0.9918 All
#>
#> $`Disease 2 Individual`
#> PSe PSp PPPV PNPV individuals
#> 1 0.9004 0.9981 0.9366 0.9969 All
#>
#> $Overall
#>
#> Disease PSe PSp PPPV PNPV
#> 1 0.8704 0.9983 0.9709 0.9918
#> 2 0.9004 0.9981 0.9366 0.9969
#>