forest_plot | R Documentation |
Creates a forest plot for gMAP
analysis objects.
forest_plot(
x,
prob = 0.95,
est = c("both", "MAP", "Mean", "none"),
model = c("stratified", "both", "meta"),
point_est = c("median", "mean"),
size = 1.25,
alpha = 0.5
)
x |
|
prob |
confidence interval width and probability mass of credible intervals. |
est |
can be set to one of |
model |
controls which estimates are displayed per study. Either |
point_est |
shown point estimate. Either |
size |
controls point and linesize. |
alpha |
transparency of reference line. Setting |
The function creates a forest plot suitable for
gMAP
analyses. Note that the Meta-Analytic-Predictive
prior is included by default in the plot as opposed to only showing
the estimated model mean. See the examples below to obtain standard
forest plots.
Also note that the plot internally flips the x and y-axis. Therefore, if you want to manipulate the x-axis, you have to give commands affecting the y-axis (see examples).
The function returns a ggplot2 plot object.
The returned plot is a ggplot2 object. Please refer to the
"Customizing Plots" vignette which is part of RBesT
documentation for an introduction. For simple modifications (change
labels, add reference lines, ...) consider the commands found in
bayesplot-helpers
. For more advanced
customizations please use the ggplot2 package directly. A
description of the most common tasks can be found in the
R Cookbook and a full
reference of available commands can be found at the
ggplot2 documentation
site.
gMAP
# we consider the example AS MAP analysis
example(AS)
# default forest plot for a gMAP analysis
forest_plot(map_AS)
# standard forest plot (only stratified estimate and Mean)
forest_plot(map_AS, est=c("Mean"), model="stratified")
# to further customize these plots, first load bayesplot and ggplot2
library(bayesplot)
library(ggplot2)
# to make plots with red colors, big fonts for presentations, suppress
# the x axis label and add another title (with a subtitle)
color_scheme_set("red")
theme_set(theme_default(base_size=16))
forest_plot(map_AS, size=2) +
yaxis_title(FALSE) +
ggtitle("Ankylosing Spondylitis Forest Plot",
subtitle="Control Group Response Rate")
# the defaults are set with
color_scheme_set("blue")
theme_set(theme_default(base_size=12))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.