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

Re: st: Changing Variable Name


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: Changing Variable Name
Date   Tue, 06 Dec 2005 10:04:24 +0900

Alice Dobson wrote:

I use stata 9.1
In order to change the variable names I go back to the master excel file
which contains the data, change the names there and use stat transfer to
transfer and overwrite the existing data file in Stata.
Is there a way to change the variable names in the Stata data editor or
using some command?

--------------------------------------------------------------------------------

Is what you want to change the variable names, yet keep the variable names
coordinated between the external master source and the working Stata
datasets?  You might not need to do that if you keep your Stata renaming
activities documented in a do-file--you can always then trace back which
Stata variable refers to what Excel master data source column.

Otherwise, it might be possible to use -odbc , exec()- with a couple of SQL
statements.  Microsoft Excel is not particularly SQL capable, so renaming
column headers in Excel spreadsheets from within Stata this way still might
be more trouble than it's worth.

If your Excel version is 2003, a more accessible option might be to convert
your master data source to Excel XML format and work directly with that from
Stata 9.1.

Because of Excel's popularity, it is ubiquitous and therefore convenient for
sharing data with colleagues.  But Excel and similar spreadsheet software
really are intended for different purposes than use as a master data
repository.  So, if your working environment permits, I recommend to eschew
Excel altogether for this purpose and keep master data sources in some other
manner.

Joseph Coveney

*
*   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