This directory contains the data and code to perform all analyses and draw figures for the following paper. Drake, J.M. & B.D. Griffen. 2010. Early warning signals of extinction in deteriorating environments. Nature 467:456-459. doi:10.1038/nature09389 The data package was created July 8, 2010. This package was tested, dependencies were updated, and README file was created January 26, 2015. Please direct any inquiries to Dr. John M. Drake, Professor of Ecology, University of Georgia (jdrake@uga.edu). This directory contains the following raw data, analysis scripts, and data products. RAW DATA extinctions.csv - Contains the list of microcosm extinction dates ID: Unique identifier for each experimental population Start: Date population was initiated End: Extinction date OR censoring date Censor: Binary indicator for whether or not population was censored (1=extinct, 0=censored) HoleSize: Experimental treatment - diameter of connecting passages (mm) HoleNum: Experimental treatment - number of connecting passages (mm) Deteriorating: Experimental treatment - indicator for whether or not population was in the deteriorating food treatment group FoodAtExtinct: Volume of food suspension on the date given by the variable End Notes: Notes timeseries.csv - Contains census records (triplicate counting) for all experimental populations ID: Unique identifier for each experimental population Subpop: Unique identifier for each chamber of a population Date: Census date sample1: First cenus sample2: Second census sample3: Third census HoleNum: Experimental treatment - number of connecting passages (mm) HoleSize: Experimental treatment - diameter of connecting passages (mm) Deteriorating: Experimental treatment - indicator for whether or not population was in the deteriorating food treatment group FoodLevel: Volume of food suspension supplied on the census date TrajectoryScores.csv - Treatment: "Deterioorating" or "Control" Replicate: Unique identifier for each experimental population CV: Indicator for CV increasing (1) or not increasing (0) Skewness: Indicator for skewness increasing (1) or not increasing (0) Autocorrelation: Indicator for autocorrelation increasing (1) or not increasing (0) Spatial Correlation: Indicator for spatial correlation increasing (1) or not increasing (0) HoleSize: Experimental treatment - diameter of connecting passages (mm) HoleNum: Experimental treatment - number of connecting passages (mm) Spike: Note indicating any early warning statistics shown to increase spanXX.csv - Contains manually obtained scores for whether or not the indicated statistic was increasing in the relevant interval for each replicate after loess detrending with span XX Treatment: "Deterioorating" or "Control" Replicate: Unique identifier for each experimental population CV: Indicator for CV increasing (1) or not increasing (0) Skewness: Indicator for skewness increasing (1) or not increasing (0) Autocorrelation: Indicator for autocorrelation increasing (1) or not increasing (0) Spatial Correlation: Indicator for spatial correlation increasing (1) or not increasing (0) HoleSize: Experimental treatment - diameter of connecting passages (mm) HoleNum: Experimental treatment - number of connecting passages (mm) Spike: Note indicating any early warning statistics shown to increase ANALYSIS SCRIPTS extinction.R - Analyzes the extinction time data; fits inverse Gaussian extinction time distribution and performs regression analysis using Cox proportional hazards model preprocess.R - Auxilary script to format the data for analysis ensembles.R - Calculates summary statistics over replicates and estimates the time-varying reproductive multiplier; outputs R workspace "analysis.RData" plots.R - Generates plots reported in the paper by Drake & Griffen (2010) trajectories.R - Calculates moving window statistics and fits smooth curves for each replicate; results reported in supplement to Drake & Griffen (2010) contingency.R - Performs contingency table analysis for the frequency of true and false positive early warning signals; results reported in supplement to Drake & Griffen (2010) detrend.trajectories.R - Calculates moving window statistics and plots for eaech replicate at six values of the span parameter of for loess detrendeding; results summarized in supplement to Drake & Griffen (2010). Plots were scored manually and entered into spreadsheets "spanXX.csv" detrending.experiments.R - Analysis comparing experiments with detrending to analysis of raw data; produces Figure A1 for the supplement to Drake & Griffen (2010) DATA PRODUCTS analysis.RData - Working directory created by "preprocess.R"