richness_vs_DI {DImodels} | R Documentation |
This function provides an automated way to fit the richness model and a (limited) range of Diversity-Interactions (DI) models.
richness_vs_DI(y, prop, data, extra_formula)
y |
The column name of the response vector, which must be in quotes, for example, |
prop |
A vector of s column names identifying the species proportions in each row in the dataset. For example, if the species proportions columns are labelled p1 to p4, then |
data |
Specify the dataset, for example, |
extra_formula |
Additional terms can be added using |
Connolly et al. (2013; Appendix 1) shows that there is an equivalence between DI models and different types of richness models (linear and nonlinear predictors using richness in different scales).
This function fits four models and compares them using AIC. The four models are:
1. The richness model
y = Intercept + Slope * Richness + \epsilon;
2. The average pairwise interactions (AV) DI model with common identity effects and theta equal to 0.5 (which is equivalent to model 1 when communities are all equi-proportional);
3. The average pairwise interactions (AV) DI model with common identity effects and estimating theta;
4. The average pairwise interactions (AV) DI model allowing for unique identity effects, but maintaining theta equal to 0.5;
5. The average pairwise interactions (AV) DI model allowing for unique identity effects, and estimating theta.
The function prints a table with AIC, AICc, BIC, and associated degrees of freedom for each of the four models above, and returns the model with the smallest AIC.
The function returns the final selected model, an object of class DI
or lm
.
Rafael A. Moral, John Connolly, Rishabh Vishwakarma and Caroline Brophy
Connolly J, T Bell, T Bolger, C Brophy, T Carnus, JA Finn, L Kirwan, F Isbell, J Levine, A Lüscher, V Picasso, C Roscher, MT Sebastia, M Suter and A Weigelt (2013) An improved model to predict the effects of changing biodiversity levels on ecosystem function. Journal of Ecology, 101, 344-355.
## Load the Switzerland data
data(Switzerland)
## compare the richness model with DI alternatives
richness_vs_DI(y = "yield", prop = 4:7, data = Switzerland)
## include the density effects in the linear predictors of the four models
richness_vs_DI(y = "yield", prop = 4:7, data = Switzerland, extra_formula = ~ density)