View source: R/helper_functions.R
sens_spec_plus | R Documentation |
sens_spec_plus
computes sensitivity, specificity and a
few friends from a gold standard and testing results. sens_spec_plus
is a convenience wrapper for epiR::epi.tests
.
sens_spec_plus( test = NULL, gold = NULL, method = c("exact", "jeffreys", "wilson", "agresti", "clopper-pearson"), conf_level = 0.95 )
test |
numeric vector containing testing results, coded as 0 for negative and 1 for positive. |
gold |
numeric vector containing the gold standard, coded as 0 for negative and 1 for positive. |
method |
type of uncertainty interval
( |
conf_level |
confidence level, a numeric value between 0 and 1. Default: 0.95. |
sens_spec_plus
returns a list containing components
table
and ests
:
table
a 2 x 2 table which is the anti-transpose of the
result produced by base::table(gold, test)
.
ests
a dataframe containing the apparent (test-based) and true positive proportions, sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), and the lower and upper uncertainty limits for each.
epi.tests
Gold <- rbinom(20, 1, 0.50) Test <- Gold; Test[c(3, 5, 9, 12, 16)] <- 1 - Test[c(3, 5, 9, 12, 16)] sens_spec_plus(test = Test, gold = Gold, method = "jeffreys")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.