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

RE: st: Variable Name


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Variable Name
Date   Mon, 7 Apr 2003 10:12:05 +0100

Jennifer Ng

> 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?
 
Rufus Browning

> Here are a couple of ways.
> 
> The program StatTransfer, 

...

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

In addition, there is a purpose-built renaming 
command -renvars-, published in STB-60. That permits 
Rufus's second approach to be implemented in Stata 
with less typing. 

Nick 
n.j.cox@durham.ac.uk 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index