Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: How to rename variables by adding a suffix


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: How to rename variables by adding a suffix
Date   Fri, 6 Aug 2004 15:14:47 +0100

-rensfix- (user-written) was written to provide a twin 
for the lonely -renpfix- (official). 

In the same territory -renvars- is a more general tool. 

. search rename

points to these and other stuff too. 

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

Bill Rising
 
> On Aug 6, 2004, at 9:04, TEWODAJ MOGUES wrote:
> 
> > I have a simple question. How do I add a suffix to all 
> variables in my 
> > dataset. So suppose I want the variables WHEAT, MAIZE, CEREAL to be 
> > renamed to FOOD_WHEAT, FOOD_MAIZE, and FOOD_CEREAL. I can't use the 
> > command  * renpfix * because it only allows you to change 
> one suffix 
> > for another, such as to change GRAINWHEAT to FOOD_WHEAT by 
> typing the 
> > command
> >
> > renpfix grain food_
> >
> > I could do this manually, but when I want to add the suffix 
> food to, 
> > say, 80 variables that becomes tedious. Any ideas?
> >
> 
> Try searching the web resources for rensfix ... it does the same as 
> renpfix, but for the end of the names.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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