prop_or {pubh} | R Documentation |
Proportion, p1 from proportion p2 and OR.
Description
prop_or
is a simple function to calculate a proportion, from another proportion and the odds
ratio between them.
Usage
prop_or(p2, or)
Arguments
p2 |
The value of a proportion in the unexposed group (p2). |
or |
The odds ratio of p1/p2. |
Value
p1
, the proportion in the exposed group (p1).
Examples
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
[Package pubh version 1.3.2 Index]