Replication Docker container
To maximize replicability, we wrote this manuscript using Quarto, which allowed us to mix computational figures, text, and tables with the actual prose of the manuscript. This means that there’s no need to rely on comments within the code to identify the location of each appropriate result in the manuscript—all results are programmatically included when rendering the document.
We use the {renv} package to create a stable version-specific library of R packages, and we use the {targets} package to manage all the file dependencies and run the analysis. {targets} is especially helpful with long-running objects like the main models, which take ≈40 minutes to run—as long as upstream dependencies don’t change, the models only need to run once, and can be loaded from {targets}’s data store thereafter.
Because it can sometimes be difficult to set up and configure version-specific libraries of R packages and install specific versions of Stan, we provide two methods for replicating our analysis: (1) a Docker container built and orchestrated with Docker Compose, or (2) restoring a {renv} environment on your local computer.
We have a separate GitHub repository with a Dockerfile and complete instructions for replicating the results (and the manuscript and the companion results notebook—this very website, actually!)