extract_effects_all_ids: Fit model on each study, for a given condition, and extract...

Description Usage Arguments Value Examples

Description

extract_effects_all_ids retrieves the effect size and SE for each study by calling the function extract_effects on each study.

Usage

1

Arguments

data

A dataframe containing per each study the time series of relevant variables (i.e. yearly climate values, yearly trait values or yearly selection differentials) to be analyzed.

condition

A character specifying which condition is to be tested (for more details see Radchuk et al. (in review)):

  • '1' - Condition 1 (effect of year on climate);

  • '2' - Condition 2 (effect of climate on traits);

  • '3' - Condition 3 (testing whether weighted mean selection over years differs from 0);

  • '2b' - Condition 2, but also with abundance included as a predictor;

  • '3b' - testing whether selection changes over years.

nb_cores

An integer indicating how many cores should be used for assessing the LRT by bootstrap (see spaMM documentation for more details).

Value

A dataframe containing all effect sizes and SE for the meta-analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
nb_cores <- 2L ## increase the number for using more cores
dat_clim <- prepare_data(data = dat_Clim, temperature = TRUE,
                         precipitation = FALSE,
                         phenology = TRUE, morphology = TRUE)
test <- extract_effects_all_ids(data = dat_clim,
                                condition = "1", nb_cores = nb_cores)
head(test)

dat_sel_phen <- prepare_data(data = dat_Sel, temperature = TRUE,
                             precipitation = FALSE,
                             phenology = TRUE, morphology = FALSE)
test_sel <- extract_effects_all_ids(data = dat_sel_phen,
                                    condition = "3", nb_cores = nb_cores)


dat_T_Trait <- prepare_data(data = dat_Trait, temperature = TRUE,
                            precipitation = FALSE,
                            phenology = TRUE, morphology = FALSE)
test_Trait <- extract_effects_all_ids(data = dat_T_Trait,
                                      condition = "2", nb_cores = nb_cores)

## End(Not run)

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