Description Usage Arguments Details Examples
This function draws a forest plot from a random-effects meta-analysis model fitted with brms.
1 2 3 |
data |
Data frame with study labels, effect sizes and standard errors.
A |
model |
A meta-analytic model estimated with brms. |
study |
Variable in data identifying each study. |
label |
Variable in data labelling each study. |
yi |
Outcomes in data. |
sei |
Standard errors in data. |
level |
The "Confidence" level for the Credible Intervals. Defaults to 0.95. |
xlim |
Limits for the x-axis. The defaults are the smallest observed ES - 4 Standard errors to the largest observed ES + 4 SEs. |
show_data |
Logical; whether to show the observed effect size and standard error below the meta-analytic estimates. Defaults to FALSE. |
sort_estimates |
Logical; whether to sort the estimates in ascending order of magnitude from bottom to top. Defaults to FALSE. |
dens_fill |
String; color to fill the densities. Defaults to "grey60". |
dens_col |
String; color for the outlines of the densities. Default: NA. |
The data frame must contain the following columns:
Unique sequential integers for each row in the data.
Text labels for each study (e.g. '"author (year)"“).
Observed effect sizes.
Standard errors.
The meta-analytic model must be fitted with the following brms formula:
yi | se(sei) ~ 1 + (1|study)
This function reproduces code for the geom_flat_violin.R
(without which this function wouldn't work) by
David Robinson (https://github.com/dgrtwo):
https://gist.github.com/dgrtwo/eb7750e74997891d7c20, and
Ben Marwick (https://github.com/benmarwick):
https://gist.github.com/benmarwick/2a1bb0133ff568cbe28d.
1 2 3 4 5 6 | ## Not run:
## Use a data frame called d
fit <- brm(yi | se(sei) ~ 1 + (1|study), data = d)
brms_forest(data = d, model = fit)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.