keyby sorts the dataset currently in memory by the variables in a varlist, checking that the variables in the varlist uniquely identify the observations. This makes the variables in the varlist a primary key for the dataset in memory. If the user does not specify otherwise, then keyby also reorders the variables in the varlist to the start of the variable order in the dataset, and checks that all values of these variables are nonmissing. keybygen sorts the dataset currently in memory by the variables in a varlist, preserving the existing order of observations within each by-group, and then generates a new variable, containing the sequential order of each observation within its by-group, to form a primary key with the existing variables in the varlist. keyby and keybygen can be useful if the user combines multiple datasets using merge, which may cause a dataset in memory to become unsorted.
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.
Publisher Info
Software component provided by Boston College Department of Economics in its series Statistical Software Components with number
S456866.
Size: Programming language: Stata Requires: Stata version 10.0 Date of creation: 31 Aug 2007 Date of revision:
26 Apr 2009 Handle: RePEc:boc:bocode:s456866
Note: This module may be installed from within Stata by typing "ssc install keyby". Windows users should not attempt to download these files with a web browser. Contact details of provider: Postal: Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA Phone: 617-552-3670 Fax: +1-617-552-2308 Email: Web page: http://fmwww.bc.edu/EC/ More information through EDIRC