bubble_plot | R Documentation |
Using a metafor model object of class rma
or rma.mv
, or a results table of class orchard
, the bubble_plot
function creates a bubble plot from slope estimates. In cases when a model includes interaction terms, this function creates panels of bubble plots.
bubble_plot(
object,
mod,
group = NULL,
xlab = "Moderator",
ylab = "Effect size",
N = "none",
alpha = 0.5,
cb = TRUE,
k = TRUE,
g = FALSE,
transfm = c("none", "tanh", "invlogit", "percent", "percentr"),
est.lwd = 1,
ci.lwd = 0.5,
pi.lwd = 0.5,
est.col = "black",
ci.col = "black",
pi.col = "black",
legend.pos = c("top.left", "top.right", "bottom.right", "bottom.left", "top.out",
"bottom.out", "none"),
k.pos = c("top.right", "top.left", "bottom.right", "bottom.left", "none"),
condition.nrow = 2,
weights = "prop",
by = NULL,
at = NULL,
cond_levels = NULL
)
object |
Model object of class |
mod |
The name of a continuous moderator, to be plotted on the x-axis of the bubble plot. |
group |
The grouping variable that one wishes to plot beside total effect sizes, k. This could be study, species, or any grouping variable one wishes to present sample sizes for. Not needed if an |
xlab |
Moderator label. |
ylab |
Effect size measure label. |
N |
The vector of sample size which an effect size is based on. Defaults to precision (the inverse of sampling standard error). |
alpha |
The level of transparency for pieces of fruit (effect size). |
cb |
If |
k |
If |
g |
If |
transfm |
If set to |
est.lwd |
Size of the point estimate. |
ci.lwd |
Size of the confidence interval. |
pi.lwd |
Size of the prediction interval. |
est.col |
Colour of the point estimate. |
ci.col |
Colour of the confidence interval. |
pi.col |
Colour of the prediction interval. |
legend.pos |
Where to place the legend, or not to include a legend ("none"). |
k.pos |
The position of effect size number, k. |
condition.nrow |
Number of rows to plot condition variable. |
weights |
How to marginalize categorical variables; used when one wants marginalised means. The default is |
by |
Character vector indicating the name that predictions should be conditioned on for the levels of the moderator. |
at |
List of levels one wishes to predict at for the corresponding variables in |
cond_levels |
Order of the levels of the condition variable in the order to plot. Defaults to NULL. |
Orchard plot
Shinichi Nakagawa - s.nakagawa@unsw.edu.au
Daniel Noble - daniel.noble@anu.edu.au
## Not run:
data(lim)
lim[, "year"] <- as.numeric(lim$year)
lim$vi<- 1/(lim$N - 3)
model<-metafor::rma.mv(yi=yi, V=vi, mods= ~Environment*year,
random=list(~1|Article,~1|Datapoint), data=na.omit(lim))
test <- orchaRd::mod_results(model, mod = "year", group = "Article", data = lim, weights = "prop", by = "Environment")
orchaRd::bubble_plot(test, mod = "year", data = lim, group = "Article",legend.pos = "top.left")
# Or just using model directly
orchaRd::bubble_plot(model, mod = "year", legend.pos = "top.left", data = lim, group = "Article", weights = "prop", by = "Environment")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.