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]

RE: st: changing names from UPPER to lower case


From   Maarten buis <[email protected]>
To   stata list <[email protected]>
Subject   RE: st: changing names from UPPER to lower case
Date   Fri, 19 Mar 2010 16:32:47 +0000 (GMT)

--- "Lachenbruch, Peter" wrote:
> I have a number of variables in uppercase that I want to change
> to lower case.

You need to make sure that Stata only sees your new variable 
name and not the function that leads to it. In the example
below that is achieved by surrounding -upper("`var'")- with
`= and '

(This does ofcourse exactly the opposite of what you wanted
to do, but did not have an example dataset with variable names
in capitals... )

*------------- begin example -------------
sysuse auto, clear
foreach var of varlist _all {
	rename `var' `= upper("`var'")'
}
*------------- end example ---------------
( For more on how to use examples I sent to statalist see:
 http://www.maartenbuis.nl/stata/exampleFAQ.html )

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

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