These helper functions are mostly used internally to convert effect measures for the calculation of E-values. The approximate conversion of odds and hazard ratios to risk ratios depends on whether the rare outcome assumption is made.

toRR(est, rare, delta = 1, ...)

toMD(est, delta = 1, ...)

Arguments

est

The effect estimate; constructed with one of RR(), OR(), HR(), MD(), OLS().

rare

When converting a OR() or HR() estimate, a logical indicating whether the outcome is sufficiently rare to approximate a risk ratio.

delta

When converting an OLS() estimate, the contrast of interest in the exposure. Defaults to 1 (a 1-unit contrast in the exposure).

...

Arguments passed to other methods.

Value

An object of class "estimate" and the desired effect measure. Also includes as an attribute its conversion history.

Details

Uses the conversions listed in Table 2 of VanderWeele TJ, Ding P. Sensitivity Analysis in Observational Research: Introducing the E-Value. Annals of Internal Medicine. 2017;167(4):268–75.

See also VanderWeele TJ. Optimal approximate conversions of odds ratios and hazard ratios to risk ratios. Biometrics. 2019 Jan 6;(September 2018):1–7.

Examples

# Both odds ratios are 3, but will be treated differently # depending on whether rare outcome assumption is reasonable OR(3, rare = FALSE)
#> [1] 3
OR(3, rare = TRUE)
#> [1] 3
toRR(OR(3, rare = FALSE))
#> [1] 1.732051
toRR(OR(3, rare = TRUE))
#> [1] 3
attributes(toRR(toMD(OLS(3, sd = 1.2), delta = 1)))
#> $class #> [1] "RR" "estimate" #> #> $sd #> [1] 1.2 #> #> $history #> [,1] [,2] #> [1,] "OLS" "3" #> [2,] "MD" "2.5" #>