Learn R Programming

psychmeta (version 2.7.0)

plot_forest: Create forest plots

Description

Create forest plots

Usage

plot_forest(
  ma_obj,
  analyses = "all",
  match = c("all", "any"),
  case_sensitive = TRUE,
  show_filtered = FALSE,
  ma_facetname = "Summary",
  facet_levels = NULL,
  conf_level = NULL,
  conf_method = NULL,
  x_limits = NULL,
  x_breaks = NULL,
  x_lab = NULL,
  y_lab = "Reference"
)

Value

A list of forest plots.

Arguments

ma_obj

Meta-analysis object.

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).

ma_facetname

Label to use for meta-analysis results in the ggplot2::facet_grid() function.

facet_levels

Order in which moderator levels should be displayed.

conf_level

Confidence level to define the width of the confidence interval. If NULL (default), uses the level set when ma_obj was estimated.

conf_method

Distribution to be used to compute confidence intervals (either "t" for t distribution or "norm" for normal distribution). If NULL (default), uses the method set when ma_obj was estimated.

x_limits

Span of the X values to be plotted.

x_breaks

Breaks for the X values to be plotted.

x_lab

Label to use for the X axis.

y_lab

Label to use for the Y axis.

Author

Based on code by John Sakaluk

Examples

Run this code
if (FALSE) {
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_forest(ma_obj = ma_obj)
plot_forest(ma_obj = ma_obj, analyses = list(pair_id = 2))
plot_forest(ma_obj = ma_obj, analyses = list(pair_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_forest(ma_obj = ma_obj)
plot_forest(ma_obj = ma_obj, analyses = list(pair_id = 2))
plot_forest(ma_obj = ma_obj, analyses = list(pair_id = 1, analysis_id = 1), show_filtered = TRUE)
}

Run the code above in your browser using DataLab