These functions allow the user to declare that an estimate is a certain type of effect measure: risk ratio (RR), odds ratio (OR), hazard ratio (HR), risk difference (RD), linear regression coefficient (OLS), or mean standardized difference (MD).

RR(est)

OR(est, rare)

HR(est, rare)

RD(est)

OLS(est, sd)

MD(est)

Arguments

est

The effect estimate (numeric).

rare

Logical. Whether the outcome is sufficiently rare for use of risk ratio approximates; if not, approximate conversions are used. Used only for HR() and OR(); see Details.

sd

The standard deviation of the outcome (or residual standard deviation). Used only for OLS(); see Details.

Value

An object of classes "estimate" and the measure of interest, containing the effect estimate and any other attributes to be used in future calculations.

Details

The conversion functions use these objects to convert between effect measures when necessary to calculate E-values. Read more about the conversions 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.

For OLS(), sd must be specified. A true standardized mean difference for linear regression would use sd = SD( Y | X, C ), where Y is the outcome, X is the exposure of interest, and C are any adjusted covariates. See Examples for how to extract this from lm. A conservative approximation would instead use sd = SD( Y ). Regardless, the reported E-value for the confidence interval treats sd as known, not estimated.

Examples

# Both odds ratios are 3, but will be treated differently in E-value calculations # depending on whether rare outcome assumption is reasonable OR(3, rare = FALSE)
#> [1] 3
OR(3, rare = TRUE)
#> [1] 3
evalue(OR(3, rare = FALSE))
#> point lower upper #> RR 1.732051 NA NA #> E-values 2.858083 NA NA
evalue(OR(3, rare = TRUE))
#> point lower upper #> RR 3.00000 NA NA #> E-values 5.44949 NA NA
attributes(OR(3, rare = FALSE))
#> $class #> [1] "OR" "estimate" #> #> $rare #> [1] FALSE #>
# If an estimate was constructed via conversion from another effect measure, # we can see the history of a conversion using the summary() function summary(toRR(OR(3, rare = FALSE)))
#> RR = 1.732051 #> This is an approximate conversion of the original OR estimate = 3
summary(toRR(OLS(3, sd = 1)))
#> RR = 15.33289 #> This is an approximate conversion of the original OLS estimate = 3
# Estimating sd for an OLS estimate # first standardizing conservatively by SD(Y) data(lead) ols = lm(age ~ income, data = lead) est = ols$coefficients[2] sd = sd(lead$age) summary(evalue(OLS(est, sd)))
#> [1] 1.14078
# now use residual SD to avoid conservatism # here makes very little difference because income and age are # not highly correlated sd = summary(ols)$sigma summary(evalue(OLS(est, sd)))
#> [1] 1.140795