Description Usage Arguments Details References Examples
View source: R/metaanalysis.R
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 Xaxis 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
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 
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 Xaxis on the log scale (only needed if 
Bmax 
Upper limit of lower Xaxis on the log scale (only needed if 
breaks.x1 
Breaks for lower Xaxis (bias factor) on RR scale. (optional for 
breaks.x2 
Breaks for upper Xaxis (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 metaanalysis (only used if 
vyr 
Estimated variance of pooled point estimate from confounded metaanalysis (only used if 
t2 
Estimated heterogeneity (τ^2) from confounded metaanalysis (only used if 
vt2 
Estimated variance of τ^2 from confounded metaanalysis (only used if 
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 metaanalyses. Journal of the American Statistical Association.
Mathur MB & VanderWeele TJ (2020b). Robust metrics and sensitivity analyses for metaanalyses of heterogeneous effects. Epidemiology.
Wang CC & Lee WC (2019). A simple method to estimate prediction intervals and predictive distributions: Summarizing metaanalyses beyond means and confidence intervals. Research Synthesis Methods.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93  ##### 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 )

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.