Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: changing names from UPPER to lower case

From   Maarten buis <>
To   stata list <>
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: )

Hope this helps,

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


*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index