Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: managing changing variable names, types over multiple files


From   Paul Burkander <paul@burkander.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: managing changing variable names, types over multiple files
Date   Fri, 10 Jun 2011 14:54:29 -0400

Hi all,

I'm working with data that cover several years, with a separate file
for each year.  Unfortunately, the names and types of variables
sometimes change from year to year, making it difficult to append all
the files.  There are a large number of variables, so it's difficult
to check for changes by hand.  Also, we'll be getting more years in
the future, so I'd like to, as much as possible, automate a system
that catalogs variable names and types.

I'm envisioning a system where we have a macro with the names of all
the files, then loop over each file, capture all the variable names
and types, and dump it into a master variable attributes file.  I'm
imagining a different variable for each row/attribute, so there'd be a
2007varname and a 2008vartype, for instance.  There would also be a
mastervarname for what we want the variable to me.  Each row would
correspond to the variable whose name may or may not change over time.

Does this seem like a reasonable way to automate this?  Do any of you
have any other ideas?  are there any user written programs that can
aid in this process?

I'd greatly appreciate any suggestions!

Paul

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index