Home  >>  Archives  >>  Volume 12 Number 4  >>  pr0054

The Stata Journal
Volume 12 Number 4: pp. 748-758

Subscribe to the Stata Journal

Speaking Stata: Matrices as look-up tables

Nicholas J. Cox
Department of Geography
Durham University
Durham City, UK
Abstract.  Matrices in Stata can serve as look-up tables. Because Stata will accept references to matrix elements within many commands, most notably generate and replace, users can access and use values from a table in either vector or full matrix form. Examples are given for entry of small datasets, recoding of categorical variables, and quantile-based or similar binning of counted or measured variables. In the last case, the device grants easy exploration of the consequences of different binning conventions and the instability of bin allocation.
Terms of use     View this article (PDF)

View all articles by this author: Nicholas J. Cox

View all articles with these keywords: matrices, vectors, data entry, recoding, quantiles, binning, look-up tables

Download citation: BibTeX  RIS

Download citation and abstract: BibTeX  RIS