Learn R Programming

metaviz (version 0.4.0)

viz_funnel: Funnel plot variants for meta-analysis

Description

Creates a funnel plot. Many options regarding the appearance and statistical information displayed are provided (e.g., significance contours, additional evidence contours, and trim-and-fill analysis).

Usage

viz_funnel(
  x,
  group = NULL,
  y_axis = "se",
  method = "FE",
  contours = TRUE,
  sig_contours = TRUE,
  addev_contours = FALSE,
  contours_col = "Blues",
  contours_type = "FEM",
  detail_level = 1,
  egger = FALSE,
  trim_and_fill = FALSE,
  trim_and_fill_side = "left",
  text_size = 3,
  point_size = 2,
  xlab = "Effect",
  ylab = NULL,
  group_legend = FALSE,
  group_legend_title = "",
  x_trans_function = NULL,
  x_breaks = NULL
)

Value

A funnel plot is created using ggplot2.

Arguments

x

data.frame or matrix with the effect sizes of all studies (e.g., correlations, log odds ratios, or Cohen d) in the first column and their respective standard errors in the second column. Alternatively, x can be the output object of function rma.uni from package metafor; then effect sizes and standard errors are extracted from x.

group

factor indicating the subgroup of each study to show in the funnel plot. Has to be in the same order than x.

y_axis

character string indicating which y axis should be used in the funnel plot. Available options are "se" (default) for standard error and "precision" for the reciprocal of the standard error.

method

character string indicating the method used to compute the meta-analytic summary effect and, for a random effects model, the between-study variance \(\tau^2\). Can be any method argument from rma.uni (e.g., "FE" for the fixed effect model, or "DL" for the random effects model using the DerSimonian-Laird method to estimate \(\tau^2\)). If input x is an output object of function rma.uni from package metafor, then the method is extracted from x.

contours

logical scalar indicating if classic funnel plot confidence contours and the summary effect should be displayed.

sig_contours

logical scalar. Should significance contours be drawn (at the 0.05 or 0.01 level using a Wald test)?

addev_contours

logical scalar. Should approximate additional evidence contours be drawn, showing the significance of the updated summary effect? See Details. Note: For method other than "FE" or "DL" runtime is increased significantly. Consider reducing detail_level.

contours_col

character string indicating the color palette used from package RColorBrewer for sig_contours, and addev_contours. Can be any of "Blues", "Greys", "Oranges", "Greens", "Reds", and "Purples".

contours_type

character string indicating how confidence contours are computed. Must be either "FEM" or "REM". If contours_type is set to "FEM" (default), contours are given as M +/- qnorm(0.975)*SE, with M the meta-analytic summary effect and SE the study standard error. If contours_type is set to "REM", contours are given as M +/- qnorm(0.975)*sqrt(SE^2 + \(\tau^2\)), with M again the meta-analytic summary effect, SE the study standard error and \(\tau^2\) the esimated between study heterogeneity from a random effects model. The argument of contours_type has no effect if \(\tau^2\) is zero.

detail_level

numeric scalar. Allows to increase or decrease the plotting detail of contours. Values can be chosen between 0.1 and 10. Default is 1.

egger

logical scalar. Should Egger's regression line be drawn? Only available if y_axis is "se".

trim_and_fill

logical scalar. Should studies imputed by the trim and fill method be displayed? Also shows the adjusted summary effect if contours is TRUE as well.

trim_and_fill_side

character string indicating on which side of the funnel plot studies should be imputed by the trim and fill method (i.e., on which side are studies presumably missing due to publication bias). Must be either "right" or "left" (default).

text_size

numeric value. Size of text in the funnel plot. Default is 3.

point_size

numeric value. Size of the study points in the funnel plot. Default is 2.

xlab

character string specifying the label of the x axis.

ylab

character string specifying the label of the y axis.

group_legend

logical scalar. Should there be a legend shown at the bottom of the graph if group was supplied?

group_legend_title

a character string specifying the title of the legend if group was supplied and group_legend is TRUE.

x_trans_function

function to transform the labels of the x axis. Common uses are to transform log-odds-ratios or log-risk-ratios with exp to their original scale (odds ratios and risk ratios), or Fisher's z values back to correlation coefficients using tanh.

x_breaks

numeric vector of values for the breaks on the x-axis. When used in tandem with x_trans_function the supplied values should be not yet transformed.

Author

Michael Kossmeier* <[email protected]>

Ulrich S. Tran* <[email protected]>

Martin Voracek* <[email protected]>

*Department of Basic Psychological Research and Research Methods, School of Psychology, University of Vienna

Details

