forest_plot.Rd
Generates a forest plot from a meta-analysis result object, optionally grouped by a specified subgrouping variable.
forest_plot(
mars_object,
subgroups = NULL,
z_dist = TRUE,
xlab = "Effect Size",
main = "Forest Plot",
study_header = "Study",
subgroup_header = "Group",
es_header = "ES (SE)",
note = NULL,
ci_level = 0.95,
marker_scale = 2,
font_cex = 0.8
)
A fitted mars object.
Optional. Name of the column in mars_object$data
to use as subgroup variable.
Logical. Whether to use the normal distribution for confidence intervals. If FALSE
, uses the t-distribution.
Label for the x-axis. Defaults to "Effect Size".
Title of the forest plot. Defaults to "Forest Plot".
Label for the column showing study names. Defaults to "Study".
Label for the subgroup column (if used). Defaults to "Group".
Label for the effect size column. Defaults to "ES (SE)".
Optional. Text or named list providing a summary note (e.g., effect, SE, tau², I²).
Confidence level for the interval bounds. Defaults to 0.95.
Numeric multiplier for marker size. Defaults to 2.
Numeric scaling for text labels. Defaults to 0.8.
A base R forest plot is rendered to the current graphics device.
The function sorts studies by effect size and draws each study as a point with a confidence interval.
If subgroups
is provided, distinct plot symbols are used for each group and a legend is added.
Optionally, a summary note can be added below the plot using the note
argument.
if (FALSE) { # \dontrun{
forest_plot(mars_object,
subgroups = "region",
note = list(effect = 0.42, se = 0.05, tau2 = 0.02, I2 = 0.23))
} # }