Convert between Odds ratios and Risk ratiosSource:
Convert between Odds ratios and Risk ratios
- OR, RR
Risk ratio of
p1/p0or Odds ratio of
odds(p1)/odds(p0), possibly log-ed.
ORcan also be a logistic regression model.
Take in or output the log of the ratio (such as in logistic models).
Arguments passed to and from other methods.
Converted index, or if
OR is a logistic regression model, a
parameter table with the converted indices.
Grant, R. L. (2014). Converting an odds ratio to a range of plausible relative risks for better communication of research findings. Bmj, 348, f7450.
p0 <- 0.4 p1 <- 0.7 (OR <- probs_to_odds(p1) / probs_to_odds(p0)) #>  3.5 (RR <- p1 / p0) #>  1.75 riskratio_to_oddsratio(RR, p0 = p0) #>  3.5 oddsratio_to_riskratio(OR, p0 = p0) #>  1.75 m <- glm(am ~ factor(cyl), data = mtcars, family = binomial()) oddsratio_to_riskratio(m) #> Warning: 'p0' not provided.RR is relative to the intercept (p0 = 0.73) - make sure your intercept is meaningful. #> Warning: CIs are back-transformed from the logit scale. #> Parameter | Risk Ratio | 95% CI #> --------------------------------------- #> (Intercept) | 0.73 | #> cyl  | 0.59 | [0.11, 1.16] #> cyl  | 0.20 | [0.02, 0.70] #> #> Uncertainty intervals (profile-likelihood) and p-values (two-tailed) #> computed using a Wald z-distribution approximation.