The funnel plot is a widely used diagnostic plot in meta-analysis to assess small-study effects and, in particular, publication bias. The function viz_funnel can create a wide range of different funnel plot variants. Options for several graphical augmentations (e.g., confidence, significance, and additional evidence contours; choice of the ordinate; study subgroups) and different types of statistical information are provided, including Egger's regression line, imputed studies from the trim-and-fill method, and the corresponding adjusted summary effect.

Contours

Three different types of contours are available in viz_funnel:

  1. Confidence contours (argument contours) show the region in which 95 meta-analytic model is correct and that the estimated model parameters correspond to the parameters of interest. Confidence contours can help assess the plausibility of observations given the specified meta-analytic model (fixed-effect or random-effects model).

  2. Significance contours (argument sig_contours) show shaded regions corresponding to individual study significance at the 5 (using the supplied standard errors and a Wald test). Significance contours were proposed to help distinguish publication bias from other sources of funnel plot asymmetry (Peters, Sutton, Jones, Abrams, & Rushton, 2008).

  3. Additional evidence contours: Significance of the summary effect (argument addev_contours) define regions in which the result of a new study would have to fall for the updated meta-analytic summary effect to be significantly different from zero or not (using a two-sided test and an alpha level of 5 of the meta-analysis with respect to the potential impact of new evidence on the significance of the meta-analytic summary effect (Langan, Higgins, Gregory, & Sutton, 2012).

Measure on the y-axis

Two different options for the y-axis are available. First, standard errors can be plotted on a reversed axis (i.e., studies with small standard errors are at the top). Second, precision (i.e., 1 divided by the standard error) can be used. Standard errors on the y-axis should be preferred in most situations, but precision may have advantages when one or a few large studies (with high precision) are compared with smaller studies condensed at the bottom of the funnel plot (Sterne & Egger, 2001).

Egger's regression line

Egger's regression line (Egger, Smith, Schneider, & Minder, 1997) can be displayed when the standard error is used on the y-axis. Classic Egger's regression can be computed using OLS regression of the standardized effect size (effect size divided by its standard error) on precision (1 divided by the standard error). Displaying this line in the funnel plot can further help to visually assess funnel plot asymmetry.

Trim-and-fill analysis

Studies imputed by the trim-and-fill method, as well as the adjusted summary effect (Duval & Tweedie, 2000), can be displayed. The trim-and-fill algorithm estimates the number of extreme studies contributing to funnel plot asymmetry. It then trims these studies and computes an adjusted summary effect based on the remaining studies. Finally, it imputes studies, presumed to be missing due to publication bias, by mirroring the trimmed studies around the adjusted summary effect. The user has to specify the side of the funnel plot on which the trim-and-fill method should impute missing studies (i.e., the direction in which studies are presumed to be missing due to publication bias). The L estimator defined by Duval and Tweedie (2000) is used to estimate the number of studies contributing to funnel plot asymmetry.

References

Duval, S., & Tweedie, R. (2000). Trim and fill: a simple funnel-plot-based method of testing and adjusting for publication bias in meta-analysis. Biometrics, 56, 455-463.

Egger, M., Smith, G. D., Schneider, M., & Minder, C. (1997). Bias in meta-analysis detected by a simple, graphical test. Bmj, 315, 629-634.

Langan, D., Higgins, J. P., Gregory, W., & Sutton, A. J. (2012). Graphical augmentations to the funnel plot assess the impact of additional evidence on a meta-analysis. Journal of clinical epidemiology, 65, 511-519.

Peters, J. L., Sutton, A. J., Jones, D. R., Abrams, K. R., & Rushton, L. (2008). Contour-enhanced meta-analysis funnel plots help distinguish publication bias from other causes of asymmetry. Journal of clinical epidemiology, 61, 991-996.

Sterne, J. A., & Egger, M. (2001). Funnel plots for detecting bias in meta-analysis: guidelines on choice of axis. Journal of clinical epidemiology, 54, 1046-1055

Examples

Run this code
library(metaviz)
# Create a funnel plot using confidence and significance contours
viz_funnel(x = mozart[, c("d", "se")])

# Show a trim-and-fill analysis and Egger's regression line:
viz_funnel(x = mozart[, c("d", "se")], contours = TRUE,
trim_and_fill = TRUE, trim_and_fill_side = "left", egger = TRUE)

# Plot log-odds-ratios on the original OR scale and show additional evidence contours:
viz_funnel(x = exrehab[, c("logor", "logor_se")], sig_contours = FALSE,
addev_contours = TRUE, contours_col = "Greys", xlab = "Odds Ratio",
x_trans_function = exp, x_breaks = log(c(0.125, 0.25, 0.5, 1, 2, 4, 8)))

# Show study subgroups
viz_funnel(x = mozart[, c("d", "se")], group = mozart[, "unpublished"],
group_legend_title = "unpublished?")

Run the code above in your browser using DataLab