Home  >>  Archives  >>  Volume 11 Number 1  >>  dm0054

The Stata Journal
Volume 11 Number 1: pp. 126-142



Subscribe to the Stata Journal
cover

Speaking Stata: MMXI and all that: Handling Roman numerals within Stata

Nicholas J. Cox
Department of Geography
Durham University
Durham, UK
[email protected]
Abstract.  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.
Terms of use     View this article (PDF)

View all articles by this author: Nicholas J. Cox

View all articles with these keywords: fromroman, toroman, Roman numerals, strings, regular expressions, Mata, data management

Download citation: BibTeX  RIS

Download citation and abstract: BibTeX  RIS