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! ]

The advantages of using macros with loops

Author info | Abstract | Publisher info | Download info | Related research | Statistics
Author Info
Shuk-Li Man () (Center for Sexual Health and HIV Research, University College London)
Hannah Evans (Center for Sexual Health and HIV Research, University College London)
Abstract

Using loops and macros in Stata can hold many advantages, mainly reducing the length of your do files, allowing errors to be tracked and fixed quickly and efficiently, faster running do files and providing us with re-usable programs which can be used in subsequent data analyses with similar scenarios. In this presentation we shall cover the following areas: * Storing global and local macros within Stata, with applied examples including storing categories of a variable, storing data summaries and names of files within a directory. * The commands foreach, forval and while, with applied examples. * Applied examples of how to combine macros with loops and show why this can be useful.

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://repec.org/usug2007/Stata_user_groupoct2007v5.ppt
File Format: application/x-ms-powerpoint
File Function: presentation slides
Download Restriction: no

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

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

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/13uk
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? LogEc provides statistical analysis about downloads from this service (and others).

This page was last updated on 2009-11-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.