ADDINBY: Stata module to add in data from a disk dataset using a foreign key
Roger Newson ()
Statistical Software Components from Boston College Department of Economics
addinby is a "cleaner" alternative version of merge, designed to reduce the lines of code in Stata do-files. It adds variables and/or values to existing observations in the dataset currently in memory (the master dataset) from a Stata-format dataset stored in the file filename (the using dataset), using a foreign key of variables specified by the keyvarlist to identify observations in the using dataset. The using dataset must be sorted by the variables in the keyvarlist, and these variables must identify observations in the using dataset uniquely. Unlike -merge-, -addinby- always preserves the master dataset in its original sorting order, and does not add any merge-status variables or additional observations. However, addinby checks that the foreign key uniquely identifies observations in the using dataset, and may optionally check that there are no unmatched observations in the master dataset, and/or check that there are no missing values in the foreign key variables in the master dataset.
Requires: Stata version 11.0
Keywords: data manipulation; key; foreign key; merge (search for similar items in EconPapers)
Date: 2008-04-15, Revised 2010-04-13
Note: This module should be installed from within Stata by typing "ssc install addinby". Windows users should not attempt to download these files with a web browser.
References: Add references at CitEc
Citations: Track citations by RSS feed
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/a/addinby.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/a/addinby.sthlp help file (text/plain)
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s456931
Ordering information: This software item can be ordered from
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().