fit_cond_id: Fit a single mixed-effects model to test a given condition...

Description Usage Arguments Value See Also Examples

Description

fit_cond_id fits a mixed-effects model for a single study id in the dataset. This model takes into account temporal autocorrelation and includes the desired fixed-effects predictors.

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.

id

A character specifying the unique study id.

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.

Value

The list of length 5. The first element is the best full fitted model returned with the function fit_model. The second element contains results of LRT. The third element is a condition tested, the forth element is a study id, and the fifth element is a dataset to what the study belongs (PRCS or PRC).

See Also

fit_model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dat_trials <- prepare_data(data = dat_Clim,
                           temperature = TRUE, precipitation = FALSE,
                           phenology = TRUE, morphology = TRUE)
test <- fit_cond_id(data = dat_trials, id = '1', condition = '1')

dat_temp_phen <- prepare_data(data = dat_Trait,
                           temperature = TRUE, precipitation = FALSE,
                           phenology = TRUE, morphology = FALSE)
test_trait <- fit_cond_id(data = dat_temp_phen, id = '1', condition = '2')
test_trait$model

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