pubh (version 1.1.16)

prop_or: 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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab