epi_tests: Wrap data from a dataframe and send to epiR::epi.tests

View source: R/epi_tests.R

epi_testsR Documentation

Wrap data from a dataframe and send to epiR::epi.tests

Description

A wrapper for epirR::epi.tests normally called with a data.frame and unquoted columns or expressions. Can also be called with a numeric vector length 4 to allow direct entry of 2 x 2 table data

Usage

epi_tests(x, test = NULL, goldstandard = NULL, ...)

Arguments

x

A dataframe or numeric vector length 4

test

The unquoted column name for test results

goldstandard

The unquoted column name for gold standard test results

...

Other parameters passed on to epiR::epi.tests

Details

If using 4 numbers epi_test(c(a, b, c, d), ...)

Format is:

———– ———- ————-

Disease + - or time at risk

———– ———- ————-

Test + a b

Test - c d

———– ———- ————-

Total a + c b + d

———– ———- ————-

Value

Returns an epi.tests

Examples

head(mtcars)
epi_tests(mtcars, mpg < 25, cyl > 4, conf.level = 0.95)
res <- epi_tests(c(80, 1, 20, 99), conf.level = 0.95)

ianhandel/epidemr documentation built on April 13, 2022, 11:08 a.m.