This file is part of IDEAS, which uses RePEc data


[ Papers | Articles | Software | Books | Chapters | Authors | Institutions | JEL Classification | NEP reports | Search | New papers by email | Author registration | Rankings | Volunteers | FAQ | Blog | Help! ]

How to face lists with fortitude

Author info | Abstract | Publisher info | Download info | Related research | Statistics
Author Info
Nicholas J. Cox () (University of Durham)

Additional information is available for the following registered author(s):

Abstract

Among various structures in Stata for cycling through lists (whether lists of variable names, numbers, or arbitrary strings) are foreach and forvalues, introduced in Stata 7 in 2001, and for, introduced in Stata 3.1 in 1992, and revised in 5.0 (1997) and 6.0 (1999). Typically, each member of the list supplied is substituted in turn in one or more commands within the structure being used. This is a tutorial specifically designed for Stata users who do little or no Stata programming. Despite being labelled as programming commands, these structures have many uses either interactively or within do files and help impart both speed and system to repetitive tasks. One prerequisite for understanding foreach and forvalues is the idea of a local macro, of which the most difficult part is understanding the strange name. With that idea assimilated, it is relatively easy to see how foreach and forvalues can be used in a large variety of problems. Despite being newer than for in Stata, these structures are recommended over for to new users, or to more experienced users who have made little or no use of any of these to date. For completeness, there is also comparison with for, and some comments on their relative merits.

Download Info
To download:

If you experience problems downloading a file, check if you have the proper application to view it first. Information about this may be contained in the File-Format links below. In case of further problems read the IDEAS help page. Note that these files are not on the IDEAS site. Please be patient as the files may be large.

File URL: http://fmwww.bc.edu/RePEc/usug2002/fortitude.pdf
File Format: application/pdf
File Function:
Download Restriction: no

Publisher Info
Paper provided by Stata Users Group in its series United Kingdom Stata Users' Group Meetings 2002 with number 14.

Download reference. The following formats are available: HTML (with abstract), plain text (with abstract), BibTeX, RIS (EndNote, RefMan, ProCite), ReDIF
Length:
Date of creation: 11 May 2002
Date of revision:
Handle: RePEc:boc:usug02:14

Contact details of provider:
Postal: Administration Building, 140 Commonwealth Avenue, Chestnut Hill MA 02467
Phone: 617-552-3670
Fax: 617-552-2308
Email:
Web page: http://www.stata.com/meeting/8uk
More information through EDIRC

For technical questions regarding this item, or to correct its listing, contact: (Christopher F Baum).

Related research
Keywords:

This paper has been announced in the following NEP Reports:

Statistics
Access and download statistics

Did you know? Each page is provided with a technical contact, in case something is not right with the supplied information. See under "publisher info".

This page was last updated on 2010-2-7.


This information is provided to you by IDEAS at the Department of Economics, College of Liberal Arts and Sciences, University of Connecticut using RePEc data on a server sponsored by the Society for Economic Dynamics.