LEVELS: Stata module to report distinct levels of integer or string variable
levels displays a sorted list of the distinct values of varname, which should be a variable taking on integer or string values, or in other words, a categorical variable, very broadly so defined. It may be useful when it is desired to cycle through the distinct values of varname with (say) foreach. levels leaves behind a list in r(levels) which may be used in a subsequent command. Optionally, the list may be inserted as a local macro within the calling program's space. levels is considered to be vallist (STB-60) done better. levels requires Stata 8. levels7, also herewith, is a version for Stata 7.
|Requires:||Stata version 8.0 (7.0 for levels7)|
|Date of creation:||16 Jul 2002|
|Date of revision:||08 Apr 2003|
|Note:||This module may be installed from within Stata by typing "ssc install levels". Windows users should not attempt to download these files with a web browser.|
|Contact details of provider:|| Postal: Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA|
Web page: http://fmwww.bc.edu/EC/
More information through EDIRC
|Order Information:||Web: http://repec.org/docs/ssc.php|
When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s426303. See general information about how to correct material in RePEc.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F Baum)
If references are entirely missing, you can add them using this form.