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

Re: st: Variable Name


From   Rufus Browning <[email protected]>
To   [email protected]
Subject   Re: st: Variable Name
Date   Mon, 07 Apr 2003 00:41:37 -0700

At 09:29 PM 4/6/2003 -0700, Jennifer Ng wrote:
Hi All,
I like to use excel to organize the data before I run regression.  Usually,
I prefer to use some upper case and lower case for the characters of the
variable names.  When I use the insheet
command,  the variables are all changed to lower case. It is quite
time-consuming to change them.  Is there any quick way to do it?
Thanks in advance,
Jennifer
Here are a couple of ways.

The program StatTransfer, which can be obtained from Stata Corp. or from www.stattransfer.com, will transfer Excel files into Stata format while preserving upper case characters in variable names if you tell it to do so at the Options(1) tab.

Alternatively, you could
(1) use -describe- or -ds- to obtain the list of the all-lc-varnames in Stata
(2) put the word -rename- into all the cells of the first column of an Excel worksheet,
(3) put the Stata varnames into the second column,
(4) put the list of your Excel uc/lc varnames into the third column, then
(5) paste the worksheet as unformatted text into a word processor,
(6) replace all the tabs or other mess into spaces between the terms,
(7) paste the resulting set of Stata -rename- commands into Stata's Do-File Editor, and
(8) run the do-file.

These steps go very quickly.

Rufus Browning
Public Research Institute
San Francisco State University




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