Skip to content

Code for Eastern Screech-Owl dynamic occupancy analyses for Fort Collins, CO

License

Notifications You must be signed in to change notification settings

kpdavi/easo-dyn-occ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scripts and figures for Eastern screech-owl dynamic occupancy analysis in Fort Collins, CO

DOI

This repository contains the scripts to reproduce analyses and figures for the corresponding scientific publication in the Wilson Journal of Ornithology (2025). The complete repository for this publication, including the raw / processed data and scripts to compile the data, fit the model, and summarize / plot model outputs, is on Zenodo (see DOI link above).

We fit a dynamic occupancy model in the Bayesian framework to 9 years of occupancy data (2013–2021) from a participatory science monitoring program in Fort Collins, Colorado, USA to explore environmental factors associated with Eastern screech-owl (Megascops asio maxwelliae) breeding season occupancy dynamics in an understudied portion of its range. We found that Eastern screech-owl persistence probability decreased while colonization probability increased with aggregation of tree cover and average breeding season temperature. We also found colonization probability increased with cumulative winter precipitation, and persistence probability decreased with average winter minimum temperature. Overall, our results suggest that this population of Eastern screech-owls responds to climate before and during the breeding season in complex ways, and that the species appears to experience high turnover in this study area along the western edge of its continental range.

Sharing/access information

The Eastern screech-owl monitoring program is ongoing and potential users of the data are encouraged to contact Rob Sparks for additional information or potential collaboration. Research permits to conduct surveys for Eastern screech-owl were secured with the City of Fort Collins Natural Areas Department.

Workflow notes

JAGS must be installed in order to fit the dynamic occupancy model. Download JAGS at https://sourceforge.net/projects/mcmc-jags/.

Open the easo-dyn-occ.Rproj file first to ensure that all folders within the project are properly loaded into the working directory.

Relatedly, and in addition, this project uses the renv package to keep track of which R packages and versions were used so that others can easily set up the same environment using renv.lock and renv/. If you open the .Rproj file first, the renv package will ask to install itself, and if that prompt is accepted, it will restore the required packages — i.e., you won't need to manually interact with renv.lock or renv/ yourself.

Description of the repository structure

Note that descriptions of the raw and processed data and additional details about script outputs (e.g., model results) are in the associated Zenodo repository (see DOI link above).

Scripts

Within the subfolders of scripts 📁, scripts with the same numeric prefix can be run in any order.

  • data_prep 📁
    • 1_data_prep_*.R 📄. Code to calculate the climate, vegetation, and detection covariates.
    • 2_model_prep.R 📄. Code to format the climate and vegetation covariates and generate variables needed for model fitting.
  • model_fitting 📁
    • 3_model_fit_dynocc.R 📄. Code to fit the dynamic occupancy model in the Bayesian framework.
    • 4_summarize_model_diagnostics.R 📄. Code to summarize model diagnostics — Bayesian p value for the log likelihood and area under the receiver operating characteristic curve (AUC) — from the dynamic occupancy model.
    • model_code_dynocc.txt 📄. Text file of the dynamic occupancy model in JAGS. This file is called within the function to fit the model in the 3_model_fit_dynocc.R script.
  • plots 📁
    • 4_fig*.R 📄. Code to create figures 2—4 in the publication. Outputs of these scripts are in plots 📁 and include fig*.png (described in more detail below).
  • utils 📁
    • utils_*.R 📄. Helper functions for calculating climate variables (utils_calculate_daymet_climate_variables.R), predicting data from the dynamic occupancy model (utils_predict_data_from_model.R), and generating figures (utils_plot_occ_prob_by_year.R and utils_plot_predicted_data.R).

Plots

Figures from the manuscript are contained in the following folder:

  • plots 📁. Plots for Figures 2—4 in the manuscript, which visualize parameter estimates for model coefficients (fig2_coeff_param_ests.png), model-predicted probability of persistence, colonization, and initial occupancy as a function of covariates (fig3_coeff_param_preds.png), and model-estimated probability of persistence, colonization, occupancy, and detection by year (fig4_occ_proc_prob.png).

Code/software

All scripts were run using R Core Team (2024). Loaded packages / software are indicated in the scripts and cited below:

About

Code for Eastern Screech-Owl dynamic occupancy analyses for Fort Collins, CO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages