The problem of handling Roman numerals in Stata is used to illustrate issues arising in the handling of classification codes in character string form and their numeric equivalents. The solutions include Stata programs and Mata functions for conversion from numeric to string and from string to numeric. Defining acceptable input and trapping and flagging incorrect or unmanageable inputs are key concerns in good practice. Regular expressions are especially valuable for this problem.
AbrahamsP. W., and LarsonB. R.1997. UNIX for the Impatient. 2nd ed. Reading, ma: Addison–Wesley.
2.
AhoA. V., KernighanB. W., and WeinbergerP. J.1988. The AWK Programming Language.Reading, ma: Addison–Wesley.
3.
AllenA.1999. Review of Mathematics: From the Birth of Numbers, by Jan Gullberg. American Mathematical Monthly106: 77–85.
4.
CajoriF.1928. A History of Mathematical Notations. Volume I: Notation in Elementary Mathematics.Chicago: Open Court.
5.
CoxN. J.2002. Speaking Stata: On numbers and strings. Stata Journal2: 314–329.
6.
CoxN. J.2003. Stata tip 2: Building with floors and ceilings. Stata Journal3: 446–447.
7.
DaubenJ.2002. Review of The Universal History of Numbers and The Universal History of Computing, Parts I and II. Notices of the American Mathematical Society49: 32–38 and 211–216.