| SensSpec | R Documentation |
SensSpec() is a function for calculating overall sensitivity and specificity, modality-specific sensitivity and specificity, and reader-specific sensitivity and specificity within each modality.
SensSpec(
data,
Modality,
Reader,
Case = NULL,
D,
Y,
percentage = FALSE,
digits = max(1L, getOption("digits") - 3L)
)
data |
A data frame containing the modality identifiers ( |
Modality |
Variable specifying the modality identifiers. |
Reader |
Variable specifying the reader identifiers. |
Case |
Variable specifying the case identifiers. This variable is not directly used in the calculation of sensitivity and specificity in |
D |
Variable specifying the true disease status, coded as 1 for diseased cases and 0 for non-diseased cases. |
Y |
Variable specifying the binary diagnostic test result, coded as 1 for test-positive results and 0 for test-negative results. |
percentage |
Logical indicating whether the results should be reported as percentages rather than decimal proportions. Default: |
digits |
Number of significant digits used to format the reported results. Default: |
An object of class SensSpec containing the following components:
Overall Result |
Overall sensitivity and specificity. |
Modality-specific Result |
Modality-specific sensitivity and specificity. |
Reader-specific Modality-specific Result |
Reader- and modality-specific sensitivity and specificity. |
digits |
Number of significant digits used to format the reported results. |
Readers |
Unique reader identifiers in the input data. |
Modalities |
Unique modality identifiers in the input data. |
The results for SensSpec objects can be printed with print.SensSpec.
Yerushalmy, J. (1947). Statistical Problems in Assessing Methods of Medical Diagnosis, with Special Reference to X-Ray Techniques. Public Health Reports (1896-1970), 62(40), 1432–1449.
print.SensSpec
## Load example data
data(VanDyke)
## Return the first parts of an object
head(VanDyke)
## Extract unique modalities
unique(VanDyke$treatment)
## Extract Unique readers
unique(VanDyke$reader)
## Create binary test results (Y_ijk)
VanDyke$Y <- as.numeric(VanDyke$rating >= 3)
## Example usage of SensSpec function:
# Report results as decimals
senspe_result1 <- SensSpec(data = VanDyke, Modality = treatment,
Reader = reader, Case = case,
D = truth, Y = Y, percentage = FALSE, digits = 3)
# Report results as percentage points
senspe_result2 <- SensSpec(data = VanDyke, Modality = treatment,
Reader = reader, Case = case,
D = truth, Y = Y, percentage = TRUE, digits = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.