Skip to content

Design a Reproducible Research Codebook & Project Architecture

Generate a publication-grade Data Dictionary, variable codebook, and replication-package README (AEA / Nature / TIER standard) from raw scripts and data headers.

Copy the prompt and paste it into the AI assistant you already use.

What journal Data Editors check in replication packages

  1. 01

    Keep `data/raw/` 100% read-only and untouched

    Every single recode, outlier filter, and sample merge must flow deterministically from untouched raw inputs via numbered master scripts (`00_master.R` / `main.do`).

  2. 02

    Map every Manuscript Table and Figure to an exact script line

    Include an explicit lookup table in `README.md`: `'Table 2 -> scripts/04_main_regressions.R (lines 88–142) -> output/table_2.tex'`.

  3. 03

    Document variable units, survey skip universes, and derived formulas

    A column named `inc_adj` is useless in two years unless the codebook specifies `'Household post-tax income in 2024 constant USD, deflated via CPI-U; asked only if emp_status != 4'`.

  4. 04

    Eliminate hardcoded `/Users/sarah/Desktop/` paths and unseeded RNGs

    Flag absolute local paths, missing `renv.lock` / `requirements.txt` package versions, and bootstrap/simulation calls lacking a fixed random seed.

How it works in practice

Messy script + survey header snippet

CSV cols: `pid, w1_q8, w1_q9, rev_chg`. Stata snippet: `gen rev_chg = (w2_rev - w1_rev)/w1_rev if w1_q8 != 9`. Survey PDF Q8: 'In 2024, did this facility operate all 12 months? (1=Yes, 2=Seasonal, 9=Don't know)'.

Generated Codebook & Lineage entry

| Variable | Type | Label & Units | Universe / Filter | Values / Derivation | |---|---|---|---|---| | `w1_q8` | Integer | Full-year 2024 facility operation | All Wave-1 respondents | `1`=All 12 mos; `2`=Seasonal; `9`=Don't know | | `rev_chg` | Float (Proportion) | YoY proportional revenue change (W1->W2) | Excludes `w1_q8 == 9` (`Don't know`) & `w1_rev == 0` | `(w2_rev - w1_rev) / w1_rev` (Note: `0.12` = `+12%`) |

Cross-linking raw survey PDFs with Stata recode lines produces a self-documenting codebook before institutional memory evaporates.

Good to know

What if my paper relies on confidential administrative or proprietary corporate data?

Top journal Data Editors still require full cleaning and analysis code, a synthetic/mock schema dataset demonstrating code execution, and step-by-step instructions on how independent researchers apply for data access.

Why do replication packages fail on a Data Editor's machine even when paths are relative?

Unpinned R/Python package updates, case-sensitive Linux vs macOS filenames (`Data/Clean.csv` vs `data/clean.csv`), and unseeded `sample()` or cluster-bootstrap calls are the top three culprits.

When is the right time to build the project codebook—at day 1 or after acceptance?

Generating and updating the codebook at intake saves weeks of panic upon conditional acceptance, when nobody remembers why `flag_v3` dropped 47 observations three years earlier.

Learn more

Related guides and background articles for this task