Drop-in scripts for an AEA-compliant R pipeline using the modern stack
(fixest, did, modelsummary).
| File | Purpose |
|---|---|
run_all.R |
Master script. Runs the full pipeline end-to-end. |
00_setup.R |
Paths, packages, seed, plot theme. |
01_clean.R |
Placeholder cleaning stage; replace with raw-to-analytic code. |
02_descriptives.R |
Summary-statistics scaffold. |
03_main_did.R |
Callaway-Sant'Anna DiD + Bacon + Honest DiD. |
04_robustness.R |
Placeholder robustness stage. |
05_heterogeneity.R |
Placeholder heterogeneity stage. |
06_tables.R |
AER-style booktabs table via fixest::etable. |
07_figures.R |
Placeholder figure stage. |
set.seed(20260101)in00_setup.R- Relative paths via
PROJECT <- getwd()andfile.path(...) - Output goes to
output/tablesandoutput/figures - Optional
renvlock for full package-version pinning cairo_pdfdevice for vector figures (publication-ready)
- Run
python3 scripts/scaffold_project.py r /path/to/projectfrom the AER-skills repository, or copy the contents oftemplates/r/into your project root - Open the project root in RStudio (so
getwd()is correct) renv::restore()if you maintain a lockfilesource("run_all.R")
The placeholder stages are intentionally conservative. 01_clean.R stops with a
clear message until you either write data/intermediate/analytic.dta or replace
it with project-specific cleaning code.
- fixest —
feols,etable. AER-style tables out of the box. - did — Callaway-Sant'Anna ATT(g,t), aggregations, event study
- HonestDiD — Rambachan-Roth pre-trends sensitivity
- rdrobust + rddensity — modern RDD
- modelsummary — flexible table backend (kableExtra / gt / LaTeX)
- fwildclusterboot — wild cluster bootstrap for few-cluster inference