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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Re: changing variable case


From   Phil Clayton <philclayton@internode.on.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: changing variable case
Date   Wed, 28 Nov 2012 16:05:09 +1030

If you're not sure your message has been sent correctly, please check the Statalist web archive before reposting.

If you're using Stata 12 you can simply:
rename *, lower

Prior to Stata 12 you should be able to use something like this:
foreach var of varlist * {
	rename `var' `:  display lower("`var'")'
}

For more sophisticated renaming see -help rename group- in Stata 12, or for earlier versions of Stata -findit renvars- (Nick Cox and Jeroen Weesie)

Phil

On 28/11/2012, at 3:47 PM, Michael Stewart <michaelstewartresearch@gmail.com> wrote:

> Dear Stat List user ,
> 
> I am not sue if my previous post was sent in right fashion.Hence i am
> resending the e-mail.
> I have a large dataset with approximately 600 variables. Some are
> upper case and some are lower case.I  want to convert all of  them to
> lower case. Is there a stata command to convert all variables to lower
> case.I  tried varcase_all  but it toggles between the variable cases.
> 
> 
> -- 
> Thank you ,
> Yours Sincerely,
> Mike.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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