Speaking Stata: How to face lists with fortitude
Abstract. 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.
View all articles by this author:
Nicholas J. Cox
View all articles with these keywords:
foreach, forvalues, for, lists, local macros, substitution first
Download citation: BibTeX RIS
Download citation and abstract: BibTeX RIS
|