DOI: 10.5061/dryad.m63xsj47c
title: Resources for: Spatio-temporal integrated Bayesian species distribution models reveal lack of broad relationships between traits and range shifts

description: Aim: Climate change and habitat loss or degradation are some of the
 greatest threats that species face today, often resulting in range shifts.
 Species traits have been discussed as important predictors of range
 shifts, with the identification of general trends being of great interest
 for conservation efforts. However, studies reviewing relationships between
 traits and range shifts have questioned the existence of such generalized
 trends, due to mixed results and weak correlations, as well as analytical
 shortcomings. The aim of this study was to test this relationship
 empirically, using analytical approaches that account for common sources
 of bias when assessing range trends.Location: Tanzania, East Africa.Time
 period: 1980-1999 and 2000-2020.Major taxa studied: 57 savannah specialist
 birds found in Tanzania, belonging to 26 families and 11 orders.Methods:
 We applied recently developed integrated spatio-temporal species
 distribution models in R-INLA, combining citizen science and bird atlas
 data to estimate ranges of species, quantify range shifts, and test the
 predictive power of traditional trait groups, as well as exposure-related
 and sensitivity traits. We based our study on 40 years of bird
 observations in East African savannahs, a biome that has experienced
 increasing climatic and non-climatic pressures over recent decades. We
 correlated patterns of change with species traits.Results: We find
 indications of relationships identified by previous research, but low
 average explanatory power of traits from an ecological perspective,
 confirming the lack of meaningful general associations. However, our
 analysis finds compelling species-specific results.Main conclusions: We
 highlight the importance of individual assessments, while demonstrating
 the usefulness of our analytical approach for analyses of range shifts.
description: # Resources for: Spatio-temporal integrated Bayesian species distribution
 models reveal lack of broad relationships between traits and range shifts
 ## Overview This repository is supporting information for the manuscript:
 Wiethase, J. H., Mostert, P.S., Cooney, C., O'Hara, R.B. & Beale,
 C. M. Spatio-temporal integrated Bayesian species distribution models
 reveal lack of broad relationships between traits and range shifts. The
 scripts cover the entire workflow from data preparation to model building,
 sensitivity analysis, result extraction, regression analysis, and
 visualization. Also included are the required model data, model output as
 a .csv file, output figures, and supporting source files containing
 functions. The species observation data were derived from the Tanzania
 Bird Atlas and eBird. ## Contents - scripts (folder `R`) 1.
 **`1_Make_SDM_general_data.R`** * Prepares general data for the INLA
 Species Distribution Models (SDMs). Original species observation data will
 have to be obtained from eBird
 ([https://science.ebird.org/en/use-ebird-data/download-ebird-data-products](https://science.ebird.org/en/use-ebird-data/download-ebird-data-products)) or the Tanzania Bird Atlas ([http://www.tanzaniabirds.net](http://www.tanzaniabirds.net)). 2. **`2_make_species_SDM_data.R`** * Creates species-specific SDM data. 3. **`3_make_model_files.R`** * Creates model files for the INLA models. 4. **`4_Run_prior_mesh_sensitivity_analysis.R`** * Conducts sensitivity analysis related to priors and mesh choice in the INLA models. 5. **`5_check_effort_effect.R`** * Analyses the effect of sampling effort on INLA model results. 6. **`6_Make_final_SDMs.R`** * Creates the final INLA SDMs, based on the sensitivity analysis. 7. **`7_Get_INLA_results.R`** * Extracts results from the final INLA models. 8. **`8_Make_regression_data.R`** * Prepares data for regression analysis of range shifts ~ traits. 9. **`9_Run_trait_analysis.R`** * Runs the regression analysis of range shifts ~ traits. 10. **`10_Make_manuscript_figures.R`** * Creates figures and tables for the manuscript. ## Contents - scripts (folder `source`) 1. **`Various`** * Collection of custom R functions used in different stages of the analysis. ## Contents - data (folder `model_data`) 1. **`trait_model_data.csv`** * The data set used for the for regression analysis of range shifts ~ traits. Each row consists of transition metrics as well as traits for a given species. Trait variables correspond broadly to metadata tab in **`Avonet2_eBird.xlsx`**. Additional trait variables are sensitivity traits as percentage of variation explained by environmental covariates alone (with name `imp`), as well as traits related to habitat breadth, as range of values where the probability of presence is above 0.5 in the effect plots (with name `breadth`). `temp_imp`, `temp_breadth`: Hottest temperature, `rain_imp`, `rain_breadth`: annual rainfall, `dry_imp`, `dry_breadth`: longest dry spell, `BG_imp`, `BG_breadth`: bare ground cover, `HFP_imp`, `HFP_breadth`: human footprint. Relevant range shifts used for the analysis are the log-proportional change in range size between the two time periods in the study (`log_prop_change`), relative expansion on the log scale (`log_relative_expansion`) and relative contraction on the log scale (`log_relative_contraction`). 2. **`regression_data.RData`** * The full data used for the for regression analysis of range shifts ~ traits. Contains the linear combinations used for regression models with either habitat breadth (`all_lc_breadth`) or sensitivity traits (`all_lc_sens`). Object `all_species` is the full data containing species transition scores and traits, `model_data` is filtered to those species with no missing value in column `avg.r`. 3. **`plumage_lightness.csv`** * The specific dorsal reflectance trait values for each species (column `avg.r`), based on reflectance across the whole uv-vis region (300-700 nm). 4. **`Avonet2_eBird.xlsx`** * The full Avonet traits database. See tab `Metadata` for details on the trait variables used in the analysis. 5. **`model_files_E...RData`** * Combined files used for the INLA models at different mesh resolutions, resolution specified by the number following `E` in the name string, in degrees. Contains objects for creating the SDM predictions (`predcoords`, `projgrid`, `spatial_points`), the triangulated mesh (`mesh`), the covariates sampled at integration points during the data integration step (`NearestPredCovars`), and the duplicated version of teh sampled covariates corresponding to the two time periods in the study (`covs_duplicated`). 6. **`TZ_INLA_model_data.RData`** * General combined files used for the INLA models, not specific to different mesh resolutions. Contains the linear combinations and sequences used to draw the effect plots (`all_lc` and `all.seq`), the processed bird observation data sets corresponding to Tanzania Bird Atlas (`altas_filtered`) and eBird (`ebird_filtered`) data, and a combination of all covariates used for the SDM (`temporal_variables_spdf`). 7. **`RData` files contained in folder `species`** * Combined observation data files for each individual bird species. Contains the bird observation data sets corresponding to Tanzania Bird Atlas (`altas_sp`) and eBird (`ebird_sp`) data, filtered to the species identified by the filename. ## Instructions * Execute the scripts in numerical order for a complete workflow. * Modify the paths and parameters as needed for your specific dataset and analysis.