Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: managing changing variable names, types over multiple files


From   Paul Burkander <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index