Learn R Programming

psychmeta (version 2.7.0)

plot_funnel: Create funnel plots

Description

This function creates funnel plots for meta-analyses (plots of effect size versus standard error).

Usage

plot_funnel(
  ma_obj,
  se_type = c("auto", "mean", "sample"),
  label_es = NULL,
  conf_level = c(0.95, 0.99),
  conf_linetype = c("dashed", "dotted"),
  conf_fill = NA,
  conf_alpha = 1,
  null_effect = NA,
  null_conf_level = c(0.9, 0.95, 0.99),
  null_conf_linetype = c("solid", "dashed", "dotted"),
  null_conf_fill = "black",
  null_conf_alpha = c(0.1, 0.2, 0.4),
  analyses = "all",
  match = c("all", "any"),
  case_sensitive = TRUE,
  show_filtered = FALSE
)

plot_cefp( ma_obj, se_type = "sample", label_es = NULL, conf_level = NA, conf_linetype = NA, conf_fill = NA, conf_alpha = 1, null_effect = NULL, null_conf_level = c(0.9, 0.95, 0.99), null_conf_linetype = c("solid", "dashed", "dotted"), null_conf_fill = "black", null_conf_alpha = c(0, 0.2, 0.4), analyses = "all", match = c("all", "any"), case_sensitive = TRUE, show_filtered = FALSE )

Value

A list of funnel plots.

Arguments

ma_obj

Meta-analysis object.

se_type

Method to calculate standard errors (y-axis). Options are "auto" (default) to use the same method as used to estimate the meta-analysis models, "mean" to calculate SEs using the mean effect size and indivdiual sample sizes, or `"sample"`` to use the SE calculated using the sample effect sizes and sample sizes.

label_es

Label for effect size (x-axis). Defaults to "Correlation (r)" for correlation meta-analyses, "Cohen's d (Hedges's g)" for d value meta-analyses, and "Effect size" for generic meta-analyses.

conf_level

Confidence regions levels to be plotted (default: .95, .99).

conf_linetype

Line types for confidence region boundaries. Length should be either 1 or equal to the length of conf_level.

conf_fill

Colors for confidence regions. Set to NA for transparent. Length should be either 1 or equal to the length of conf_level.

conf_alpha

Transparency level for confidence regions. Length should be either 1 or equal to the length of conf_level.

null_effect

Null effect to be plotted for contour-enhanced funnel plots. If NA, not shown. If NULL, set to the null value for the effect size metric (0 for correlations and d values).

null_conf_level

Null-effect confidence regions levels to be plotted (default: .90, .95, .99).

null_conf_linetype

Line types for null-effect confidence region boundaries. Length should be either 1 or equal to the length of null_conf_level.

null_conf_fill

Colors for null-effect confidence regions. Set to NA for transparent. Length should be either 1 or equal to the length of null_conf_level.

null_conf_alpha

Transparency level for null-effect confidence regions. Length should be either 1 or equal to the length of null_conf_level.

analyses

Which analyses to extract? Can be either "all" to extract references for all meta-analyses in the object (default) or a list containing arguments for filter_ma.

match

Should extracted meta-analyses match all (default) or any of the criteria given in analyses?

case_sensitive

Logical scalar that determines whether character values supplied in analyses should be treated as case sensitive (TRUE, default) or not (FALSE).

show_filtered

Logical scalar that determines whether the meta-analysis object given in the output should be the modified input object (FALSE, default) or the filtered object (TRUE).

Author

Based on code by John Sakaluk

Details

Both traditional funnel plots and contour-enhanced funnel plots are provided. Contour-enhanced funnel plots show comparison regions for varying null-hypothesis significance test levels and can be useful for detecting publication bias.

Examples

Run this code
if (FALSE) {
## Correlations
ma_obj <- ma_r(ma_method = "ic", rxyi = rxyi, n = n, rxx = rxxi, ryy = ryyi,
               construct_x = x_name, construct_y = y_name, sample_id = sample_id,
               moderators = moderator, data = data_r_meas_multi)
plot_funnel(ma_obj = ma_obj)
plot_funnel(ma_obj = ma_obj, analyses = list(pair_id = 2))
plot_funnel(ma_obj = ma_obj, analyses = list(pair_id = 1, analysis_id = 1), show_filtered = TRUE)

## d values
ma_obj <- ma_d(ma_method = "ic", d = d, n1 = n1, n2 = n2, ryy = ryyi,
               construct_y = construct, sample_id = sample_id,
               data = data_d_meas_multi)
plot_funnel(ma_obj = ma_obj)
plot_funnel(ma_obj = ma_obj, analyses = list(pair_id = 2))
plot_funnel(ma_obj = ma_obj, analyses = list(pair_id = 1, analysis_id = 1), show_filtered = TRUE)
}

Run the code above in your browser using DataLab