Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Announcing new item in SSC; convert_top_lines


From   David Kantor <[email protected]>
To   [email protected]
Subject   st: Announcing new item in SSC; convert_top_lines
Date   Fri, 15 Jul 2005 12:08:19 -0400

Hi Everyone,

This is a repeat of an announcement that was made on June 8. Some people at the recent NASUG meeting expressed an interest in this, but hadn't caught the original announcement.

There is [was] a new entry in SSC, convert_top_lines.

This program helps clean up the mess left when -insheet- can't gracefully handle some kinds of raw files. This can be used after -insheet-, to neaten the variable names and to assign variable labels, when the second line of the raw data file contains descriptive information suitable for labels, and these values interfered with the functioning of -insheet-.

Thanks to Kit Baum for placing this into the archives.
-- David

P.S., I should add that the effect, on -insheet-, of having these descriptive elements in line 2 of the raw file is...
the variable names are v1, v2, etc.; the values in line 1 are *not* used as variable names;
all items are taken as string, with typically very long string types (which are unnecessary, except for holding the values from line 2, which you don't want anyway);
the contents of lines 1 and 2 remain in the dataset.

(I have received many files of this form from the U.S. Census Bureau; that's what motivated me to write this program.)

convert_top_lines is intended to (partly) fix this situation. It renames the variables to the values found in line 1, and puts the values from line 2 into variable labels. It (optionally) will drop the first 2 lines. You can then follow it with -compress- and -destring-.

In looking over the package, I see ways I might improve it (and there is a typo in the .hlp file), but I am leaving it as-is for now. If you already downloaded it, there is no need to redo that, as there have been no changes, so far.

Finally, Stata Corp has indicated that they will consider the possibility of making improvements to -insheet-, such that this package will become unnecessary. Until then, it may be useful to some users.


David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index