plot_meta {esci} | R Documentation |
Generates a forest plot displaying results of a meta-analysis
Description
‘plot_meta’ returns a ggplot2 object visualizing the results of
a meta-analysis, showing each study effect size and CI, the overall effect
size and CI as a diamond, effect sizes estimated at each moderator level
(if defined), and (optionally) prediction intervals for subsequent studies.
This function requires as input an esci_estimate object generated by an
esci meta-analysis function: meta_any()
, meta_d1()
,
meta_d2()
, meta_mdiff_two()
, meta_mean()
,
meta_pdiff_two()
, meta_proportion()
, and meta_r()
.
Usage
plot_meta(
estimate,
mark_zero = TRUE,
include_PIs = FALSE,
report_CIs = FALSE,
explain_DR = FALSE,
meta_diamond_height = 0.35,
ggtheme = ggplot2::theme_classic()
)
Arguments
estimate |
|
mark_zero |
|
include_PIs |
|
report_CIs |
|
explain_DR |
|
meta_diamond_height |
|
ggtheme |
|
Details
This function was developed primarily for student use within jamovi when learning along with the text book Introduction to the New Statistics, 2nd edition (Cumming & Calin-Jageman, 2024).
Expect breaking changes as this function is improved for general use. Work still do be done includes:
Revise to avoid deprecated ggplot features
Revise for consistent ability to control aesthetics and consistent layer names
Value
Returns a ggplot object
Examples
# Data set -- see Introduction to the New Statistics, 2nd edition
data("data_mccabemichael_brain")
# Meta-analysis: random effects, no moderator
estimate <- esci::meta_mdiff_two(
data = esci::data_mccabemichael_brain,
comparison_means = "M Brain",
comparison_sds = "s Brain",
comparison_ns = "n Brain",
reference_means = "M No Brain",
reference_sds = "s No Brain",
reference_ns = "n No Brain",
labels = "Study name",
effect_label = "Brain Photo Rating - No Brain Photo Rating",
assume_equal_variance = TRUE,
random_effects = TRUE
)
# Forest plot
myplot_forest <- esci::plot_meta(estimate)
# Meta-analysis: random effects, moderator
estimate_moderator <- esci::meta_mdiff_two(
data = esci::data_mccabemichael_brain,
comparison_means = "M Brain",
comparison_sds = "s Brain",
comparison_ns = "n Brain",
reference_means = "M No Brain",
reference_sds = "s No Brain",
reference_ns = "n No Brain",
labels = "Study name",
moderator = "Research group",
effect_label = "Brain Photo Rating - No Brain Photo Rating",
assume_equal_variance = TRUE,
random_effects = TRUE
)
# Forest plot
myplot_forest_moderator <- esci::plot_meta(estimate_moderator)
# Meta-analysis: random effects, moderator, output d_s
estimate_moderator_d <- esci::meta_mdiff_two(
data = esci::data_mccabemichael_brain,
comparison_means = "M Brain",
comparison_sds = "s Brain",
comparison_ns = "n Brain",
reference_means = "M No Brain",
reference_sds = "s No Brain",
reference_ns = "n No Brain",
labels = "Study name",
moderator = "Research group",
effect_label = "Brain Photo Rating - No Brain Photo Rating",
assume_equal_variance = TRUE,
random_effects = TRUE
)
# Forest plot
myplot_forest_moderator_d <- esci::plot_meta(estimate_moderator_d)