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

A shortcut through long loops: An illustration of two alternatives to looping over observations

Author info | Abstract | Publisher info | Download info | Related research | Statistics
Author Info
Ward Vanlaar (Traffic Injury Research Foundation, Ottawa)
Abstract

It is well known that looping over observations can be slow and should be avoided. The ob jective of this article is to discuss two alternative solutions to looping over observations that can be used to overcome a particular data-management problem of merging datasets in which unique key identifiers changed over time. The first alternative, mapch, which is introduced in this article, uses a combination of appending, indexing, and merging to solve the problem, while the second alternative uses repeated merging. Both solutions are much quicker than looping over observations. However, depending on the nature of the problem, one solution may work better than the other. It is argued that the use of such dataset-type manipulations may be suitable to overcome other data-management problems. More generally speaking, the issue that is addressed—searching for an alternative to looping over observations—may be common and illustrates the importance of balancing the costs of developing an efficient solution with the benefits accruing from that solution. Copyright 2008 by StataCorp LP.

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://www.stata-journal.com/article.html?article=dm0041
File Format:
File Function: link to article purchase
Download Restriction: no
File URL: http://www.stata-journal.com/software/sj8-4/dm0041/
File Format: text/html
File Function:
Download Restriction: no

Publisher Info
Article provided by StataCorp LP in its journal Stata Journal.

Volume (Year): 8 (2008)
Issue (Month): 4 (December)
Pages: 540-553
Download reference. The following formats are available: HTML (with abstract), plain text (with abstract), BibTeX, RIS (EndNote, RefMan, ProCite), ReDIF
Handle: RePEc:tsj:stataj:v:8:y:2008:i:4:p:540-553

Contact details of provider:
Web page: http://www.stata-journal.com/

Order Information:
Web: http://www.stata-journal.com/subscription.html

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

Related research
Keywords: mapch; appending; data management; indexing; looping; merging;

Statistics
Access and download statistics

Did you know? All top Economics journals are listed on RePEc.

This page was last updated on 2009-10-27.


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.