Which records entered the merge?
| Input | Raw | Invalid | Extra duplicates | Conflict rows held | Retained |
|---|---|---|---|---|---|
| Firm-year master | 16 | 3 | 1 | 2 | 10 |
| Region lookup | 10 | 1 | 1 | 2 | 6 |
All inputs are originally generated simulations. Check firm-year and firm keys, preserve text-ID leading zeros, quarantine invalid values before removing extra exact duplicates, and hold out all conflicting-key rows. Independent Python/Stata executions agree on counts, row statuses, clean values and merged data. Raw inputs remain and missing values are not imputed.
Why 11 merged rows but 10 master observations?
There are 8 matched, 2 master-only and 1 lookup-only records. merged-all.csv retains every status. A lookup-only row has no master year and is not a new observed firm-year. analysis-ready.csv retains all 10 cleaned master observations, including unmatched ones, with one missing revenue and one missing employees value.
- Simulated master · Simulated region table · Data dictionary
- Python · Stata
- Master row audit · Lookup row audit
- All merge statuses · Master analysis-ready data
- Actual implementation cross-check · Actual Stata log · README
Python needs only the standard library: run python clean_merge.py --output-dir rerun/python from the root. In an independent Stata session, create rerun then run do clean_merge.do rerun/stata. Retain reference results and compare source rows and actual values. Fixture rules do not replace real-data definitions or sample decisions. Windows hardware and a model executing the workflow were not covered.