Title: | Sensitivity Analyses for Unmeasured Confounding and Other Biases in Observational Studies and Meta-Analyses |
---|---|
Description: | Conducts sensitivity analyses for unmeasured confounding, selection bias, and measurement error (individually or in combination; VanderWeele & Ding (2017) <doi:10.7326/M16-2607>; Smith & VanderWeele (2019) <doi:10.1097/EDE.0000000000001032>; VanderWeele & Li (2019) <doi:10.1093/aje/kwz133>; Smith & VanderWeele (2021) <arXiv:2005.02908>). Also conducts sensitivity analyses for unmeasured confounding in meta-analyses (Mathur & VanderWeele (2020a) <doi:10.1080/01621459.2018.1529598>; Mathur & VanderWeele (2020b) <doi:10.1097/EDE.0000000000001180>) and for additive measures of effect modification (Mathur et al., under review). |
Authors: | Maya B. Mathur [cre, aut], Louisa H. Smith [aut], Peng Ding [aut], Tyler J. VanderWeele [aut] |
Maintainer: | Maya B. Mathur <[email protected]> |
License: | GPL-2 |
Version: | 4.1.3 |
Built: | 2024-11-22 04:06:46 UTC |
Source: | https://github.com/cran/EValue |
Plots the bias factor required to explain away a provided relative risk.
bias_plot(RR, xmax)
bias_plot(RR, xmax)
RR |
The relative risk |
xmax |
Upper limit of x-axis. |
# recreate the plot in VanderWeele and Ding (2017) bias_plot(RR=3.9, xmax=20)
# recreate the plot in VanderWeele and Ding (2017) bias_plot(RR=3.9, xmax=20)
This function implements the sensitivity analyses of Mathur & VanderWeele (2020a, 2020b). It computes point estimates, standard errors, and confidence intervals
for (1) Prop
, the proportion of studies with true causal effect sizes above or below a chosen threshold q
as a function of the bias parameters;
(2) the minimum bias factor on the relative risk scale (Tmin
) required to reduce to
less than r
the proportion of studies with true causal effect sizes more extreme than
q
; and (3) the counterpart to (2) in which bias is parameterized as the minimum
relative risk for both confounding associations (Gmin
).
confounded_meta( method = "calibrated", q, r = NA, tail = NA, CI.level = 0.95, give.CI = TRUE, R = 1000, muB = NA, muB.toward.null = FALSE, dat = NA, yi.name = NA, vi.name = NA, sigB = NA, yr = NA, vyr = NA, t2 = NA, vt2 = NA, ... )
confounded_meta( method = "calibrated", q, r = NA, tail = NA, CI.level = 0.95, give.CI = TRUE, R = 1000, muB = NA, muB.toward.null = FALSE, dat = NA, yi.name = NA, vi.name = NA, sigB = NA, yr = NA, vyr = NA, t2 = NA, vt2 = NA, ... )
method |
|
q |
True causal effect size chosen as the threshold for a meaningfully large effect. |
r |
For |
tail |
|
CI.level |
Confidence level as a proportion (e.g., 0.95). |
give.CI |
Logical. If |
R |
Number of bootstrap iterates for confidence interval estimation. Only used if |
muB |
Mean bias factor on the log scale across studies (greater than 0). When considering bias that is of homogeneous strength across studies (i.e., |
muB.toward.null |
Whether you want to consider bias that has on average shifted studies' point estimates away from the null ( |
dat |
Dataframe containing studies' point estimates and variances. Only used if |
yi.name |
Name of variable in |
vi.name |
Name of variable in |
sigB |
Standard deviation of log bias factor across studies. Only used if |
yr |
Pooled point estimate (on log-relative risk scale) from confounded meta-analysis. Only used if |
vyr |
Estimated variance of pooled point estimate from confounded meta-analysis. Only used if |
t2 |
Estimated heterogeneity ( |
vt2 |
Estimated variance of |
... |
Additional arguments passed to |
By convention, the average log-bias factor, muB
, is taken to be greater than 0 (Mathur & VanderWeele, 2020a; Ding & VanderWeele, 2017). Confounding can operate on average either away from or toward the null, a choice specified via muB.toward.null
. The most common choice for sensitivity analysis is to consider bias that operates on average away from the null, which is confounded_meta
's default. In such an analysis, correcting for the bias involves shifting studies' estimates back toward the null by muB
(i.e., if yr > 0
, the estimates will be corrected downward; if yr < 0
, they will be corrected upward). Alternatively, to consider bias that operates on average away from the null, you would still specify muB > 0
but would also specify muB.toward.null = TRUE
. For detailed guidance on choosing the sensitivity parameters muB
and sigB
, see Section 5 of Mathur & VanderWeele (2020a).
q
For detailed guidance on choosing the threshold q
, see the Supplement of Mathur & VanderWeele (2020a).
By default, confounded_meta
performs estimation using a calibrated method (Mathur & VanderWeele, 2020b) that extends work by Wang et al. (2019). This method makes no assumptions about the distribution of population effects and performs well in meta-analyses with as few as 10 studies, and performs well even when the proportion being estimated is close to 0 or 1. However, it only accommodates bias whose strength is the same in all studies (homogeneous bias). When using this method, the following arguments need to be specified:
q
r
(if you want to estimate Tmin
and Gmin
)
muB
dat
yi.name
vi.name
The parametric method assumes that the population effects are approximately normal and that the number of studies is large. Parametric confidence intervals should only be used when the proportion estimate is between 0.15 and 0.85 (and confounded_meta
will issue a warning otherwise). Unlike the calibrated method, the parametric method can accommodate bias that is heterogeneous across studies (specifically, bias that is log-normal across studies). When using this method, the following arguments need to be specified:
q
r
(if you want to estimate Tmin
and Gmin
)
muB
sigB
yr
vyr
(if you want confidence intervals)
t2
vt2
(if you want confidence intervals)
If your meta-analysis uses effect sizes other than log-relative risks, you should first approximately convert them to log-relative risks, for example via convert_measures()
and then pass the converted point estimates or meta-analysis estimates to confounded_meta
.
Tmin
and Gmin
Tmin
is defined as the minimum average bias factor on the relative risk scale that would be required to reduce to less than r
the proportion of studies with true causal effect sizes stronger than the threshold q
, assuming that the bias factors are log-normal across studies with standard deviation sigB
. Gmin
is defined as the minimum confounding strength on the relative risk scale – that is, the relative risk relating unmeasured confounder(s) to both the exposure and the outcome – on average among the meta-analyzed studies, that would be required to reduce to less than r
the proportion of studies with true causal effect sizes stronger than the threshold q
, again assuming that bias factors are log-normal across studies with standard deviation sigB
. Gmin
is a one-to-one transformation of Tmin
given by . If the estimated proportion of meaningfully strong effect sizes is already less than
r
even without the introduction of any bias, Tmin
and Gmin
will be set to 1. (These definitions of Tmin
and Gmin
are generalizations of those given in Mathur & VanderWeele, 2020a, who defined these quantities in terms of bias that is homogeneous across studies. You can conduct analyses with homogeneous bias by setting sigB = 0
.)
The direction of bias represented by Tmin
and Gmin
is dependent on the argument tail
: when tail = "above"
, these metrics consider bias that had operated to increase studies' point estimates, and when tail = "below"
, these metrics consider bias that had operated to decrease studies' point estimates. Such bias could operate toward or away from the null depending on whether the pooled point estimate yr
happens to fall above or below the null. As such, the direction of bias represented by Tmin
and Gmin
may or may not match that specified by the argument muB.toward.null
(which is used only for estimation of Prop
).
These methods perform well only in meta-analyses with at least 10 studies; we do not recommend reporting them in smaller meta-analyses. Additionally, it only makes sense to consider proportions of effects stronger than a threshold when the heterogeneity estimate t2
is greater than 0. For meta-analyses with fewer than 10 studies or with a heterogeneity estimate of 0, you can simply report E-values for the point estimate via evalue()
(VanderWeele & Ding, 2017; see Mathur & VanderWeele (2020a), Section 7.2 for interpretation in the meta-analysis context).
Mathur MB & VanderWeele TJ (2020a). Sensitivity analysis for unmeasured confounding in meta-analyses. Journal of the American Statistical Association.
Mathur MB & VanderWeele TJ (2020b). Robust metrics and sensitivity analyses for meta-analyses of heterogeneous effects. Epidemiology.
Mathur MB & VanderWeele TJ (2019). New statistical metrics for meta-analyses of heterogeneous effects. Statistics in Medicine.
Ding P & VanderWeele TJ (2016). Sensitivity analysis without assumptions. Epidemiology.
VanderWeele TJ & Ding P (2017). Introducing the E-value. Annals of Internal Medicine.
Wang C-C & Lee W-C (2019). A simple method to estimate prediction intervals and predictive distributions: Summarizing meta-analyses beyond means and confidence intervals. Research Synthesis Methods.
##### Using Calibrated Method ##### d = metafor::escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=metadat::dat.bcg) # obtaining all three estimators and inference # number of bootstrap iterates # should be larger in practice R = 100 confounded_meta( method="calibrated", # for both methods q = log(0.90), r = 0.20, tail="below", muB = log(1.5), dat = d, yi.name = "yi", vi.name = "vi", R = 100 ) # passing only arguments needed for prop point estimate confounded_meta( method="calibrated", q = log(0.90), tail="below", muB = log(1.5), give.CI = FALSE, dat = d, yi.name = "yi", vi.name = "vi" ) # passing only arguments needed for Tmin, Gmin point estimates confounded_meta( method="calibrated", q = log(0.90), r = 0.10, tail="below", give.CI = FALSE, dat = d, yi.name = "yi", vi.name = "vi" ) ##### Using Parametric Method ##### # fit random-effects meta-analysis m = metafor::rma.uni(yi= d$yi, vi=d$vi, knha=TRUE, measure="RR", method="REML" ) yr = as.numeric(m$b) # metafor returns on log scale vyr = as.numeric(m$vb) t2 = m$tau2 vt2 = m$se.tau2^2 # obtaining all three estimators and inference # now the proportion considers heterogeneous bias confounded_meta( method = "parametric", q=log(0.90), r=0.20, tail = "below", muB=log(1.5), sigB=0.1, yr=yr, vyr=vyr, t2=t2, vt2=vt2, CI.level=0.95 ) # passing only arguments needed for prop point estimate confounded_meta( method = "parametric", q=log(0.90), tail = "below", muB=log(1.5), sigB = 0, yr=yr, t2=t2, CI.level=0.95 ) # passing only arguments needed for Tmin, Gmin point estimates confounded_meta( method = "parametric", q = log(0.90), sigB = 0, r = 0.10, tail = "below", yr=yr, t2=t2, CI.level=0.95 )
##### Using Calibrated Method ##### d = metafor::escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=metadat::dat.bcg) # obtaining all three estimators and inference # number of bootstrap iterates # should be larger in practice R = 100 confounded_meta( method="calibrated", # for both methods q = log(0.90), r = 0.20, tail="below", muB = log(1.5), dat = d, yi.name = "yi", vi.name = "vi", R = 100 ) # passing only arguments needed for prop point estimate confounded_meta( method="calibrated", q = log(0.90), tail="below", muB = log(1.5), give.CI = FALSE, dat = d, yi.name = "yi", vi.name = "vi" ) # passing only arguments needed for Tmin, Gmin point estimates confounded_meta( method="calibrated", q = log(0.90), r = 0.10, tail="below", give.CI = FALSE, dat = d, yi.name = "yi", vi.name = "vi" ) ##### Using Parametric Method ##### # fit random-effects meta-analysis m = metafor::rma.uni(yi= d$yi, vi=d$vi, knha=TRUE, measure="RR", method="REML" ) yr = as.numeric(m$b) # metafor returns on log scale vyr = as.numeric(m$vb) t2 = m$tau2 vt2 = m$se.tau2^2 # obtaining all three estimators and inference # now the proportion considers heterogeneous bias confounded_meta( method = "parametric", q=log(0.90), r=0.20, tail = "below", muB=log(1.5), sigB=0.1, yr=yr, vyr=vyr, t2=t2, vt2=vt2, CI.level=0.95 ) # passing only arguments needed for prop point estimate confounded_meta( method = "parametric", q=log(0.90), tail = "below", muB=log(1.5), sigB = 0, yr=yr, t2=t2, CI.level=0.95 ) # passing only arguments needed for Tmin, Gmin point estimates confounded_meta( method = "parametric", q = log(0.90), sigB = 0, r = 0.10, tail = "below", yr=yr, t2=t2, CI.level=0.95 )
A type of bias. Declares that unmeasured confounding will be a component of interest in the multi-bias sensitivity analysis. Generally used within other functions, its output is returned invisibly.
confounding(..., verbose = FALSE)
confounding(..., verbose = FALSE)
... |
Other arguments. Not currently used for this function. |
verbose |
Logical. If |
Invisibly returns a list with components n
(2, the degree of the
polynomial in the numerator), d
(1, the degree of the polynomial in the
denominator), mess
(any messages/warnings that should be printed for the
user), and bias
("confounding").
# returns invisibly without print() print(confounding()) # Calculate an E-value for unmeasured confounding only multi_evalue(est = RR(4), biases = confounding())
# returns invisibly without print() print(confounding()) # Calculate an E-value for unmeasured confounding only multi_evalue(est = RR(4), biases = confounding())
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, ...)
toRR(est, rare, delta = 1, ...) toMD(est, delta = 1, ...)
est |
The effect estimate; constructed with one of |
rare |
When converting a |
delta |
When converting an |
... |
Arguments passed to other methods. |
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 references.
Regarding the continuous outcome, the function uses the effect-size conversions in Chinn (2000) and VanderWeele (2017) to approximately convert the mean difference between these exposure "groups" to the odds ratio that would arise from dichotomizing the continuous outcome.
An object of class "estimate" and the desired effect measure. Also includes as an attribute its conversion history.
Chinn, S (2000). A simple method for converting an odds ratio to effect size for use in meta-analysis. Statistics in Medicine, 19(22), 3127-3131.
VanderWeele, TJ (2017). On a square-root transformation of the odds ratio for a common outcome. Epidemiology, 28(6), e58.
VanderWeele TJ (2020). Optimal approximate conversions of odds ratios and hazard ratios to risk ratios. Biometrics.
# Both odds ratios are 3, but will be treated differently # depending on whether rare outcome assumption is reasonable OR(3, rare = FALSE) OR(3, rare = TRUE) toRR(OR(3, rare = FALSE)) toRR(OR(3, rare = TRUE)) attributes(toRR(toMD(OLS(3, sd = 1.2), delta = 1)))
# Both odds ratios are 3, but will be treated differently # depending on whether rare outcome assumption is reasonable OR(3, rare = FALSE) OR(3, rare = TRUE) toRR(OR(3, rare = FALSE)) toRR(OR(3, rare = TRUE)) attributes(toRR(toMD(OLS(3, sd = 1.2), delta = 1)))
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)
RR(est) OR(est, rare) HR(est, rare) RD(est) OLS(est, sd) MD(est)
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
|
sd |
The standard deviation of the outcome (or residual standard
deviation). Used only for |
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.
An object of classes "estimate" and the measure of interest, containing the effect estimate and any other attributes to be used in future calculations.
# 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)))
# 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)))
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (possibly through an approximate conversion) as well as E-values for the point estimate and the confidence interval limit closer to the null.
evalue(est, lo = NA, hi = NA, se = NA, delta = 1, true = c(0, 1), ...)
evalue(est, lo = NA, hi = NA, se = NA, delta = 1, true = c(0, 1), ...)
est |
The effect estimate that was observed but which is suspected to be
biased. A number of class "estimate" (constructed with |
lo |
Optional. Lower bound of the confidence interval. If not an object
of class "estimate", assumed to be on the same scale as |
hi |
Optional. Upper bound of the confidence interval. If not an object
of class "estimate", assumed to be on the same scale as |
se |
The standard error of the point estimate, for |
delta |
The contrast of interest in the exposure, for |
true |
A number to which to shift the observed estimate to. Defaults to
1 for ratio measures ( |
... |
Arguments passed to other methods. |
An E-value for unmeasured confounding is minimum strength of association, on the risk ratio scale, that unmeasured confounder(s) would need to have with both the treatment and the outcome to fully explain away a specific treatment–outcome association, conditional on the measured covariates.
The estimate is converted appropriately before the E-value is calculated. See conversion functions for more details. The point estimate and confidence limits after conversion are returned, as is the E-value for the point estimate and the confidence limit closest to the proposed "true" value (by default, the null value.)
For an OLS()
estimate, the E-value is for linear regression with a
continuous exposure and outcome. Regarding the continuous exposure, the
choice of delta
defines essentially a dichotomization in the
exposure between hypothetical groups of subjects with exposures equal to an
arbitrary value c versus to another hypothetical group with
exposures equal to c + delta
.
For example, if resulting E-value is 2, this means that unmeasured
confounder(s) would need to double the probability of a subject's having
exposure equal to c + delta
instead of c, and would
also need to double the probability of being high versus low on the
outcome, in which the cutoff for "high" versus "low" is arbitrary subject
to some distributional assumptions (Chinn, 2000).
Ding & VanderWeele (2016). Sensitivity analysis without assumptions. Epidemiology. 27(3), 368.
VanderWeele & Ding (2017). Sensitivity analysis in observational research: Introducing the E-value. Annals of Internal Medicine. 27(3), 368.
# compute E-value for leukemia example in VanderWeele and Ding (2017) evalue(RR(0.80), 0.71, 0.91) # you can also pass just the point estimate # and return just the E-value for the point estimate with summary() summary(evalue(RR(0.80))) # demonstrate symmetry of E-value # this apparently causative association has same E-value as the above summary(evalue(RR(1 / 0.80))) # E-value for a non-null true value summary(evalue(RR(2), true = 1.5)) ## Hsu and Small (2013 Biometrics) Data ## sensitivity analysis after log-linear or logistic regression head(lead) ## log linear model -- obtain the conditional risk ratio lead.loglinear = glm(lead ~ ., family = binomial(link = "log"), data = lead[,-1]) est_se = summary(lead.loglinear)$coef["smoking", c(1, 2)] est = RR(exp(est_se[1])) lowerRR = exp(est_se[1] - 1.96*est_se[2]) upperRR = exp(est_se[1] + 1.96*est_se[2]) evalue(est, lowerRR, upperRR) ## logistic regression -- obtain the conditional odds ratio lead.logistic = glm(lead ~ ., family = binomial(link = "logit"), data = lead[,-1]) est_se = summary(lead.logistic)$coef["smoking", c(1, 2)] est = OR(exp(est_se[1]), rare = FALSE) lowerOR = exp(est_se[1] - 1.96*est_se[2]) upperOR = exp(est_se[1] + 1.96*est_se[2]) evalue(est, lowerOR, upperOR) ## linear regression # standardizing conservatively by SD(Y) ols = lm(age ~ income, data = lead) est = OLS(ols$coefficients[2], sd = sd(lead$age)) # for a 1-unit increase in income evalue(est = est, se = summary(ols)$coefficients['income', 'Std. Error']) # for a 0.5-unit increase in income evalue(est = est, se = summary(ols)$coefficients['income', 'Std. Error'], delta = 0.5) # E-value for Cohen's d = 0.5 with SE = 0.25 evalue(est = MD(.5), se = .25) # compute E-value for HR = 0.56 with CI: [0.46, 0.69] # for a common outcome evalue(HR(0.56, rare = FALSE), lo = 0.46, hi = 0.69) # for a rare outcome evalue(HR(0.56, rare = TRUE), lo = 0.46, hi = 0.69)
# compute E-value for leukemia example in VanderWeele and Ding (2017) evalue(RR(0.80), 0.71, 0.91) # you can also pass just the point estimate # and return just the E-value for the point estimate with summary() summary(evalue(RR(0.80))) # demonstrate symmetry of E-value # this apparently causative association has same E-value as the above summary(evalue(RR(1 / 0.80))) # E-value for a non-null true value summary(evalue(RR(2), true = 1.5)) ## Hsu and Small (2013 Biometrics) Data ## sensitivity analysis after log-linear or logistic regression head(lead) ## log linear model -- obtain the conditional risk ratio lead.loglinear = glm(lead ~ ., family = binomial(link = "log"), data = lead[,-1]) est_se = summary(lead.loglinear)$coef["smoking", c(1, 2)] est = RR(exp(est_se[1])) lowerRR = exp(est_se[1] - 1.96*est_se[2]) upperRR = exp(est_se[1] + 1.96*est_se[2]) evalue(est, lowerRR, upperRR) ## logistic regression -- obtain the conditional odds ratio lead.logistic = glm(lead ~ ., family = binomial(link = "logit"), data = lead[,-1]) est_se = summary(lead.logistic)$coef["smoking", c(1, 2)] est = OR(exp(est_se[1]), rare = FALSE) lowerOR = exp(est_se[1] - 1.96*est_se[2]) upperOR = exp(est_se[1] + 1.96*est_se[2]) evalue(est, lowerOR, upperOR) ## linear regression # standardizing conservatively by SD(Y) ols = lm(age ~ income, data = lead) est = OLS(ols$coefficients[2], sd = sd(lead$age)) # for a 1-unit increase in income evalue(est = est, se = summary(ols)$coefficients['income', 'Std. Error']) # for a 0.5-unit increase in income evalue(est = est, se = summary(ols)$coefficients['income', 'Std. Error'], delta = 0.5) # E-value for Cohen's d = 0.5 with SE = 0.25 evalue(est = MD(.5), se = .25) # compute E-value for HR = 0.56 with CI: [0.46, 0.69] # for a common outcome evalue(HR(0.56, rare = FALSE), lo = 0.46, hi = 0.69) # for a rare outcome evalue(HR(0.56, rare = TRUE), lo = 0.46, hi = 0.69)
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion if needed when outcome is common ) as well as E-values for the point estimate and the confidence interval limit closer to the null.
evalues.HR(est, lo = NA, hi = NA, rare = NA, true = 1, ...)
evalues.HR(est, lo = NA, hi = NA, rare = NA, true = 1, ...)
est |
The point estimate |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
rare |
1 if outcome is rare (<15 percent at end of follow-up); 0 if outcome is not rare (>15 percent at end of follow-up) |
true |
The true HR to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
... |
Arguments passed to other methods. |
# compute E-value for HR = 0.56 with CI: [0.46, 0.69] # for a common outcome evalues.HR(0.56, 0.46, 0.69, rare = FALSE)
# compute E-value for HR = 0.56 with CI: [0.46, 0.69] # for a common outcome evalues.HR(0.56, 0.46, 0.69, rare = FALSE)
Computes the E-value for an additive interaction contrast, representing the difference between stratum Z=1 and stratum Z=0 in the causal risk differences for a binary treatment X.
evalues.IC( stat, true = 0, unidirBias = FALSE, unidirBiasDirection = NA, p1_1, p1_0, n1_1, n1_0, f1, p0_1, p0_0, n0_1, n0_0, f0, alpha = 0.05 )
evalues.IC( stat, true = 0, unidirBias = FALSE, unidirBiasDirection = NA, p1_1, p1_0, n1_1, n1_0, f1, p0_1, p0_0, n0_1, n0_0, f0, alpha = 0.05 )
stat |
The statistic for which to compute the E-value ("est" for the interaction contrast point estimate or "CI" for its lower confidence interval limit) |
true |
The true (unconfounded) value to which to shift the specified statistic (point estimate or confidence interval limit). Should be smaller than the confounded statistic. |
unidirBias |
Whether the direction of confounding bias is assumed to be the same in both strata of Z (TRUE or FALSE); see Details |
unidirBiasDirection |
If bias is assumed to be unidirectional, its assumed direction ("positive", "negative", or "unknown"; see Details). If bias is not assumed to be unidirectional, this argument should be NA. |
p1_1 |
The probability of the outcome in stratum Z=1 with treatment X=1 |
p1_0 |
The probability of the outcome in stratum Z=1 with treatment X=0 |
n1_1 |
The sample size in stratum Z=1 with treatment X=1 |
n1_0 |
The sample size in stratum Z=1 with treatment X=0 |
f1 |
The probability in stratum Z=1 of having treatment X=1 |
p0_1 |
The probability of the outcome in stratum Z=0 with treatment X=1 |
p0_0 |
The probability of the outcome in stratum Z=0 with treatment X=0 |
n0_1 |
The sample size in stratum Z=0 with treatment X=1 |
n0_0 |
The sample size in stratum Z=0 with treatment X=0 |
f0 |
The probability in stratum Z=0 of treatment X=1 |
alpha |
The alpha-level to be used for p-values and confidence intervals |
The interaction contrast is a measure of additive effect modification that represents the difference between stratum Z=1 versus stratum Z=0 of the causal risk differences relating a treatment X to an outcome Y. The estimated interaction contrast is given by:
(p1_1 - p1_0) - (p0_1 - p0_0)
To use this function, the strata (Z) should be coded such that the confounded interaction contrast is positive rather than negative.
If, in one or both strata of Z, there are unmeasured confounders of the treatment-outcome association, then the interaction contrast may be biased as well (Mathur et al., 2021). The E-value for the interaction contrast represents the minimum strength of association, on the risk ratio scale, that unmeasured confounder(s) would need to have with both the treatment (X) and the outcome (Y) in both strata of Z to fully explain away the observed interaction contrast, conditional on the measured covariates. This bound is attained when the strata have confounding bias in opposite directions ("potentially multidirectional bias"). Alternatively, if one assumes that the direction of confounding is the same in each stratum of Z ("unidirectional bias"), then the E-value for the interaction contrast is defined as the minimum strength of association, on the risk ratio scale, that unmeasured confounder(s) would need to have with both the treatment (X) and the outcome (Y) in at least one stratum of Z to fully explain away the observed interaction contrast, conditional on the measured covariates. This bound under unidirectional confounding arises when one stratum is unbiased. See Mathur et al. (2021) for details.
As for the standard E-value for main effects (Ding & VanderWeele, 2016; VanderWeele & Ding, 2017), the E-value for the interaction contrast can be computed for both the point estimate and the lower confidence interval limit, and it can be also be calculated for shifting the estimate or confidence interval to a non-null value via the argument true
.
The argument unidirBias
indicates whether you are assuming unidirectional bias (unidirBias = TRUE
) or not (unidirBias = FALSE
). The latter is the default because it is more conservative and requires the fewest assumptions. When setting unidirBias = FALSE
, there is no need to specify the direction of bias via unidirBiasDir
. However, when setting unidirBias = TRUE
, the direction of bias does need to be specified via unidirBiasDir
, whose options are:
unidirBiasDir = "positive"
: Assumes that the risk differences in both strata of Z are positively biased.
unidirBiasDir = "negative"
: Assumes that the risk differences in both strata of Z are negatively biased.
unidirBiasDir = "unknown"
: Assumes that the risk differences in both strata of Z are biased in the same direction, but that the direction could be either positive or negative.
If your estimated interaction contrast has been adjusted for covariates, then you can use covariate-adjusted probabilities for p1_1
, p1_0
, p0_1
, and p0_0
. For example, these could be fitted probabilities from a covariate-adjusted regression model.
For multiplicative measures of effect modification (e.g., the ratio of risk ratios between the two strata of Z), you can simply use the function evalue
. To allow the bias to be potentially multidirectional, you would pass the square-root of your multiplicative effect modification estimate on the risk ratio scale to evalue
rather than the estimate itself. To assume unidirectional bias, regardless of direction, you would pass the multiplicative effect modification estimate itself to evalue
. See Mathur et al. (2021) for details.
Returns a list containing two dataframes (evalues
and RDt
). The E-value itself can be accessed as evalues$evalue
.
The dataframe evalues
contains the E-value, the corresponding bias factor, the bound on the interaction contrast if confounding were to attain that bias factor (this bound will be close to true
, by construction), and the direction of bias when the bias factor is attained. If you specify that the bias is potentially multidirectional, is unidirectional and positive, or is unidirectional and negative, the returned direction of bias will simply be what you requested. If you specify unidirectional bias of unknown direction, the bias direction will be either positive or negative depending on which direction produces the maximum bias.
The dataframe RDt
contains, for each stratum and for the interaction contrast, bias-corrected estimates (risk differences for the strata and the interaction contrast for stratum = effectMod
), their standard errors, their confidence intervals, and their p-values. These estimates are bias-corrected for the worst-case bias that could arise for confounder(s) whose strength of association are no more severe than the requested E-value for either the estimate or the confidence interval (i.e., the bias factor indicated by evalues$biasFactor
). The bias-corrected risk differences for the two strata (stratum = "1"
and stratum = "0"
) are corrected in the direction(s) indicated by evalues$biasDir
.
If you specify unidirectional bias of unknown direction, the E-value is calculated by taking the minimum of the E-value under positive unidirectional bias and the E-value under negative unidirectional bias. With this specification, a third dataframe (candidates
) will be returned. This is similar to evalues
, but contains the results for positive unidirectional bias and negative unidirectional bias (the two "candidate" E-values that were considered).
Mathur MB, Smith LH, Yoshida K, Ding P, VanderWeele TJ (2021). E-values for effect modification and approximations for causal interaction. Under review.
Ding P & VanderWeele TJ (2016). Sensitivity analysis without assumptions. Epidemiology. 27(3), 368.
VanderWeele TJ & Ding P (2017). Sensitivity analysis in observational research: Introducing the E-value. Annals of Internal Medicine. 27(3), 368.
### Letenneur et al. (2000) example data # this is the example given in Mathur et al. (2021) # Z: sex (w = women, m = male; males are the reference category) # Y: dementia (1 = developed dementia, 0 = did not develop dementia ) # X: low education (1 = up to 7 years, 0 = at least 12 years) # n: sample size # data for women nw_1 = 2988 nw_0 = 364 dw = data.frame( Y = c(1, 1, 0, 0), X = c(1, 0, 1, 0), n = c( 158, 6, nw_1-158, nw_0-6 ) ) # data for men nm_1 = 1790 nm_0 = 605 dm = data.frame( Y = c(1, 1, 0, 0), X = c(1, 0, 1, 0), n = c( 64, 17, nm_1-64, nm_0-17 ) ) # P(Y = 1 | X = 1) and P(Y = 1 | X = 0) for women and for men ( pw_1 = dw$n[ dw$X == 1 & dw$Y == 1 ] / sum(dw$n[ dw$X == 1 ]) ) ( pw_0 = dw$n[ dw$X == 0 & dw$Y == 1 ] / sum(dw$n[ dw$X == 0 ]) ) ( pm_1 = dm$n[ dm$X == 1 & dm$Y == 1 ] / sum(dm$n[ dm$X == 1 ]) ) ( pm_0 = dm$n[ dm$X == 0 & dm$Y == 1 ] / sum(dm$n[ dm$X == 0 ]) ) # prevalence of low education among women and among men fw = nw_1 / (nw_1 + nw_0) fm = nm_1 / (nm_1 + nm_0) # confounded interaction contrast estimate ( pw_1 - pw_0 ) - ( pm_1 - pm_0 ) ### E-values without making assumptions on direction of confounding bias # for interaction contrast point estimate evalues.IC( stat = "est", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm ) # and for its lower CI limit evalues.IC( stat = "CI", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm ) ### E-values assuming unidirectonal confounding of unknown direction # for interaction contrast point estimate evalues.IC( stat = "est", unidirBias = TRUE, unidirBiasDirection = "unknown", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm ) # and for its lower CI limit evalues.IC( stat = "CI", unidirBias = TRUE, unidirBiasDirection = "unknown", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm )
### Letenneur et al. (2000) example data # this is the example given in Mathur et al. (2021) # Z: sex (w = women, m = male; males are the reference category) # Y: dementia (1 = developed dementia, 0 = did not develop dementia ) # X: low education (1 = up to 7 years, 0 = at least 12 years) # n: sample size # data for women nw_1 = 2988 nw_0 = 364 dw = data.frame( Y = c(1, 1, 0, 0), X = c(1, 0, 1, 0), n = c( 158, 6, nw_1-158, nw_0-6 ) ) # data for men nm_1 = 1790 nm_0 = 605 dm = data.frame( Y = c(1, 1, 0, 0), X = c(1, 0, 1, 0), n = c( 64, 17, nm_1-64, nm_0-17 ) ) # P(Y = 1 | X = 1) and P(Y = 1 | X = 0) for women and for men ( pw_1 = dw$n[ dw$X == 1 & dw$Y == 1 ] / sum(dw$n[ dw$X == 1 ]) ) ( pw_0 = dw$n[ dw$X == 0 & dw$Y == 1 ] / sum(dw$n[ dw$X == 0 ]) ) ( pm_1 = dm$n[ dm$X == 1 & dm$Y == 1 ] / sum(dm$n[ dm$X == 1 ]) ) ( pm_0 = dm$n[ dm$X == 0 & dm$Y == 1 ] / sum(dm$n[ dm$X == 0 ]) ) # prevalence of low education among women and among men fw = nw_1 / (nw_1 + nw_0) fm = nm_1 / (nm_1 + nm_0) # confounded interaction contrast estimate ( pw_1 - pw_0 ) - ( pm_1 - pm_0 ) ### E-values without making assumptions on direction of confounding bias # for interaction contrast point estimate evalues.IC( stat = "est", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm ) # and for its lower CI limit evalues.IC( stat = "CI", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm ) ### E-values assuming unidirectonal confounding of unknown direction # for interaction contrast point estimate evalues.IC( stat = "est", unidirBias = TRUE, unidirBiasDirection = "unknown", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm ) # and for its lower CI limit evalues.IC( stat = "CI", unidirBias = TRUE, unidirBiasDirection = "unknown", p1_1 = pw_1, p1_0 = pw_0, n1_1 = nw_1, n1_0 = nw_0, f1 = fw, p0_1 = pm_1, p0_0 = pm_0, n0_1 = nm_1, n0_0 = nm_0, f0 = fm )
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion) as well as E-values for the point estimate and the confidence interval limit closer to the null.
evalues.MD(est, se = NA, true = 0, ...)
evalues.MD(est, se = NA, true = 0, ...)
est |
The point estimate as a standardized difference (i.e., Cohen's d) |
se |
The standard error of the point estimate |
true |
The true standardized mean difference to which to shift the observed point estimate. Typically set to 0 to consider a null true effect. |
... |
Arguments passed to other methods. |
Regarding the continuous outcome, the function uses the effect-size conversions in Chinn (2000) and VanderWeele (2017) to approximately convert the mean difference between the exposed versus unexposed groups to the odds ratio that would arise from dichotomizing the continuous outcome.
For example, if resulting E-value is 2, this means that unmeasured confounder(s) would need to double the probability of a subject's being exposed versus not being exposed, and would also need to double the probability of being high versus low on the outcome, in which the cutoff for "high" versus "low" is arbitrary subject to some distributional assumptions (Chinn, 2000).
Chinn, S (2000). A simple method for converting an odds ratio to effect size for use in meta-analysis. Statistics in Medicine, 19(22), 3127-3131.
VanderWeele, TJ (2017). On a square-root transformation of the odds ratio for a common outcome. Epidemiology, 28(6), e58.
# compute E-value if Cohen's d = 0.5 with SE = 0.25 evalues.MD(.5, .25)
# compute E-value if Cohen's d = 0.5 with SE = 0.25 evalues.MD(.5, .25)
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion) as well as E-values for the point estimate and the confidence interval limit closer to the null.
evalues.OLS(est, se = NA, sd, delta = 1, true = 0, ...)
evalues.OLS(est, se = NA, sd, delta = 1, true = 0, ...)
est |
The linear regression coefficient estimate (standardized or unstandardized) |
se |
The standard error of the point estimate |
sd |
The standard deviation of the outcome (or residual standard deviation); see Details |
delta |
The contrast of interest in the exposure |
true |
The true standardized mean difference to which to shift the observed point estimate. Typically set to 0 to consider a null true effect. |
... |
Arguments passed to other methods. |
This function is for linear regression with a continuous exposure
and outcome. Regarding the continuous exposure, the choice of delta
defines essentially a dichotomization in the exposure between hypothetical
groups of subjects with exposures equal to an arbitrary value c versus
to another hypothetical group with exposures equal to c +
delta
. Regarding the continuous outcome, the function uses the
effect-size conversions in Chinn (2000) and VanderWeele (2017) to
approximately convert the mean difference between these exposure "groups" to
the odds ratio that would arise from dichotomizing the continuous outcome.
For example, if resulting E-value is 2, this means that unmeasured
confounder(s) would need to double the probability of a subject's having
exposure equal to c + delta
instead of c, and would also
need to double the probability of being high versus low on the outcome, in
which the cutoff for "high" versus "low" is arbitrary subject to some
distributional assumptions (Chinn, 2000).
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.
Chinn, S (2000). A simple method for converting an odds ratio to effect size for use in meta-analysis. Statistics in Medicine, 19(22), 3127-3131.
VanderWeele, TJ (2017). On a square-root transformation of the odds ratio for a common outcome. Epidemiology, 28(6), e58.
# first standardizing conservatively by SD(Y) data(lead) ols = lm(age ~ income, data = lead) # for a 1-unit increase in income evalues.OLS(est = ols$coefficients[2], se = summary(ols)$coefficients['income', 'Std. Error'], sd = sd(lead$age)) # for a 0.5-unit increase in income evalues.OLS(est = ols$coefficients[2], se = summary(ols)$coefficients['income', 'Std. Error'], sd = sd(lead$age), delta = 0.5) # now use residual SD to avoid conservatism # here makes very little difference because income and age are # not highly correlated evalues.OLS(est = ols$coefficients[2], se = summary(ols)$coefficients['income', 'Std. Error'], sd = summary(ols)$sigma)
# first standardizing conservatively by SD(Y) data(lead) ols = lm(age ~ income, data = lead) # for a 1-unit increase in income evalues.OLS(est = ols$coefficients[2], se = summary(ols)$coefficients['income', 'Std. Error'], sd = sd(lead$age)) # for a 0.5-unit increase in income evalues.OLS(est = ols$coefficients[2], se = summary(ols)$coefficients['income', 'Std. Error'], sd = sd(lead$age), delta = 0.5) # now use residual SD to avoid conservatism # here makes very little difference because income and age are # not highly correlated evalues.OLS(est = ols$coefficients[2], se = summary(ols)$coefficients['income', 'Std. Error'], sd = summary(ols)$sigma)
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion if needed when outcome is common) as well as E-values for the point estimate and the confidence interval limit closer to the null.
evalues.OR(est, lo = NA, hi = NA, rare = NA, true = 1, ...)
evalues.OR(est, lo = NA, hi = NA, rare = NA, true = 1, ...)
est |
The point estimate |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
rare |
1 if outcome is rare (<15 percent at end of follow-up); 0 if outcome is not rare (>15 percent at end of follow-up) |
true |
The true OR to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
... |
Arguments passed to other methods. |
# compute E-values for OR = 0.86 with CI: [0.75, 0.99] # for a common outcome evalues.OR(0.86, 0.75, 0.99, rare = FALSE) ## Example 2 ## Hsu and Small (2013 Biometrics) Data ## sensitivity analysis after log-linear or logistic regression head(lead) ## log linear model -- obtain the conditional risk ratio lead.loglinear = glm(lead ~ ., family = binomial(link = "log"), data = lead[,-1]) est = summary(lead.loglinear)$coef["smoking", c(1, 2)] RR = exp(est[1]) lowerRR = exp(est[1] - 1.96*est[2]) upperRR = exp(est[1] + 1.96*est[2]) evalues.RR(RR, lowerRR, upperRR) ## logistic regression -- obtain the conditional odds ratio lead.logistic = glm(lead ~ ., family = binomial(link = "logit"), data = lead[,-1]) est = summary(lead.logistic)$coef["smoking", c(1, 2)] OR = exp(est[1]) lowerOR = exp(est[1] - 1.96*est[2]) upperOR = exp(est[1] + 1.96*est[2]) evalues.OR(OR, lowerOR, upperOR, rare=FALSE)
# compute E-values for OR = 0.86 with CI: [0.75, 0.99] # for a common outcome evalues.OR(0.86, 0.75, 0.99, rare = FALSE) ## Example 2 ## Hsu and Small (2013 Biometrics) Data ## sensitivity analysis after log-linear or logistic regression head(lead) ## log linear model -- obtain the conditional risk ratio lead.loglinear = glm(lead ~ ., family = binomial(link = "log"), data = lead[,-1]) est = summary(lead.loglinear)$coef["smoking", c(1, 2)] RR = exp(est[1]) lowerRR = exp(est[1] - 1.96*est[2]) upperRR = exp(est[1] + 1.96*est[2]) evalues.RR(RR, lowerRR, upperRR) ## logistic regression -- obtain the conditional odds ratio lead.logistic = glm(lead ~ ., family = binomial(link = "logit"), data = lead[,-1]) est = summary(lead.logistic)$coef["smoking", c(1, 2)] OR = exp(est[1]) lowerOR = exp(est[1] - 1.96*est[2]) upperOR = exp(est[1] + 1.96*est[2]) evalues.OR(OR, lowerOR, upperOR, rare=FALSE)
Returns E-values for the point estimate and the lower confidence interval limit for a positive risk difference. If the risk difference is negative, the exposure coding should be first be reversed to yield a positive risk difference.
evalues.RD(n11, n10, n01, n00, true = 0, alpha = 0.05, grid = 1e-04, ...)
evalues.RD(n11, n10, n01, n00, true = 0, alpha = 0.05, grid = 1e-04, ...)
n11 |
Number of exposed, diseased individuals |
n10 |
Number of exposed, non-diseased individuals |
n01 |
Number of unexposed, diseased individuals |
n00 |
Number of unexposed, non-diseased individuals |
true |
True value of risk difference to which to shift the point estimate. Usually set to 0 to consider the null. |
alpha |
Alpha level |
grid |
Spacing for grid search of E-value |
... |
Arguments passed to other methods. |
## example 1 ## Hammond and Holl (1958 JAMA) Data ## Two by Two Table ## Lung Cancer No Lung Cancer ##Smoker 397 78557 ##Nonsmoker 51 108778 # E-value to shift observed risk difference to 0 evalues.RD(397, 78557, 51, 108778) # E-values to shift observed risk difference to other null values evalues.RD(397, 78557, 51, 108778, true = 0.001)
## example 1 ## Hammond and Holl (1958 JAMA) Data ## Two by Two Table ## Lung Cancer No Lung Cancer ##Smoker 397 78557 ##Nonsmoker 51 108778 # E-value to shift observed risk difference to 0 evalues.RD(397, 78557, 51, 108778) # E-values to shift observed risk difference to other null values evalues.RD(397, 78557, 51, 108778, true = 0.001)
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit for the risk ratio (as provided by the user) as well as E-values for the point estimate and the confidence interval limit closer to the null.
evalues.RR(est, lo = NA, hi = NA, true = 1, ...)
evalues.RR(est, lo = NA, hi = NA, true = 1, ...)
est |
The point estimate |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
true |
The true RR to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
... |
Arguments passed to other methods. |
# compute E-value for leukemia example in VanderWeele and Ding (2017) evalues.RR(0.80, 0.71, 0.91) # you can also pass just the point estimate evalues.RR(0.80) # demonstrate symmetry of E-value # this apparently causative association has same E-value as the above evalues.RR(1 / 0.80)
# compute E-value for leukemia example in VanderWeele and Ding (2017) evalues.RR(0.80, 0.71, 0.91) # you can also pass just the point estimate evalues.RR(0.80) # demonstrate symmetry of E-value # this apparently causative association has same E-value as the above evalues.RR(1 / 0.80)
An example dataset from Hsu and Small (Biometrics, 2013).
lead
lead
An object of class data.frame
with 3340 rows and 18 columns.
A type of bias. Declares that (differential) misclassification will be a component of interest in the multi-bias sensitivity analysis. Generally used within other functions; its output is returned invisibly.
misclassification( ..., rare_outcome = FALSE, rare_exposure = FALSE, verbose = FALSE )
misclassification( ..., rare_outcome = FALSE, rare_exposure = FALSE, verbose = FALSE )
... |
Arguments describing the type of misclassification. Currently two options: "outcome" or "exposure". |
rare_outcome |
Logical. Is the outcome rare enough that outcome odds
ratios approximate risk ratios? Only needed when considering exposure
misclassification. Note that |
rare_exposure |
Logical. Is the exposure rare enough that exposure odds ratios approximate risk ratios? Only needed when considering exposure misclassification. |
verbose |
Logical. If |
Invisibly returns a list with components whose values depend on the
options chosen: n
(the degree of the polynomial in the numerator), d
(the degree of the polynomial in the denominator), m
(the parameters in
the bias factor), mess
(any messages/warnings that should be printed for
the user), and bias
("misclassification").
# returns invisibly without print() print(misclassification("outcome")) # Calculate an E-value for misclassification multi_evalue(est = RR(4), biases = misclassification("exposure", rare_outcome = TRUE, rare_exposure = TRUE))
# returns invisibly without print() print(misclassification("outcome")) # Calculate an E-value for misclassification multi_evalue(est = RR(4), biases = misclassification("exposure", rare_outcome = TRUE, rare_exposure = TRUE))
Multiple biases (confounding()
, selection()
, and/or
misclassification()
) can be assessed simultaneously after creating a
multi_bias
object using this function.
multi_bias(..., verbose = TRUE)
multi_bias(..., verbose = TRUE)
... |
Biases ( |
verbose |
Logical. If |
Invisibly returns a list with components whose values depend on the
options chosen: n
(the degree of the polynomial in the numerator), d
(the degree of the polynomial in the denominator), m
(the parameters in
the bias factor), mess
(any messages/warnings that should be printed for
the user), and bias
("misclassification").
biases <- multi_bias(confounding(), selection("general")) # print() lists the arguments for the multi_bound() function print(biases) # summary() provides more information # with parameters in latex notation if latex = TRUE summary(biases, latex = TRUE) # Calculate a bound multi_bound(biases = biases, RRAUc = 1.5, RRUcY = 2, RRUsYA1 = 1.25, RRSUsA1 = 4, RRUsYA0 = 3, RRSUsA0 = 2)
biases <- multi_bias(confounding(), selection("general")) # print() lists the arguments for the multi_bound() function print(biases) # summary() provides more information # with parameters in latex notation if latex = TRUE summary(biases, latex = TRUE) # Calculate a bound multi_bound(biases = biases, RRAUc = 1.5, RRUcY = 2, RRUsYA1 = 1.25, RRSUsA1 = 4, RRUsYA0 = 3, RRSUsA0 = 2)
Function used to calculate the maximum factor by which a risk ratio is biased, given possible values for each of the parameters that describe the bias factors for each type of bias.
multi_bound( biases, RRAUc = NULL, RRUcY = NULL, RRUsYA1 = NULL, RRSUsA1 = NULL, RRUsYA0 = NULL, RRSUsA0 = NULL, RRAUscS = NULL, RRUscYS = NULL, RRAYy = NULL, ORYAa = NULL, RRYAa = NULL, RRAYyS = NULL, ORYAaS = NULL, RRYAaS = NULL, RRAUsS = NULL, RRUsYS = NULL )
multi_bound( biases, RRAUc = NULL, RRUcY = NULL, RRUsYA1 = NULL, RRSUsA1 = NULL, RRUsYA0 = NULL, RRSUsA0 = NULL, RRAUscS = NULL, RRUscYS = NULL, RRAYy = NULL, ORYAa = NULL, RRYAa = NULL, RRAYyS = NULL, ORYAaS = NULL, RRYAaS = NULL, RRAUsS = NULL, RRUsYS = NULL )
biases |
A set of biases (or single bias) to include in the calculation
of the bound. A single object constructed with the |
RRAUc |
Named parameter values with which to calculate a bound. Names must
correspond to the parameters defining the biases provided by |
RRUcY |
See |
RRUsYA1 |
See |
RRSUsA1 |
See |
RRUsYA0 |
See |
RRSUsA0 |
See |
RRAUscS |
See |
RRUscYS |
See |
RRAYy |
See |
ORYAa |
See |
RRYAa |
See |
RRAYyS |
See |
ORYAaS |
See |
RRYAaS |
See |
RRAUsS |
See |
RRUsYS |
See |
The names of the parameters in the bound can be found for a given
set of biases with print(biases)
. Running summary(biases)
shows the
equivalent notation used in the output of the multi_evalue()
function.
Returns the value of the bound formed as a function of the provided parameters.
multi_bound(multi_bias(confounding()), RRAUc = 2.2, RRUcY = 1.7) biases <- multi_bias(confounding(), selection("S = U"), misclassification("exposure", rare_outcome = TRUE, rare_exposure = FALSE)) print(biases) multi_bound(biases, RRAUc = 3, RRUcY = 2, RRSUsA1 = 2.3, RRSUsA0 = 1.7, ORYAaS = 5.2)
multi_bound(multi_bias(confounding()), RRAUc = 2.2, RRUcY = 1.7) biases <- multi_bias(confounding(), selection("S = U"), misclassification("exposure", rare_outcome = TRUE, rare_exposure = FALSE)) print(biases) multi_bound(biases, RRAUc = 3, RRUcY = 2, RRSUsA1 = 2.3, RRSUsA0 = 1.7, ORYAaS = 5.2)
Calculate an E-value for a specified set of biases.
multi_evalue(biases, est, ...) multi_evalues.HR( biases, est, lo = NA, hi = NA, rare = NULL, true = 1, verbose = TRUE, ... ) multi_evalues.OR( biases, est, lo = NA, hi = NA, rare = NULL, true = 1, verbose = TRUE, ... ) multi_evalues.RR(biases, est, lo = NA, hi = NA, true = 1, verbose = TRUE, ...)
multi_evalue(biases, est, ...) multi_evalues.HR( biases, est, lo = NA, hi = NA, rare = NULL, true = 1, verbose = TRUE, ... ) multi_evalues.OR( biases, est, lo = NA, hi = NA, rare = NULL, true = 1, verbose = TRUE, ... ) multi_evalues.RR(biases, est, lo = NA, hi = NA, true = 1, verbose = TRUE, ...)
biases |
An object created by |
est |
The effect estimate that was observed but which is suspected to be
biased. This may be of class "estimate" (constructed with |
... |
Arguments passed to other methods. |
lo |
Optional. Lower bound of the confidence interval. If not an object
of class "estimate", assumed to be on the same scale as |
hi |
Optional. Upper bound of the confidence interval. If not an object
of class "estimate", assumed to be on the same scale as |
rare |
Logical indicating whether outcome is sufficiently rare for risk ratio approximation to hold. |
true |
A number to which to shift the observed estimate to. Defaults to
|
verbose |
Logical indicating whether or not to print information about which parameters the multi-bias E-value refers to. Defaults to TRUE. |
Returns a multiple bias E-value, of class "multi_evalue", describing the value that each of a number of parameters would have to have for the observed effect measure to be completely explained by bias.
# Calculate an E-value for unmeasured confounding multi_evalue(est = RR(4), biases = confounding()) # Equivalent to evalues.RR(4) # Calculate a multi-bias E-value for selection bias # and misclassification multi_evalue(est = RR(2.5), biases = multi_bias(selection("selected"), misclassification("outcome"))) # Calculate a multi-bias E-value for all three # available types of bias biases <- multi_bias(confounding(), selection("general", "S = U"), misclassification("exposure", rare_outcome = TRUE)) multi_evalue(est = RR(2.5), biases = biases) # Calculate a multi-bias E-value for a non-rare OR # using the square root approximation multi_evalue(est = OR(2.5, rare = FALSE), biases = biases) # Calculate a non-null multi-bias E-value multi_evalue(est = RR(2.5), biases = biases, true = 2)
# Calculate an E-value for unmeasured confounding multi_evalue(est = RR(4), biases = confounding()) # Equivalent to evalues.RR(4) # Calculate a multi-bias E-value for selection bias # and misclassification multi_evalue(est = RR(2.5), biases = multi_bias(selection("selected"), misclassification("outcome"))) # Calculate a multi-bias E-value for all three # available types of bias biases <- multi_bias(confounding(), selection("general", "S = U"), misclassification("exposure", rare_outcome = TRUE)) multi_evalue(est = RR(2.5), biases = biases) # Calculate a multi-bias E-value for a non-rare OR # using the square root approximation multi_evalue(est = OR(2.5, rare = FALSE), biases = biases) # Calculate a non-null multi-bias E-value multi_evalue(est = RR(2.5), biases = biases, true = 2)
A type of bias. Declares that selection bias will be a component of interest in the multi-bias sensitivity analysis. Generally used within other functions; its output is returned invisibly.
selection(..., verbose = FALSE)
selection(..., verbose = FALSE)
... |
Optional arguments describing the type of potential selection bias. Options are "general" (general selection bias, the default if no options are chosen), "increased risk" and "decreased risk" (assumptions about the direction of risk in the selected population), "S = U" (simplification used if the biasing characteristic is common to the entire selected population), and "selected" (when the target of inference is the selected population only). Errors are produced when incompatible assumptions are chosen. |
verbose |
Logical. If |
Invisibly returns a list with components whose values depend on the
options chosen: n
(the degree of the polynomial in the numerator), d
(the degree of the polynomial in the denominator),mess
(any
messages/warnings that should be printed for the user), and
bias
("selection").
# returns invisibly without print() print(selection("general", "increased risk")) # Calculate an E-value for selection bias only multi_evalue(est = RR(4), biases = selection("general", "increased risk"))
# returns invisibly without print() print(selection("general", "increased risk")) # Calculate an E-value for selection bias only multi_evalue(est = RR(4), biases = selection("general", "increased risk"))
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion if needed when outcome is common) as well as E-values for the point estimate and the confidence interval limit closer to the null.
selection_evalue( est, lo = NA, hi = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
selection_evalue( est, lo = NA, hi = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
est |
The point estimate: a risk, odds, or hazard ratio. An object of
class "estimate", it should be constructed with functions |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
true |
The true value to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
sel_pop |
Whether inference is specific to selected population (TRUE) or entire population (FALSE). Defaults to FALSE. |
S_eq_U |
Whether the unmeasured factor is assumed to be a defining characteristic of the selected population. Defaults to FALSE. |
risk_inc |
Whether selection is assumed to be associated with increased risk of the outcome in both exposure groups. Defaults to FALSE. |
risk_dec |
Whether selection is assumed to be associated with decreased risk of the outcome in both exposure groups. Defaults to FALSE. |
... |
Arguments passed to other methods. |
A selection bias E-value is a summary measure that helps assess
susceptibility of a result to selection bias. Each of one or more
parameters characterizing the extent of the bias must be greater than or
equal to this value to be sufficient to shift an estimate (est
) to
the null or other true value (true
). The parameters, as defined in
Smith and VanderWeele 2019, depend on assumptions an investigator is
willing to make (see arguments sel_pop
, S_eq_U
,
risk_inc
, risk_dec
). The function prints a
message about which parameters the selection bias E-value refers to given
the assumptions made. See the cited article for details.
# Examples from Smith and VanderWeele 2019 # Zika virus example selection_evalue(OR(73.1, rare = TRUE), lo = 13.0) # Endometrial cancer example selection_evalue(OR(2.30, rare = TRUE), true = 11.98, S_eq_U = TRUE, risk_inc = TRUE) # Obesity paradox example selection_evalue(RR(1.50), lo = 1.22, sel_pop = TRUE)
# Examples from Smith and VanderWeele 2019 # Zika virus example selection_evalue(OR(73.1, rare = TRUE), lo = 13.0) # Endometrial cancer example selection_evalue(OR(2.30, rare = TRUE), true = 11.98, S_eq_U = TRUE, risk_inc = TRUE) # Obesity paradox example selection_evalue(RR(1.50), lo = 1.22, sel_pop = TRUE)
Produces line plots (type="line"
) showing the average bias factor across studies on the relative risk (RR) scale vs. the estimated proportion
of studies with true RRs above or below a chosen threshold q
.
The plot secondarily includes a X-axis showing the minimum strength of confounding
to produce the given bias factor. The shaded region represents a pointwise confidence band.
Alternatively, produces distribution plots (type="dist"
) for a specific bias factor showing the observed and
true distributions of RRs with a red line marking exp(q
).
sens_plot( method = "calibrated", type, q, CI.level = 0.95, tail = NA, muB.toward.null = FALSE, give.CI = TRUE, Bmin = 0, Bmax = log(4), breaks.x1 = NA, breaks.x2 = NA, muB, sigB, yr, vyr = NA, t2, vt2 = NA, R = 1000, dat = NA, yi.name = NA, vi.name = NA )
sens_plot( method = "calibrated", type, q, CI.level = 0.95, tail = NA, muB.toward.null = FALSE, give.CI = TRUE, Bmin = 0, Bmax = log(4), breaks.x1 = NA, breaks.x2 = NA, muB, sigB, yr, vyr = NA, t2, vt2 = NA, R = 1000, dat = NA, yi.name = NA, vi.name = NA )
method |
|
type |
|
q |
True causal effect size chosen as the threshold for a meaningfully large effect |
CI.level |
Pointwise confidence level as a proportion (e.g., 0.95). |
tail |
|
muB.toward.null |
Whether you want to consider bias that has on average shifted studies' point estimates away from the null ( |
give.CI |
Logical. If |
Bmin |
Lower limit of lower X-axis on the log scale (only needed if |
Bmax |
Upper limit of lower X-axis on the log scale (only needed if |
breaks.x1 |
Breaks for lower X-axis (bias factor) on RR scale. (optional for |
breaks.x2 |
Breaks for upper X-axis (confounding strength) on RR scale (optional for |
muB |
Single mean bias factor on log scale (only needed if |
sigB |
Standard deviation of log bias factor across studies (only used if |
yr |
Pooled point estimate (on log scale) from confounded meta-analysis (only used if |
vyr |
Estimated variance of pooled point estimate from confounded meta-analysis (only used if |
t2 |
Estimated heterogeneity ( |
vt2 |
Estimated variance of |
R |
Number of bootstrap iterates for confidence interval estimation. Only used if |
dat |
Dataframe containing studies' point estimates and variances. Only used if |
yi.name |
Name of variable in |
vi.name |
Name of variable in |
This function calls confounded_meta
to get the point estimate and confidence interval at each value of the bias factor. See ?confounded_meta
for details.
Note that Bmin
and Bmax
are specified on the log scale for consistency with the muB
argument and with the function confounded_meta
, whereas breaks.x1
and breaks.x2
are specified on the relative risk scale to facilitate adjustments to the plot appearance.
Mathur MB & VanderWeele TJ (2020a). Sensitivity analysis for unmeasured confounding in meta-analyses. Journal of the American Statistical Association.
Mathur MB & VanderWeele TJ (2020b). Robust metrics and sensitivity analyses for meta-analyses of heterogeneous effects. Epidemiology.
Wang C-C & Lee W-C (2019). A simple method to estimate prediction intervals and predictive distributions: Summarizing meta-analyses beyond means and confidence intervals. Research Synthesis Methods.
##### Example 1: Calibrated Line Plots ##### # simulated dataset with exponentially distributed # population effects # we will use the calibrated method to avoid normality assumption data(toyMeta) # without confidence band sens_plot( method = "calibrated", type="line", q=log(.9), tail = "below", dat = toyMeta, yi.name = "est", vi.name = "var", give.CI = FALSE ) # # with confidence band and a different threshold, q # # commented out because takes a while too run # sens_plot( method = "calibrated", # type="line", # q=0, # tail = "below", # dat = toyMeta, # yi.name = "est", # vi.name = "var", # give.CI = TRUE, # R = 300 ) # should be higher in practice ##### Example 2: Calibrated and Parametric Line Plots ##### # example dataset d = metafor::escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=metadat::dat.bcg) # without confidence band sens_plot( method = "calibrated", type="line", tail = "below", q=log(1.1), dat = d, yi.name = "yi", vi.name = "vi", give.CI = FALSE ) # # with confidence band # # commented out because it takes a while # # this example gives bootstrap warnings because of its small sample size # sens_plot( method = "calibrated", # type="line", # q=log(1.1), # R = 500, # should be higher in practice (e.g., 1000) # dat = d, # yi.name = "yi", # vi.name = "vi", # give.CI = TRUE ) # now with heterogeneous bias across studies (via sigB) and with confidence band sens_plot( method = "parametric", type="line", q=log(1.1), yr=log(1.3), vyr = .05, vt2 = .001, t2=0.4, sigB = 0.1, Bmin=0, Bmax=log(4) ) ##### Distribution Line Plot ##### # distribution plot: apparently causative sens_plot( type="dist", q=log(1.1), muB=log(2), sigB = 0.1, yr=log(1.3), t2=0.4 ) # distribution plot: apparently preventive sens_plot( type="dist", q=log(0.90), muB=log(1.5), sigB = 0.1, yr=log(0.7), t2=0.2 )
##### Example 1: Calibrated Line Plots ##### # simulated dataset with exponentially distributed # population effects # we will use the calibrated method to avoid normality assumption data(toyMeta) # without confidence band sens_plot( method = "calibrated", type="line", q=log(.9), tail = "below", dat = toyMeta, yi.name = "est", vi.name = "var", give.CI = FALSE ) # # with confidence band and a different threshold, q # # commented out because takes a while too run # sens_plot( method = "calibrated", # type="line", # q=0, # tail = "below", # dat = toyMeta, # yi.name = "est", # vi.name = "var", # give.CI = TRUE, # R = 300 ) # should be higher in practice ##### Example 2: Calibrated and Parametric Line Plots ##### # example dataset d = metafor::escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=metadat::dat.bcg) # without confidence band sens_plot( method = "calibrated", type="line", tail = "below", q=log(1.1), dat = d, yi.name = "yi", vi.name = "vi", give.CI = FALSE ) # # with confidence band # # commented out because it takes a while # # this example gives bootstrap warnings because of its small sample size # sens_plot( method = "calibrated", # type="line", # q=log(1.1), # R = 500, # should be higher in practice (e.g., 1000) # dat = d, # yi.name = "yi", # vi.name = "vi", # give.CI = TRUE ) # now with heterogeneous bias across studies (via sigB) and with confidence band sens_plot( method = "parametric", type="line", q=log(1.1), yr=log(1.3), vyr = .05, vt2 = .001, t2=0.4, sigB = 0.1, Bmin=0, Bmax=log(4) ) ##### Distribution Line Plot ##### # distribution plot: apparently causative sens_plot( type="dist", q=log(1.1), muB=log(2), sigB = 0.1, yr=log(1.3), t2=0.4 ) # distribution plot: apparently preventive sens_plot( type="dist", q=log(0.90), muB=log(1.5), sigB = 0.1, yr=log(0.7), t2=0.2 )
A meta-analysis of observational studies (12 case-control and six cohort or nested case-control) on the association of soy-food intake with breast cancer risk. Data are from Trock et al.'s (2006) Table 1. This dataset was used as the applied example in Mathur & VanderWeele (2020a).
soyMeta
soyMeta
An object of class data.frame
with 20 rows and 3 columns.
The variables are as follows:
author
Last name of the study's first author.
est
Point estimate on the log-relative risk or log-odds ratio scale.
var
Variance of the log-relative risk or log-odds ratio.
Trock BJ, Hilakivi-Clarke L, Clark R (2006). Meta-analysis of soy intake and breast cancer risk. Journal of the National Cancer Institute.
Mathur MB & VanderWeele TJ (2020a). Sensitivity analysis for unmeasured confounding in meta-analyses. Journal of the American Statistical Association.
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion if needed when outcome is common) as well as selection bias E-values for the point estimate and the confidence interval limit closer to the null.
svalues.HR( est, lo = NA, hi = NA, rare = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
svalues.HR( est, lo = NA, hi = NA, rare = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
est |
The point estimate |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
rare |
1 if outcome is rare (<15 percent at end of follow-up); 0 if outcome is not rare (>15 percent at end of follow-up) |
true |
The true HR to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
sel_pop |
Whether inference is specific to selected population (TRUE) or entire population (FALSE). Defaults to FALSE. |
S_eq_U |
Whether the unmeasured factor is assumed to be a defining characteristic of the selected population. Defaults to FALSE. |
risk_inc |
Whether selection is assumed to be associated with increased risk of the outcome in both exposure groups. Defaults to FALSE. |
risk_dec |
Whether selection is assumed to be associated with decreased risk of the outcome in both exposure groups. Defaults to FALSE. |
... |
Arguments passed to other methods. |
A selection bias E-value is a summary measure that helps assess
susceptibility of a result to selection bias. Each of one or more
parameters characterizing the extent of the bias must be greater than or
equal to this value to be sufficient to shift an estimate (est
) to
the null or other true value (true
). The parameters, as defined in
Smith and VanderWeele 2019, depend on assumptions an investigator is
willing to make (see arguments sel_pop
, S_eq_U
,
risk_inc
, risk_dec
). The svalues.XX
functions print a
message about which parameters the selection bias E-value refers to given
the assumptions made. See the cited article for details.
# Examples from Smith and VanderWeele 2019 # Obesity paradox example svalues.RR(est = 1.50, lo = 1.22, sel_pop = TRUE)
# Examples from Smith and VanderWeele 2019 # Obesity paradox example svalues.RR(est = 1.50, lo = 1.22, sel_pop = TRUE)
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (through an approximate conversion if needed when outcome is common) as well as E-values for the point estimate and the confidence interval limit closer to the null.
svalues.OR( est, lo = NA, hi = NA, rare = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
svalues.OR( est, lo = NA, hi = NA, rare = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
est |
The point estimate |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
rare |
1 if outcome is rare (<15 percent at end of follow-up); 0 if outcome is not rare (>15 percent at end of follow-up) |
true |
The true OR to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
sel_pop |
Whether inference is specific to selected population (TRUE) or entire population (FALSE). Defaults to FALSE. |
S_eq_U |
Whether the unmeasured factor is assumed to be a defining characteristic of the selected population. Defaults to FALSE. |
risk_inc |
Whether selection is assumed to be associated with increased risk of the outcome in both exposure groups. Defaults to FALSE. |
risk_dec |
Whether selection is assumed to be associated with decreased risk of the outcome in both exposure groups. Defaults to FALSE. |
... |
Arguments passed to other methods. |
A selection bias E-value is a summary measure that helps assess
susceptibility of a result to selection bias. Each of one or more
parameters characterizing the extent of the bias must be greater than or
equal to this value to be sufficient to shift an estimate (est
) to
the null or other true value (true
). The parameters, as defined in
Smith and VanderWeele 2019, depend on assumptions an investigator is
willing to make (see arguments sel_pop
, S_eq_U
,
risk_inc
, risk_dec
). The svalues.XX
functions print a
message about which parameters the selection bias E-value refers to given
the assumptions made. See the cited article for details.
# Examples from Smith and VanderWeele 2019 # Zika virus example svalues.OR(est = 73.1, rare = TRUE, lo = 13.0) # Endometrial cancer example svalues.OR(est = 2.30, rare = TRUE, true = 11.98, S_eq_U = TRUE, risk_inc = TRUE)
# Examples from Smith and VanderWeele 2019 # Zika virus example svalues.OR(est = 73.1, rare = TRUE, lo = 13.0) # Endometrial cancer example svalues.OR(est = 2.30, rare = TRUE, true = 11.98, S_eq_U = TRUE, risk_inc = TRUE)
Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit for the risk ratio (as provided by the user) as well as selection bias E-values for the point estimate and the confidence interval limit closer to the null.
svalues.RR( est, lo = NA, hi = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
svalues.RR( est, lo = NA, hi = NA, true = 1, sel_pop = FALSE, S_eq_U = FALSE, risk_inc = FALSE, risk_dec = FALSE, ... )
est |
The point estimate |
lo |
The lower limit of the confidence interval |
hi |
The upper limit of the confidence interval |
true |
The true RR to which to shift the observed point estimate. Typically set to 1 to consider a null true effect. |
sel_pop |
Whether inference is specific to selected population (TRUE) or entire population (FALSE). Defaults to FALSE. |
S_eq_U |
Whether the unmeasured factor is assumed to be a defining characteristic of the selected population. Defaults to FALSE. |
risk_inc |
Whether selection is assumed to be associated with increased risk of the outcome in both exposure groups. Defaults to FALSE. |
risk_dec |
Whether selection is assumed to be associated with decreased risk of the outcome in both exposure groups. Defaults to FALSE. |
... |
Arguments passed to other methods. |
A selection bias E-value is a summary measure that helps assess
susceptibility of a result to selection bias. Each of one or more parameters
characterizing the extent of the bias must be greater than or equal to this
value to be sufficient to shift an estimate (est
) to the null or other
true value (true
). The parameters, as defined in Smith and VanderWeele
2019, depend on assumptions an investigator is willing to make (see arguments
sel_pop
, S_eq_U
, risk_inc
, risk_dec
). The
svalues.XX
functions print a message about which parameters the
selection bias E-value refers to given the assumptions made. See the cited
article for details.
# Examples from Smith and VanderWeele 2019 # Zika virus example svalues.RR(est = 73.1, lo = 13.0) # Endometrial cancer example svalues.RR(est = 2.30, true = 11.98, S_eq_U = TRUE, risk_inc = TRUE) # Obesity paradox example svalues.RR(est = 1.50, lo = 1.22, sel_pop = TRUE)
# Examples from Smith and VanderWeele 2019 # Zika virus example svalues.RR(est = 73.1, lo = 13.0) # Endometrial cancer example svalues.RR(est = 2.30, true = 11.98, S_eq_U = TRUE, risk_inc = TRUE) # Obesity paradox example svalues.RR(est = 1.50, lo = 1.22, sel_pop = TRUE)
A simple simulated meta-analysis of 50 studies with exponentially distributed population effects.
toyMeta
toyMeta
An object of class data.frame
with 50 rows and 2 columns.
The variables are as follows:
est
Point estimate on the log-relative risk scale.
var
Variance of the log-relative risk.
Given counts in a two-by-two table, computes risk ratio and confidence interval limits.
twoXtwoRR(n11, n10, n01, n00, alpha = 0.05)
twoXtwoRR(n11, n10, n01, n00, alpha = 0.05)
n11 |
Number exposed (X=1) and diseased (D=1) |
n10 |
Number exposed (X=1) and not diseased (D=0) |
n01 |
Number unexposed (X=0) and diseased (D=1) |
n00 |
Number unexposed (X=0) and not diseased (D=0) |
alpha |
Alpha level associated with confidence interval |
# Hammond and Holl (1958 JAMA) Data # Two by Two Table # Lung Cancer No Lung Cancer # Smoker 397 78557 # Nonsmoker 51 108778 twoXtwoRR(397, 78557, 51, 108778)
# Hammond and Holl (1958 JAMA) Data # Two by Two Table # Lung Cancer No Lung Cancer # Smoker 397 78557 # Nonsmoker 51 108778 twoXtwoRR(397, 78557, 51, 108778)