epi_2by2 | R Documentation |
A wrapper for epirR::epi.2by2 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
epi_2by2( x, outcome = NULL, exposure = NULL, time_at_risk = NULL, method = "cross.sectional", ... )
x |
A dataframe or numeric vector length 4 |
outcome |
The unquoted column name for test results |
exposure |
The unquoted column name for exposure column |
time_at_risk |
Time at risk for cohort.time method |
method |
The type of study |
... |
Other parameters passed on to epiR::epi.2by2 |
If using 4 numbers epi_2by2(a, b, c, d, ...)
Format is:
———– ———- ————-
Disease + - or time at risk
———– ———- ————-
Expose + a b
Expose - c d
———– ———- ————-
Total a + c b + d
———– ———- ————-
Returns an epi.2by2 object
head(mtcars) epi_2by2(mtcars, am == 1, cyl == 4, conf.level = 0.95) epi_2by2(c(12, 34, 1, 6), conf.level = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.