RECODE12: Stata module to standardize numeric 1/2 variables and corresponding two-category string variables as labeled 0/1 indicators
Hao Ma ()
Additional contact information
Hao Ma: NA
Statistical Software Components from Boston College Department of Economics
Abstract:
recode12 standardizes eligible numeric variables coded 1/2 and eligible two-category string variables as labeled 0/1 indicators. For a string variable, the first and second distinct nonmissing categories encountered in the current observation order serve as source categories 1 and 2. The required yesvalue() option applies the same mapping rule to numeric and string variables. The command supports numeric-only, string-only, and mixed-variable processing; generated-variable and replace modes; user-specified suffixes; optional detailed reporting; preservation of missing observations; and post-recoding verification. Variables that do not satisfy the applicable eligibility rule are left unchanged.
Language: Stata
Requires: Stata version 19.5
Keywords: data management; binary variables; recoding; categorical variables; string variables; indicator variables (search for similar items in EconPapers)
Date: 2026-07-13, Revised 2026-07-19
Note: This module should be installed from within Stata by typing "ssc install recode12". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/r/recode12.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/r/recode12.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/r/recode12_test.do
http://fmwww.bc.edu/repec/bocode/r/recode12_example.do
http://fmwww.bc.edu/repec/bocode/r/recode12_example_data.dta
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:s459795
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 ().