NAAM: Stata module to provide consistent string encoding, ID hashing, and label management
Vijayshree Jayaraman ()
Additional contact information
Vijayshree Jayaraman: NA
Statistical Software Components from Boston College Department of Economics
Abstract:
naam addresses a common and consequential problem in large-scale survey and administrative data work: encoding string variables consistently across multiple datasets or rounds. Stata's built-in encode assigns numeric codes alphabetically within each dataset independently. When a new category appears in a later round -- a new district, a new industry, a new response option -- all alphabetically subsequent codes shift. Any merge or append across rounds then produces silently wrong results with no error message. This is particularly common in multi-round household surveys, administrative panel datasets, and any project where data arrives in separate files over time. naam solves this by encoding once, saving the exact string-to-numeric mapping to an Excel workbook, and reapplying those mappings instantly to every subsequent file. The same string always receives the same numeric code. New categories are detected automatically, assigned the next available code, and the Excel file is updated. The workbook also serves as a permanent, human-readable audit record of every mapping in the project.
Language: Stata
Requires: Stata version 14
Keywords: encode; value labels; string variables; codebook; Excel; merge; panel data; ID variables; data quality (search for similar items in EconPapers)
Date: 2026-03-24
Note: This module should be installed from within Stata by typing "ssc install naam". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/n/naam.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/n/naam.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/n/naam_round1.dta sample data file (application/x-stata)
http://fmwww.bc.edu/repec/bocode/n/naam_round2.dta sample data file (application/x-stata)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459649
Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().