Jump to main content or area navigation.

Contact Us

CADDIS Volume 4: Data Analysis

Predicting Environmental Conditions from Biological Observations (PECBO) Appendix

Estimate Taxon-Environment Relationships Using taxon.env()

The simple script provided in parametric regressions estimates relationships between taxon occurrences and a single environmental variable. This script can be modified to model multiple variables, but an easier approach is to use the script taxon.env included in the the library bio.infer. An added advantage of using taxon.env is that model results are automatically formatted for using maximum likelihood inferences (mlsolve) to compute biological inferences.

If you have not yet tried to use existing taxon-environment relationships to compute inferences at your sites, please do so.

The reasons for working through methods for using existing taxon-environment relationships are twofold. First, many of the scripts introduced in this process are also used to estimate taxon-environment relationships from your local data. Second, inferences computed from existing taxon-environment relationships can often provide a useful point of comparison when developing your own models.

This remainder of this page provides a step-by-step guide for estimating taxon-environment relationships using Oregon data as an example.
  1. Load inference library.

    • Set up a workspace and install the R library bio.infer (detailed directions).

    • Load the biological inference library by typing at the R prompt:

      library(bio.infer)

  2. Load local benthic macroinvertebrate count and environmental data.

    • Load sample data into R with the following commands.

      data(bcnt.OR)
      data(envdata.OR)


  3. Standardize taxonomy of benthic count data (detailed directions).

    • Type at the R prompt:

      data(itis.ttable) # Load ITIS taxonomic information
      bcnt.tax <- get.taxonomic(bcnt.OR, itis.ttable)


  4. Estimate taxon-environment relationships.

    • Type at the R prompt:

      coef.local <- taxon.env(~sed + sed^2, bcnt.tax, envdata.OR,
       bcnt.siteid = "SVN", bcnt.abndid ="CountValue",
       env.siteid = "STRM.ID")


    • The calling statement above specifies that we wish to model the occurrence of different taxa as a function of the variable sed (the percent sand and fines in the substrate) and the square of sed. Then, the names of the benthic count data (bcnt.tax) and the environmental data (envdata.or) are provided. Finally, the names of different fields that contain sample identifiers and the abundance data in the benthic count file are supplied.

  5. The results from this process (coef.local) can now be used to compute inferences, using the same procedure as with existing taxon-environment relationships.

Top of page


R Scripts:   Overview    Previous    Next

Jump to main content.