Script readme file. The code is as self contained as possible and all data used is openly accessible from either CITES, the IUCN, VertLife or TimeTree. Included here is the raw processed CITES data with yearly species volumes - CITES_raw_data.csv There are a few unavoidable instances where data is written out and processed manually. This only occurs where we attempt to resolves species names used by cites and replace them with synonyms used by the IUCN. Any questions please contact omorton1@sheffield.ac.uk BROAD DATA PREPARATION 1_Data_Curation.R ~ This takes the raw CITES bulk data download version 2021.1 and processes it. ~ At the time of writing we used the most up to date CITES data download 2021 v1. API_IUCN_Data.R ~ This uses the species lists from the 1_Data_Curation.R script. ~ Here we use the IUCN API to extract all statuses and tidy these to fit to the actual data output from 1_Data_Curation.R. ~ We further generate species specific listing series - the time when each species was listed in the Appendices and as such could be recorded in the database. ~ Resulting product is a database of species in trade each year and their matched IUCN status each year (plus trade infomation). IUCN STATUS ANALYSIS 3_IUCN_Status_Data.R ~ This prepares the data for the presence analysis across IUCN statuses.It uses the output of API_IUCN_Data.R ~ Here we extract species lists and process the phylogenies. We also deal with naming inconsistencies between vertlife/timetree and CITES. ~ The output here is a database and phylogenetic correlation matrix per taxonomic class ready for modelling. 4_IUCN_Status_Models.R ~ Here we fit the phylogenetic multilevel models to the class data sets. As detailed in the script these take considerable run time. CITES SPLIT-LISTING ANALYSIS 5_Split_Listing_Data_and_Model.R ~ Here we use the cleaned data from the 1_Data_Curation.R script and process this to look only at traded split listed species. ~ All species listed under multiple appendices are checked for whether they are genuinely split listed - see methods for further details on this. ~ Species are created custom timeframes for when they are split listed. ~ Then we fit the multilevel model. IUCN STATUS CHANGE ANALYSIS 6_IUCN_Change_Preparation.R ~ This prepares the data output from 2_API_IUCN_Data.R. Specifically it converts the tracked IUCN statuses to categories of change. ~ See methods for details of the categories used. ~ It also removes species we cannot model in this analysis (see methods for details). 7_IUCN_Change_Data.R ~ This uses the output from the 6_IUCN_Change_Preparation.R script. ~ As with 3_IUCN_Status_Data.R this script extracts species lists and processes the phylogenies. We also deal with naming inconsistencies between vertlife/timetree and CITES. ~ The output here is a database and phylogenetic correlation matrix per taxonomic class ready for modelling. 8_IUCN_Change_Models.R ~ Here we fit the phylogenetic multilevel models to the class data sets. As detailed in the script these take considerable run time.