This code may be used to fit Bernoulli-binomial models with latent group effects on both the Bernoulli and binomial parameters, where the former may be seasonally dependent. This model may be used to fit site (sampling unit) occupancy models, where the Bernoulli and binomial parameters and the grouping factor denote the probability of site occupancy, conditional probability of species detection, and seasons, respectively. We also include code which may be used for a calibration study of model performance.
Citation: Gray, Brian and Richard Erickson, 2019, R and SAS occupancy correlated area code, U.S. Geological Survey code release, https://doi.org/10.5066/P9ABEKOL.
This README file describes how to use this code.
The SAS_code folder contains the SAS code for running the model and the R_code file contains the R code for running the model.
The model_evalulation file contains the code used to evaluate the model.
The following files are contained in this repository:
README.mdis this file.LICENSE.mdis the Official USGS License.R_codeis a folder that contains the following files:example_simulate_data.Ris R code that simulates data and recovers itexample_data.Rfits the example from the paper using R and RStanoccupancy_correlated_error.stanis the model code in Stan.
SAS_codeis a folder that contains the following files:case study create dataset 191010.sasis a SAS file that may be used to modify data downloaded from here. This file is not needed to fit the case study model.case study fit models 200430.sasis a SAS file that may be used to create case study resultsZIB with AR1 200430.sasis a SAS file that may be used to reproduce simulation results
datadenotes the following data files:code.jsonis the code metadata.Contributing.mddescribes how to contribute to this project.Disclaimer.mdis the standard USGS disclaimer.
Brian R. Gray ([email protected]) for the overall project and SAS code questions.
Richard A. Erickson ([email protected]) for the R and RStan code.