scripts:species-response-curves

*Calculates and draws species response curves along environmental gradients.*

**Download JUICE-R script:**
species_response_curves.r
(last update: 1.4.2011)

The library `gravy`

needs to be installed from source on GitHub; open the version of R you are using in JUICE, and copy the following (you may need to additionally also install Rtools.exe on your computer):

install.packages("devtools") library(devtools) install_github("jarioksa/gravy")

Determination of species response on studied gradient represents one of the basic tasks in ecology. Response curve allows estimation of species optimum and also niche width (tolerance), identifying species as generalist or specialist. Most of widely used statistical methods assume that species response on gradient have symmetrical bell shape of Gaussian curve, even if number of studies showed that this type of response occurs in real data quite rarely. Several methods dealing with problem of modeling of asymmetric species response curves were discussed in study of Oksanen & Minchin (2002a), which was together with detailed technical description in Oksanen & Minchin (2002b) taken as the base for routine built in the JUICE software and calculated in externally running R package software.

- Bell-shaped (GAUSSian) curve with traditionally symmetrical shape,
- Generalized linear models (GLM) with polynom of 1st to 3rd degree,
- Generalized additive models (GAM) models with optional degrees of freedom 3 to 5,
- Huisman-Olff-Fresco models (HOF) - hierarchical set of five models with increasing complexity.

Bell-shaped curve is included mainly for reference, to show what the response shape would look like if using Gaussian model. Other three options allow quite flexible expression of different response curve shapes, each having different constrains, advantages and disadvantages. GLM models offer curves, which are completely described by equation with given number of parameters; however, the shape of its response curve is quite often somehow inappropriate or unrealistic. The GAM models are more flexible in terms of curves' shape, but their equation is non-parametric and not easily expressible. Perhaps the best option from ecological point of view is using HOF models, which are designed with stress to demands one would expect from species response curves - for example, they express only unimodal response shape, which is usually the most appropriate way when searching for species optimum on gradient (GLM and GAM with low number of degrees of polynom or freedom, respectively, can't really produce bimodal response shape, but can easily produce 'semi-bimodal' shape with inexplicit interpretation - see Fig. 3).

Available information about species is reduced only to presence-absence, even if all methods can handle also percentage or somehow transformed data. It has two reasons - first, resulting curves from presence-absence data are more 'pretty', with shapes giving more straightforward interpretation. Second, removal of information about dominance from species data makes the interpretation of resulting response curve more clear. Information about species abundance (or cover, respectively) is affected by complex factors, including competitive relations, species morphology and other biotic aspects, which all together doesn't need to be easily interpretable; on the other hand, these factors are at least partly removed, when the presence-absence transformation is used (Austin, 2002).

As any model, also response curves are just simplification of reality and their shape is strongly dependent on available dataset. One of the main assumption, which doesn't need to meet reality, is the unimodal type of species response - means that species has only one optimum along tested gradient. Even if bimodal response of species could have interesting and meaningful interpretation, it's somehow tricky in terms of determination of optimum and species tolerance, and needs to be evaluated individually for particular species. Therefore, only unimodal or monotone response of species is considered here.

- Bell-shaped response curve is not based on the classical Gaussian equation, but on simplified equivalent polynomial model (ter Braak & Looman, 1986, Oksanen & Minchin, 2002a), which can be easily fit using generalized linear models (with logistic link function for presence-absence binomial data) and gives results close to real Gaussian curve.
- Generalize linear models (GLM) are included in standard R package. Available models are linear, exponential and cubistic (polynom degree 1, 2 and 3, resp.), as higher polynomial degree of models would result in more then unimodal response shape. Logit link function is used; selection of model can be done manually or automatically based on AIC test criterion, selecting the model with the lowest deviance of data.
- General additive models (GAM) are included in library 'mgcv' also available in R package. Models with fixed degree of freedom 3, 4 and 5 are available, automatic selection is also based on AIC test criterion.
- Huisman-Olff-Fresco models (HOF) includes hierarchical set of five models: model I - flat with no response, II - monotone growing, III - monotone growing with 'plateau', IV - symmetric unimodal and V - asymmetric unimodal response. Four parameters are to be estimated - this is done using non-linear maximum likelihood estimation procedure, described in Oksanen & Minchin (2002b) and further developed by Jari Oksanen in 'gravy' package. However, 'gravy' package in some cases gives ecologically unrealistic response, and therefore we used some corrections, described in more details here ('Selfish' HOF response curves).

Optimum is simply the value of gradient, where the species has the highest probability of occurrence based on particular model. If the response curve shows monotone growing, the optimum of species is identical with lowest or highest value of gradient. In case of HOF models, where flat segments of curve can occur (model I and III), optimum is localized in the middle of this flat segments (in case of model I, optimum is simply the middle-point of available gradient values). Tolerance is determined similar to the method used in Schröder et al. (2005) - it is represented by that part of gradient, where predicted probability of species occurrence is higher than half of maximum value for predicted probability.

- You need to import your data into JUICE, so as the short header contains the gradient data (import either from header data file or from external file via File > Import > Header data - for requested format, see JUICE manual). If you don't want to include some relevés into analysis, change their color. R program will be launched automatically by JUICE, so it doesn't need to be opened.
- In JUICE program, press
**CTRL+W**, or in JUICE menu go to File > Export > To R Program Format Txt File. The JUICE-R wizard for exporting data will open. Using the button 'Append R script' choose the species_response_curves.r file, downloaded in some folder in your computer. Choose the color of releves you want to use for analysis and press “Run”. In a while, the R window should open.

*Name of the gradient to be used in the figure*- fill the name of the gradient (e.g. pH) to be displayed on the x axis of the resulting figure.*Transformation of environmental variable*- two options how to transform the environmental variables, which is used to calculate species response curves, ara available, log and square root transformation.*Analyse only one species*- use this option if your aim is to analyze only one species, while you can choose all four models for species response curves.*Analyse group of species*- you can choose up to 10 species, which will be analysed and drawn together into one figure. You can choose only on of the model for species response curves.*Analyse all species*- choose this function if you want to analyse all species in the table. No figure will be drawn, the result will be saved into two files: result_table.csv, which can be opened in Excel and contains calculated parameters for all species, and import_species_data_to_JUICE.txt, which can be used to import species data into JUICE.

scripts/species-response-curves.txt · Last modified: 2019/03/12 15:10 by david

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International