Replication Package Template

Session 2: AEA Replication in Quarto

Cynthia Huang

Tuesday, July 18, 2023

Standards, guidelines, and policies

Social Science Data Editors

πŸ”— github.com/social-science-data-editors

  • Organisation of Data Editors from leading journals in social sciences
  • Publish various resources, templates and guidelines on reproducibility in social sciences

DCAS

The Data and Code Availability Standard is a standard for sharing research code and data, endorsed by leading journals in social sciences.

Unofficial Guidance

AEA Policies and Guidance

Journals which endorse DCAS aim to have polices which are compliant with the standards.1 AEA resources include:

Replication packages

Step 0: Read the Guidelines?

Step 1 of the AEA Replication Package involves Preparing your files for verification. Again, this is a fairly long and detailed read.

TLDR: Press play and replicate!

A replication package should:

  • reproduce all analysis, figures, tables in the associated paper
  • fully document, cite and license all data used in analysis
  • fully document and license code used in analysis
  • include all data and code subject to confidentiality and licensing restrictions
  • specify computational requirements
  • set-up any packages/tools/modules required to run the analysis
  • run free of manual intervention (as far as possible)

README Template

The Social Science Data Editors also maintain a template README that includes the following components:

  • Overview
  • Data Availability and Provenance Statements
  • Dataset List
  • Code/Program Descriptions
  • Computational Requirements
  • Instructions to Replicators
  • References and Acknowledgements

So what can Quarto offer?

  • reusability and flexibility
  • combine multiple work streams
  • reuse existing text format outputs
  • citation and references
  • get a website (almost) for free!

Quarto Replication Template

Our Turn: Get the Template

Template: README.qmd

  • AEA does not prescribe a set format for the README file
  • Different formats are useful for different venues
    • .pdf –> into the .zip archive
    • .md –> GitHub repo
    • .html –> showcase website
  • All are possible with .qmd!

Template: BYO Code and Data

  • Bring your existing projects or workflows as they are.
  • Add, remove or modify folders as you like!
  • Maybe even develop your STATA scripts from inside the replication-pkg folder

Template Structure: Replication

  • The replication package is contained INSIDE the Quarto website project.
  • replication-pkg/ contains all code, data and replication documentation.
  • Compress to to replication-pkg.zip for submission
./
β”œβ”€β”€ _quarto.yml
β”œβ”€β”€ index.qmd
β”œβ”€β”€ paper/
└── replication-pkg/
    β”œβ”€β”€ LICENSE.txt
    β”œβ”€β”€ README.qmd
    β”œβ”€β”€ code/
    β”‚   β”œβ”€β”€ 00_setup/
    β”‚   β”œβ”€β”€ 01_dataprep/
    β”‚   β”œβ”€β”€ 02_analysis/
    β”‚   └── 03_appendix/
    β”œβ”€β”€ data/
    β”‚   β”œβ”€β”€ analysis/
    β”‚   β”œβ”€β”€ interim/
    β”‚   └── raw/
    β”œβ”€β”€ output/
    └── references.bib

Template Structure: Website

  • Place your finished publication in paper/
  • Update _quarto.yml and index.qmd
  • Render and you have a website for your paper!
  • Publish and share with the world
./
β”œβ”€β”€ _quarto.yml
β”œβ”€β”€ index.qmd
β”œβ”€β”€ paper/
└── replication-pkg/
    β”œβ”€β”€ LICENSE.txt
    β”œβ”€β”€ README.qmd
    β”œβ”€β”€ code/
    β”‚   β”œβ”€β”€ 00_setup/
    β”‚   β”œβ”€β”€ 01_dataprep/
    β”‚   β”œβ”€β”€ 02_analysis/
    β”‚   └── 03_appendix/
    β”œβ”€β”€ data/
    β”‚   β”œβ”€β”€ analysis/
    β”‚   β”œβ”€β”€ interim/
    β”‚   └── raw/
    β”œβ”€β”€ output/
    └── references.bib

Template: Website Defaults

_quarto.yml
project:
  type: website
  output-dir: docs 

website:
  title: "Data and Code for: Matching Mechanisms for Monkey Placement"
  description: "Supplementary materials and replication package"
  
  sidebar:
    pinned: true
    align: center
    style: docked
    search: false
    collapse-level: 2
 
    contents:
      - text: Code
        href: code.qmd
      - text: Data
      - text: Paper

format:
  html:
    theme: cosmos
    toc: true

Your Turn: replication-pkg/

  • Add at least one file to these template folders:
    • code/
    • data/
    • paper/
  • Modify at least one section in the README.qmd using a Quarto feature you’ve learnt today.
  • Render README.qmd
15:00