sens_plot: Plots for sensitivity analyses

Description Usage Arguments Details References Examples

View source: R/meta-analysis.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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

"calibrated" or "parametric". See Details.

type

dist for distribution plot; line for line plot (see Details)

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

"above" for the proportion of effects above q; "below" for the proportion of effects below q. By default, is set to "above" if the pooled point estimate (method = "parametric") or median of the calibrated estimates (method = "calibrated") is above 1 on the relative risk scale and is set to "below" otherwise.

muB.toward.null

Whether you want to consider bias that has on average shifted studies' point estimates away from the null (FALSE; the default) or that has on average shifted studies' point estimates toward the null (TRUE). See Details.

give.CI

Logical. If TRUE, a pointwise confidence intervals is plotted.

Bmin

Lower limit of lower X-axis on the log scale (only needed if type = "line").

Bmax

Upper limit of lower X-axis on the log scale (only needed if type = "line")

breaks.x1

Breaks for lower X-axis (bias factor) on RR scale. (optional for type = "line"; not used for type = "dist").

breaks.x2

Breaks for upper X-axis (confounding strength) on RR scale (optional for type = "line"; not used for type = "dist")

muB

Single mean bias factor on log scale (only needed if type = "dist")

sigB

Standard deviation of log bias factor across studies (only used if method = "parametric")

yr

Pooled point estimate (on log scale) from confounded meta-analysis (only used if method = "parametric")

vyr

Estimated variance of pooled point estimate from confounded meta-analysis (only used if method = "parametric")

t2

Estimated heterogeneity (τ^2) from confounded meta-analysis (only used if method = "parametric")

vt2

Estimated variance of τ^2 from confounded meta-analysis (only used if method = "parametric")

R

Number of bootstrap iterates for confidence interval estimation. Only used if method = "calibrated" and give.CI = TRUE.

dat

Dataframe containing studies' point estimates and variances. Only used if method = "calibrated".

yi.name

Name of variable in dat containing studies' point estimates. Only used if method = "calibrated".

vi.name

Name of variable in dat containing studies' variance estimates. Only used if method = "calibrated".

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

 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 )

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