Learn R Programming

metaviz (version 0.4.0)

wineq_baujat: Baujat plot for the change of influence on the overall effect of each study between a fixed-effect and random-effects model

Description

Creates a baujat plot which shows the direction and magnitude of change in influence of each study on the overall effect between a fixed-effect and random-effects model based on the same data.

Usage

wineq_baujat(
  x,
  labs = NULL,
  nr_labs = 10,
  col = TRUE,
  method = NULL,
  SPR = TRUE
)

Value

A baujat plot which contains y-axis values for both a fixed-effect and a random-effects model connected by an arrow is created using ggplot2.

Arguments

x

metafor rma.uni object conducted with method “FE” or “REML” (the chosen method of the input model makes no difference in the resulting plot)

labs

a vector of study labels

nr_labs

specifies the number of studies to be labelled starting from the righthand side of the x-axis.

col

boolean argument that determines whether the study markers are colored or not.

method

determines whether x-axis values are based on the fixed-effect (“FE”) or the random-effects model (“REML”). If no value is entered, the method is extracted from model x.

SPR

boolean argument that determines whether the x-axis shows the squared pearson residual for the random-effects model (when method == “REML”) instead of the contribution to the Cochran Q-test for heterogeneity to account for differences in the study variances.

Author

Verena Pilar <[email protected]>

Details

The function wineq_baujat creates a baujat plot (Baujat et al., 2002) with the added feature that influence on the overall result is shown for both the fixed-effect and the random-effects model connected by an arrow. This allows the user to identify both direction and magnitude of the change in a study’s influence on the overall result between the two models. Subsequently, one can easily identify studies that most strongly drive a shift in the overall result between the models. These are the studies that both gain a lot in influence in the random effects model as well as contribute a lot to heterogeneity

References

Baujat, B., Mahé, C., Pignon, J. - P. & Hill, C. (2002). A graphical method for exploring heterogeneity in meta-analyses: Application to a meta-analysis of 65 trials. Statistics in Medicine, 21(18): 2641–2652.

Examples

Run this code
library(metafor)

# Calculating a random-effects model based on the mozart data
mozart_r <- rma(yi = d,
                sei = se,
                data = mozart,
                method = "REML")

# Plotting the wineq baujat plot based on the mozart data
# using a matrix as input
wineq_baujat(x = mozart[, c("d", "se")])
# using a rma.uni model as input
wineq_baujat(x = mozart_r)

# Adding study name labels to the right-most studies on the x-axis and
# determining how many studies shall be labeled
wineq_baujat(x = mozart_r, labs = mozart$study_name, nr_labs = 5)

Run the code above in your browser using DataLab