View source: R/epi_functions.R
prop_or | R Documentation |
prop_or
is a simple function to calculate a proportion, from another proportion and the odds
ratio between them.
prop_or(p2, or)
p2 |
The value of a proportion in the unexposed group (p2). |
or |
The odds ratio of p1/p2. |
p1
, the proportion in the exposed group (p1).
flu <- matrix(c(20, 80, 220, 140), nrow = 2)
colnames(flu) <- c("Yes", "No")
rownames(flu) <- c("Vaccine", "Placebo")
flu
or <- (20 * 140) / (80 * 220)
p2 <- 80 / 220
prop_or(p2 = p2, or = or)
20 / 240
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.