pubh (version 1.1.16)

diag_test: Diagnostic tests from variables.

Description

diag_test is a wrap function that calls epi.tests from package epiR. It computes sensitivity, specificity and other statistics related with screening tests.

Usage

diag_test(object = NULL, formula = NULL, data = NULL, ...)

Arguments

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 formula can be found.

...

Further arguments passed to epi.tests.

Details

For the formula, the outcome is the gold standard and the explanatory variable is the new (screening) test. See examples.

See Also

epi.tests.

Examples

Run this code
# NOT RUN {
## We compare the use of lung<U+2019>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)
# }

Run the code above in your browser using DataLab