DOI: 10.5281/zenodo.10061466
title: Data and scripts for the paper 'Frequent disturbances enhance the resilience of past human populations'

description: Supplementary Methods

The following Zenodo repository contains all the necessary material to reproduce the results reported in the text: https://zenodo.org/doi/10.5281/zenodo.10061466. At a high level, the file resistance-resilience.RProj can be opened within RStudio to access and run the entire workflow. 

1.       Contents

The Supplementary Information is organised into six main folders:

data - radiocarbon date tables for 16 regions.

scripts - R scripts for running Bayesian MCMC models, statistical modelling of results, and producing outputs.

fits & output - the results of running the above scripts.

figures & supplement – figures and tables produced for the main text and for the Extended Data. 

2.       Data

Raw data for the MCMC analysis can be found in the data folder, comprising 18 tables (.csv format) of archaeological radiocarbon dates with accompanying metadata.

3.       Analysis

Bayesian MCMC

Code for performing Bayesian Markov Chain Monte Carlo analysis on aggregated radiocarbon data (mcmc.R). Please note that, given the long processing time and memory requirements for each MCMC fit, the script contains code to reproduce a single example: Southeastern Norway. This is one of the smaller datasets (617 dates), and takes approximately ~6 hours to complete on an Intel(R) Core(TM) i5-9600 CPU @ 3.10GHz with 16 GB of DDR3 RAM. However, any of the 18 radiocarbon datasets can be substituted in this script and the parameters altered per Table S1 to obtain posteriors for any case study. The output folder contains the full results of the Bayesian MCMC analysis: MCMC diagnostics, parameters, posterior checks, and resistance-resilience metrics collected on each fit, including traceplots, Rhat, and ESS checks.

Resistance-resilience metrics

Code for the resmet() function is also contained in the mcmc.R file. resmet() is an adaptation of Edinborough et al.'s post-hoc statistical test for demographic events in written and oral history (https://doi.org/10.1073/pnas.1713012114). The inspiration for this function - p2pTest() in rcarbon - is for use with objects of class ‘SpdModelTest’. This function extends the principle to ‘spdppc’ objects.

Following Riris and De Souza (ref. 12), Nimmo et al. (ref. 52), Cantarello et al. (ref. 53), and Van Meerbeek et al. (ref. 11), this will perform post-hoc tests for resistance and resilience on marks of an ‘spdppc’ object over all periods where SPDs are below growth model expectations ('downturns'). These two metrics are defined as the ability to absorb disturbances and "bounce back" following disturbances, respectively. They are normalised relative to the value of the SPD at the start of the interval of interest and fully described in the Methods section of the main text.

The function outputs a data frame containing the value of both metrics, as well as the duration, end- and start-times of downturns, and the time to SPD minimum, all in calendar years Before Present. Parameter 'LD' (short for lag/duration) is the Time to SPD minimum normalised by the downturn duration - which we term 'Pace' in the main text.

Raw results on individual posterior predictive checks can be found in the mcmc_metrics subfolder. resistance-resilience_metrics.csv contains the compiled, cleaned, and annotated dataset used in statistical modelling.

Statistical Modelling

Code for performing linear mixed-effect modelling on resistance-resilience metrics is contained in the statisticalmodelling.R file. It generates fitted models and diagnostics from the file resistance-resilience_metrics.csv.

4.       Display items

Figures and tables for the main paper text and the Materials & Methods can be found in the relevant sub-folders. The plotting.R script produces Figures 2-3 and Figures S1-7. 

Supplementary references

53. Nimmo, D.G., R. MacNally, S.C. Cunningham, A. Haslem, A.F. Bennett. Vive la résistance: reviving resistance for 21st century conservation. TREE 30, 516-23 (2015). https://doi.org/10.1016/j.tree.2015.07.008 

54. Cantarello, E., A.C. Newton, P.A. Martin, P.M. Evans, A. Gosal, M.S. Lucash. Quantifying resilience of multiple ecosystem services and biodiversity in a temperate forest landscape. Ecol. Evol. 7, 9661-75. https://doi.org/10.1002/ece3.3491