Statalist


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

RE: st: RE: efficiently creating 1/0 variables from existing string y/n variables


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: efficiently creating 1/0 variables from existing string y/n variables
Date   Mon, 28 Sep 2009 11:30:51 +0100

-renvars- from SJ offers various ways of renaming bunches of variables. 

Here is a more general strategy to solve your problems. -search- and/or
-findit- with keywords will find material both in official Stata and
that is user-written. In this way, you get answers quickly and do not
depend on the caprice of the list, especially with simple questions. 

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

Michael McCulloch

Thank you Martin, the pre-labeled feature of -encode- is brilliant.
Dropping the old variables will be simple.
Is there a simple way to then rename the resulting many new_variable  
names back their old title?
	e.g.: combining many of these commands into a shorter step?
	rename new_etoh etoh
	rename new_smk smk?

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