Data I/O commands
While Stata, of course, comes with a serviceable set of I/O commands, I have found room for improvement. I will present a set of user-written commands for using, saving, appending, and merging. Highlights include wildcards in file paths, drastically reducing the amount that needs to be typed; options to change the working directory to match the file specified; quick reloading of the current analysis file; saving partial datasets; using/appending sets of multiple data files; transparent use of Stat/Transfer within all commands to use, save, append, and merge from and/or to other formats such as SAS and Excel; maintaining a “recent file” list through the command interface; and eliminating the irritating irregular need for quotes. The merge command, in particular, has an even larger set of advantages, which together with the above advantages means never having to open and fiddle with a file before merging it. These advantages include merging on disparately named variables; automatic conversion of string/numeric variables; case-insensitive merging; renaming variables added to the current data; automatic tabulation of the (labeled) _merge variable or summarized merge information with automatic deletion of the _merge variable; automatic deletion of matched or unmatched records; merging with a single record from a multiply-matching merge file; and true many-to-many merging.
Year of publication: |
2008-11-16
|
---|---|
Authors: | Lowy, Elliott |
Institutions: | Stata User Group |
Saved in:
Saved in favorites
Similar items by person
-
Lowy, Elliott, (2007)
-
Lowy, Elliott, (2007)
-
Lowy, Elliott, (2008)
- More ...