Skip to main content
U.S. flag

An official website of the United States government

Here’s how you know

Dot gov

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

HTTPS

Secure .gov websites use HTTPS
A lock (LockA locked padlock) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

    • Environmental Topics
    • Air
    • Bed Bugs
    • Cancer
    • Chemicals, Toxics, and Pesticide
    • Emergency Response
    • Environmental Information by Location
    • Health
    • Land, Waste, and Cleanup
    • Lead
    • Mold
    • Radon
    • Research
    • Science Topics
    • Water Topics
    • A-Z Topic Index
    • Laws & Regulations
    • By Business Sector
    • By Topic
    • Compliance
    • Enforcement
    • Laws and Executive Orders
    • Regulations
    • Report a Violation
    • Environmental Violations
    • Fraud, Waste or Abuse
    • About EPA
    • Our Mission and What We Do
    • Headquarters Offices
    • Regional Offices
    • Labs and Research Centers
    • Planning, Budget, and Results
    • Organization Chart
    • EPA History

Breadcrumb

  1. Home
  2. Causal Analysis/Diagnosis Decision Information System (CADDIS)

Download R Scripts and Sample Data

  • Introduction
  • Using Taxon-Environment Relationships
  • Estimating Taxon-Environment Relationships
  • Computing Inferences
  • R Scripts

How to Download R Scripts and Sample Data

Helpful Links
Topics In R Scripts
  • Overview
  • Download R Scripts and Sample Data
  • Loading Data
  • Central Tendencies
  • Environmental Limits
  • Parametric Regressions
  • Non-Parametric Regressions
  • Significance Tests
  • Area Under the ROC Curve
  • Curve Shape
  • Weighted Average Inference
  • Estimate Taxon-Environment Relationships Using taxon.env()

PECBO Appendix Site Map

This section is provided for users who are very comfortable with R and who wish to download scripts directly. For novice R users, please note that the web pages in the Helpful Links box have additional information that will help you successfully run the script.

R scripts from this section can be saved directly on your hard drive as an ".R" file. Each script can be then run by executing the following command in R:

source(filename)

For example,

source("weighted.average.R")

The scripts listed below assume that data have been downloaded and stored in the working directory. Before running any of the other analysis programs, the first script listed (Set Up Variables) should be run to set up R data files.

  • Set Up Variables
  • Calculate Weighted Average Tolerance Values
  • Compute Cumulative Percentiles
  • Parametric Regression
  • Non-Parametric Regression
  • Chi-Square Tests for Parametric and Non-parametric Models
  • Compute Area Under ROC Curve
  • Classify Response Shape
  • Compare Taxa Names in Tolerance Value and Assessment Data
  • Calculate Weighted Average Inferences

To estimate multivariate taxon-environment relationships, or to format any taxon-environment relationship correctly for maximum likelihood inferences, you will need to use the scripts provided in the R library bio.infer. The library also contains the script that computes maximum likelihood inference and other tools.

The library can be installed by typing at the R prompt:

install.packages("bio.infer")


Sample Data

Two sample data sets are provided here to illustrate the analysis methods described in this module. The first data set was collected by U.S. Environmental Protection Agency's Environmental Management and Assessment Program-Western Pilot Project (EMAP-West) from 2000 to 2002, and the second data set was collected in western Oregon by the Oregon Department of Environmental Quality (DEQ) from 1999 to 2000 (Figures 22 and 23). Both organizations used a similar sampling protocol. A reach 40 times the wetted width of the stream was delineated for sampling. Stream temperature was measured at the time of sampling. Substrate composition was estimated by summarizing the size distribution of particles at five locations on 21 transects. For the EMAP-West, macroinvertebrate samples were collected at eight randomized locations in riffles using a modified D-frame kicknet (500 µm mesh) by disturbing a 1 ft² area for 30 seconds. In Oregon, samples were collected by disturbing 2 ft² areas at four randomized locations. Samples from both studies were composited and spread on a gridded pan and picked from randomly selected grid squares until at least 500 organisms were collected. Each organism was then identified to the lowest possible taxonomic level (usually genus or species).

  • Site-species data: EMAP-West (txt) (345.72 KB)
  • Environmental data: EMAP-West (txt) (18.96 KB)
  • Site-species data: Western Oregon (txt) (194.49 KB)
  • Environmental data: Western Oregon (txt) (5.3 KB)
Sample locations for EMAP-West.
Figure 22. Sample locations for EMAP-West.
Sample locations for western Oregon.
Figure 23. Sample locations for western Oregon.

Causal Analysis/Diagnosis Decision Information System (CADDIS)

  • CADDIS Home
    • About CADDIS
    • Frequent Questions
    • Publications
    • Recent Additions
    • Related Links
    • CADDIS Glossary
  • Volume 1: Stressor Identification
    • About Causal Assessment
    • Getting Started
    • Step 1. Define the Case
    • Step 2. List Candidate Causes
    • Step 3. Evaluate Data from the Case
    • Step 4. Evaluate Data from Elsewhere
    • Step 5. Identify Probable Causes
  • Volume 2: Sources, Stressors and Responses
    • About Sources
      • Urbanization
    • About Stressors
  • Volume 3: Examples and Applications
    • Analytical Examples
    • Worksheet Examples
    • State Examples
    • Case Studies
    • Galleries
  • Volume 4: Data Analysis
    • Selecting an Analysis Approach
    • Getting Started
    • Basic Principles & Issues
    • Exploratory Data Analysis
    • Basic Analyses
    • Advanced Analyses
    • PECBO Appendix
    • Download Software
    • Data Analysis Topics (A -Z)
  • Volume 5: Causal Databases
    • Learn about CADLink
Contact Us about CADDIS
Contact Us to ask a question, provide feedback, or report a problem.
Last updated on February 13, 2025
  • Assistance
  • Spanish
  • Arabic
  • Chinese (simplified)
  • Chinese (traditional)
  • French
  • Haitian Creole
  • Korean
  • Portuguese
  • Russian
  • Tagalog
  • Vietnamese
United States Environmental Protection Agency

Discover.

  • Accessibility Statement
  • Budget & Performance
  • Contracting
  • EPA www Web Snapshot
  • Grants
  • No FEAR Act Data
  • Plain Writing
  • Privacy
  • Privacy and Security Notice

Connect.

  • Data
  • Inspector General
  • Jobs
  • Newsroom
  • Regulations.gov
  • Subscribe
  • USA.gov
  • White House

Ask.

  • Contact EPA
  • EPA Disclaimers
  • Hotlines
  • FOIA Requests
  • Frequent Questions
  • Site Feedback

Follow.