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.
CoxN. J.1999. dm69: Further new matrix commands. Stata Technical Bulletin50: 5–9. Reprinted in Stata Technical Bulletin Reprints, vol. 9, pp. 28–34. College Station, TX: Stata Press.
2.
CoxN. J.2000. dm79: Yet more new matrix commands. Stata Technical Bulletin56: 4–8. Reprinted in Stata Technical Bulletin Reprints, vol. 10, pp. 17–23. College Station, TX: Stata Press.
3.
CoxN. J.2002. Speaking Stata: How to face lists with fortitude. Stata Journal2: 202–222.
4.
CoxN. J.2003a. Speaking Stata: Problems with lists. Stata Journal3: 185–202.
5.
CoxN. J.2003b. Speaking Stata: Problems with tables, Part I. Stata Journal3: 309–324.
6.
WeesieJ.1997. dm49: Some new matrix commands. Stata Technical Bulletin39: 17–20. Reprinted in Stata Technical Bulletin Reprints, vol. 7, pp. 43–48. College Station, TX: Stata Press.