Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Maarten buis <maartenbuis@yahoo.co.uk> |
To | stata list <statalist@hsphsun2.harvard.edu> |
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/