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

st: RE: common prefix to all variables


From   "Wallace, John" <John_Wallace@affymetrix.com>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: common prefix to all variables
Date   Mon, 24 May 2004 10:05:48 -0700

Check out the -renvars- ado (findit renvars).  It does exactly what you're
looking to do.

-JW

-----Original Message-----
From: Hans J. Baumgartner [mailto:hbaumgartner@diw.de] 
Sent: Monday, May 24, 2004 9:56 AM
To: statalist
Subject: st: common prefix to all variables

Hello statalist,

I would like to give all variables a common prefix.

I thought first of using unab in a foreach loop:

	unab variable : _all
	foreach x in `variablen' {
		rename `x' v_`x'
	}

Although Stata correctly unabbreviates my varlist, I cannot call this 
varlist in a foreach loop nor in a for any loop.

All suggestions are welcomed

Best wishes
Hans
*
*   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