Extracts study effects from the baggr
model and plots them,
possibly next to the hypereffect estimate.
baggr_plot(
bg,
hyper = FALSE,
style = c("intervals", "areas", "forest_plot"),
transform = NULL,
prob = 0.5,
prob_outer = 0.95,
vline = TRUE,
order = TRUE,
values_outer = TRUE,
values_size = 4,
values_digits = 1,
...
)
ggplot2 object
object of class baggr
logical; show hypereffect as the last row of the plot?
alternatively you can pass colour for the hypermean row,
e.g. hyper = "red"
"forest_plot"
imitates the visual style of forest plots
and also prints means and intervals next to each row;
"intervals"
(default) or "areas"
use package bayesplot
styles
a function (e.g. exp()
, log()
) to apply to the
values of group (and hyper, if hyper=TRUE
) effects
before plotting; when working with effects that are on
log scale, exponent transform is used automatically, you can
plot on log scale by setting transform = identity
Probability mass for the inner interval in visualisation
Probability mass for the outer interval in visualisation
logical; show vertical line through 0 in the plot?
logical; sort groups by magnitude of treatment effect?
logical; use the interval corresponding to prob_outer
when style = "forest_plot"
?
if not, the "inner" interval (prob
) is used
size of the text values in the plot when style = "forest_plot"
number of significant digits to use when style = "forest_plot"
extra arguments to pass to the bayesplot
functions
Witold Wiecek; the visual style is based on bayesplot package
bayesplot::MCMC-intervals for more information about bayesplot functionality;
forest_plot for a typical meta-analysis alternative (which you can imitate using style = "forest_plot"
);
effect_plot for plotting treatment effects for a new group
fit <- baggr(schools, pooling = "none")
plot(fit, hyper = "red")
plot(fit, style = "areas", order = FALSE)
plot(fit, style = "forest_plot", order = FALSE)
Run the code above in your browser using DataLab