Replication package for:
Adema (2026), "Immigrants and the Making of America: A Comment"

HOW TO RUN
Open code/main.do and edit line 2, replacing <path to replication_SNQ_reresubmission> with
the full path to this folder on your machine (keep the quotation marks). Then run main.do,
which runs the four scripts below in order. Runtimes (approximate; the last two can be
shortened by lowering the number of simulations / using a coarser grid):
  results.do ~2 min | conley.do ~15-20 min | confidence_intervals.do ~24h |
  randomization_inference.do ~60h.

STATA PACKAGES -- BUNDLED, nothing to install
All required user-written commands (ivreg2, reghdfe, estout, binscatter, heatplot, and their
dependencies) are bundled in .\ado; main.do points Stata there via
  sysdir set PLUS "`c(pwd)'/ado"
To run a script directly without main.do, execute that line first (or ssc install the
packages). The Conley SE routines (Conley_x_ols_update.do, Conley_x_gmm_update.do) live in code/.

CODE (code/)
main.do                     Sets the root path and runs the four scripts below.
results.do                  Builds the analysis data and produces all point estimates,
                             R2's, first-stage F-stats, and every figure.
conley.do                   Conley (five-degree window) SEs for every specification.
confidence_intervals.do     Anderson-Rubin and randomization-inference confidence intervals.
randomization_inference.do  Randomization-inference p-values and RI test-statistic figures.
Each script's header comments name the exhibit(s) each section feeds. Some sections
("UNVERIFIED_..." in conley.do) compute diagnostics whose target exhibit could not be
identified; they're kept for transparency but don't back any table in the paper.

DATA (data/) -- from the SNQ replication package, not modified by the code
Main_Tables.dta   County-level analysis variables.
Zero_Stage.dta    County-decade panel used to build the instrument.
workdir/          Intermediate files created by results.do; inputs to conley/CI/RI.

OUTPUT -> ../Manuscript/output_rere/
Every file carries the manuscript exhibit number(s) it backs as a suffix (e.g. _T1, _FA12).
Three kinds of file:
  - FIGURES: auto-generated .pdf files, directly \includegraphics'd by the manuscript.
  - FINAL, HAND-MADE tables (e.g. tab1_merged_mod_T1.tex, T4A_TA2.tex): the table bodies the
    manuscript \inputs directly. They transcribe point estimates from the raw fragments and
    Conley SE / Anderson-Rubin CI / RI p-value figures from the logs below -- edit these
    directly; they are the single source of truth for each table.
  - RAW FRAGMENTS AND LOGS (e.g. FS_fragT1.tex, Conleys_fragTA6.smcl, AR_CIs_fragT1.pdf):
    intermediate output, not \input by the manuscript, kept so every number in a final table
    traces back to its source. One fragment per exhibit (a table split across code sections,
    like Table 1, is combined into a single fragment file, not left split).
  NOTE: tab1_merged_fragT1_TA5.tex, tab2_appendix_merged_fragTA6.tex, and
  tab_noplac_fragTA1.tex are hand-merged and not regenerated by any script -- if missing
  after a from-scratch run, they need to be re-combined by hand from the individual
  esttab fragments.
