Skip to main content
Dryad

Data and code from: Microclimate mediates the strength and direction of avian biotic interactions

Abstract

Code in this repository implements Bayesian dynamic occupancy models to estimate settlement (colonization) and persistence (survival) probabilities for 20 species pairs of montane forest birds. Models account for the presence or absence of a heterospecific, local vegetation structure, microclimate, interannual variation, and survey‑specific detection covariates (day‑of‑year and time‑of‑day). Additional scripts extract, from the MCMC output, the probability that settlement or persistence of a focal species is higher in the absence of its heterospecific (i.e., the probability of competition) across a microclimate gradient and identify temperature ranges where this probability exceeds 0.8 (strong competition) or falls below 0.2 (strong facilitation). A final set of scripts tests for phylogenetic signal in the interaction outcomes using cophenetic distances derived from a published bird tree. The repository includes seven annotated R scripts, three core input data files (detection histories, environmental covariates, and microclimate temperatures), a phylogenetic tree file, and summary output tables used in the manuscript. All models were fitted using JAGS (version ≥ 4.0) via the R package ‘rjags’, with MCMC post‑processing performed using ‘coda’ and ‘MCMCvis’.