prop_or: Proportion, p1 from proportion p2 and OR.

View source: R/epi_functions.R

prop_orR 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

pubh documentation built on Oct. 8, 2024, 9:08 a.m.