effect_measures: Declare an effect measure

Description Usage Arguments Details Value Examples

Description

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).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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.

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.

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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)
OR(3, rare = TRUE)
evalue(OR(3, rare = FALSE))
evalue(OR(3, rare = TRUE))
attributes(OR(3, rare = 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)))
summary(toRR(OLS(3, sd = 1)))

# 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)))
# 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)))

EValue documentation built on Oct. 28, 2021, 9:10 a.m.