plot_forest: Produce a forest plot with effect sizes for each study id in...

Description Usage Arguments Details Value Examples

Description

plot_forest Plots a forest plot displaying the effect sizes for each study and global effects across the studies

Usage

1
2
3
4
plot_forest(meta_obj1, meta_obj2 = NULL, list_extra_meta_obj = NULL,
  sort = c("Species", "Study_Authors", "Fitness_Categ"),
  increasing = TRUE, labels = c(traits = TRUE, fitness = TRUE, country
  = TRUE, authors = TRUE), mar = c(4, 10, 2, 2))

Arguments

meta_obj1

A fitted meta-analytical model object whose global slopes and per-study effect sizes will be displayed on the plot.

meta_obj2

An (optional) second fitted meta-analytical model object whose global slopes and per-study effect sizes will be displayed on the plot.

list_extra_meta_obj

A list of meta-analytical model objects to be used for displaying the global effects (either across all studies or in response to a fixed predictor).

sort

A vector specifying the variables to use for sorting the labels.

increasing

A Boolean specifying whether the slopes should be sorted in increasing (TRUE) or decreasing (FALSE) order.

labels

A vector specifying what should be used as labels for each study. See Details for kinds of labels available.

mar

A vector specifying the plot margins, analogously to par.

Details

This function first fits separate mixed-effects models per study id. All the models include predictors of interest. The possible types of labels are:

If the label is set to TRUE (default), it will be displayed on the plot.

Value

Plots a forest plot with effect sizes (and SEs) for each study, and global effect size(s) on the bottom. The data used for the plot are returned (invisibly).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
nb_cores <- 2L
meta_Trait_phen <- fit_all(data = dat_Trait, temperature = TRUE,
                           precipitation = FALSE, phenology = TRUE,
                           morphology = FALSE, condition = '2',
                           nb_cores = nb_cores, rand_trait = FALSE,
                           fixed = NULL, digit = 3)

meta_Trait_morph <- fit_all(data = dat_Trait, temperature = TRUE,
                            precipitation = FALSE, phenology = FALSE,
                            morphology = TRUE, condition = '2',
                            nb_cores = nb_cores, rand_trait = FALSE,
                            fixed = NULL, digit = 3)

meta_Trait_phen_Tax <- fit_all(data = dat_Trait, temperature = TRUE,
                               precipitation = FALSE, phenology = TRUE,
                               morphology = FALSE, condition = '2',
                               nb_cores = nb_cores, rand_trait = FALSE,
                               fixed = 'Taxon', digit = 3)

test <- plot_forest(meta_obj1 = meta_Trait_phen$meta_res,
                    meta_obj2 = meta_Trait_morph$meta_res,
                    list_extra_meta_obj = list(meta_Trait_phen_Tax$meta_res),
                    sort = c("Species", "Study_Authors", "Fitness_Categ"),
                    increasing = TRUE,
                    labels = c(traits = TRUE,
                               fitness = TRUE,
                               country = TRUE,
                               authors = TRUE))

radchukv/adRes documentation built on June 1, 2019, 7:05 p.m.