Repository overview This repository contains all scripts, datasets, and documentation required to reproduce the analyses presented in our study. The materials are organized into folders corresponding to each major step of the analytical workflow. This README describes the structure, contents, and purpose of each folder, allowing users to navigate and reproduce the analyses. Folder structure and contents Figure 1. Overview of repository folder structure and contents. 1. Environmental variables Folder: Gridₗevelₑnvironment This folder contains environmental predictors extracted at the grid-cell level. File: environmentaldata. rdsIncludes: Mean annual temperature (°C) Mean annual precipitation (mm) Net primary productivity (NPP) Grid-cell identifiers Latitude and longitude coordinates These variables are used as environmental predictors in the Structural Equation Models (SEMs). 2. Speciation rates across species and grid cells Folder: Gridₗevelₛpeciation This folder contains speciation rate estimates for each species within each tetrapod class. Data are organized into subfolders corresponding to the four tetrapod groups: Amphibians Reptiles Birds Mammals Each dataset includes species-level speciation estimates and their association with grid cells. Speciation rate metrics included: DR metric BAMM estimates ClaDS estimates These estimates are used to calculate grid-level summaries of speciation rates for the SEM analyses. 3. Assemblage age estimates (evolutionary time) across grid cells Folder: Gridₗevelₐssemblageₐge This folder contains files used to estimate assemblage age (evolutionary time) for each grid cell using BioGeoBEARS DEC biogeographic models. Each tetrapod class is organized into multiple clade-specific folders. Each clade folder contains the following files: Key files: arrivalₜimeclade*. csvMean arrival time of species in each grid cell (assemblage age) clade*biogeoₐrea. csvMost likely reconstructed biogeographic area for each grid cell clade*PAM. csvPresence–absence matrix of species across grid cells clade*ₜree. trePhylogenetic tree for the focal clade geoₐreaclade*. dataGeographic area file used in DEC analyses resultsDECclade*. RdataBioGeoBEARS DEC model outputs DECₚlotclade*. pdfVisualization of reconstructed geographic ranges across the phylogeny These outputs are used to calculate assemblage age metrics incorporated into the SEM framework. 4. Structural Equation Model outputs Folder: SEMₒutputs This folder contains summarized outputs from the Structural Equation Models (SEMs) for each tetrapod class. Files: SEMₐllₑffects. csvComplete SEM output, including: Mean standardized path coefficients Confidence intervals p-values Clade-level traits (see Methods in the main paper) SEMdirectₑffects. csvMean direct standardized path effects of each predictor on species richness across clades for each tetrapod class. SEMᵢndirectₑffectsᵥiaₚroductivity. csvMean indirect effects mediated by productivity (NPP). SEMᵢndirectₑffectsᵥiaₛpeciation. csvMean indirect effects mediated by speciation rates. SEMᵢndirectₑffectsᵥiaₜime. csvMean indirect effects mediated by evolutionary time (assemblage age). 5. Running and plotting SEM models Folder: SEMₛcripts This folder contains scripts used to fit the SEM models and generate the figures presented in the manuscript. Scripts included: runcladeₗevelSEM. RRuns the Structural Equation Models for each tetrapod clade. plotSEMₜotalₑffects. RPlots the total effects of predictors across tetrapod classes. plotSEMdirectₑffects. RPlots the direct effects of predictors on species richness. plotSEMᵢndirectᵥiaₚroductivity. RPlots indirect effects mediated by productivity. plotSEMᵢndirectᵥiaₛpeciation. RPlots indirect effects mediated by speciation rates. plotSEMᵢndirectᵥiaₜime. RPlots indirect effects mediated by evolutionary time. plotSEMdiagnostics. RPlots SEM model diagnostic metrics (e. g. , CFI, RMSEA, SRMR) across clades. 6. Effects of clade-level traits on richness–predictor relationships Folder: SEMₑffectsᵥsCladeTraits This folder contains analyses testing whether predictor effects on species richness vary according to clade-level traits. Script: plotSEMₑffectsᵥsCladeTraits. R This script evaluates relationships between SEM coefficients and clade-level attributes, including: Physiology (endothermy vs ectothermy) Clade geographic range size Clade age Clade species richness 7. Model comparison of alternative richness-generating scenarios Folder: SEMₛcenarioscomparison This folder contains scripts and outputs used to evaluate alternative richness-generating scenarios using SEM model comparison. Four scenarios were tested: Stable persistence Speciation balance Historical legacy Diversity cradles Files included: SEMᵣichnessₛcenariocomparison. RRuns SEM models representing each scenario and performs AIC/BIC model comparison. plotSEMₘodelₛcenarios. RGenerates figures summarizing scenario support across tetrapod clades. SEMₘodelcomparison_*. csvModel comparison results for each tetrapod class.
Cerezer et al. (Thu,) studied this question.