sens_plot {EValue} | R Documentation |
Plots for sensitivity analyses
Description
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
).
Usage
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
)
Arguments
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 |
Details
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.
References
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.
Examples
##### 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 )