View source: R/epi_functions.R
diag_test | R Documentation |
diag_test
is a wrap function that calls epi.tests
from package epiR
.
It computes sensitivity, specificity and other statistics related with screening tests.
diag_test(object = NULL, formula = NULL, data = NULL, ...)
object |
When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. See details and examples. |
formula |
A formula with shape: outcome ~ predictor (see details). |
data |
A data frame where the variables in the |
... |
Further arguments passed to |
For the formula
, the outcome is the gold standard and the explanatory variable is the new (screening) test. See examples.
epi.tests
.
## We compare the use of lung’s X-rays on the screening of TB against the gold standard test.
Freq <- c(1739, 8, 51, 22)
BCG <- gl(2, 1, 4, labels = c("Negative", "Positive"))
Xray <- gl(2, 2, labels = c("Negative", "Positive"))
tb <- data.frame(Freq, BCG, Xray)
tb <- expand_df(tb)
tb |>
diag_test(BCG ~ Xray)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.