Speaking Stata: How to face lists with fortitude

Three commands in official Stata, foreach, forvalues, and for, provide structures for cycling through lists of values (variable names, numbers, arbitrary text) and repeating commands using members of those lists in turn. All these commands may be used interactively, and none is restricted to use in Stata programs. They are explained and compared in some detail with a variety of examples. In addition, a self-contained exposition is given on local macros, understanding of which is needed for use of foreach and forvalues.


Issue Date:
2002
Publication Type:
Journal Article
DOI and Other Identifiers:
pr0005 (Other)
PURL Identifier:
http://purl.umn.edu/115962
Published in:
Stata Journal, Volume 02, Number 2
Page range:
202-222
Total Pages:
21

Record appears in:



 Record created 2017-04-01, last modified 2017-08-26

Fulltext:
Download fulltext
PDF

Rate this document:

Rate this document:
1
2
3
 
(Not yet reviewed)