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

Re: st: manipulating part of a variable name.


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: manipulating part of a variable name.
Date   Mon, 05 Apr 2004 14:27:09 +0100

Dev

>>> [email protected] 04/05/04 02:16pm >>>
On Mon, 2004-04-05 at 14:13, Dev Vencappa wrote:

> local z "1986 1988 1990"
> foreach x of local z{
> gen XPRI3yr`x'=(XPRI`x'-XPRI`x'-2)
> }

You could try

foreach x of local z {
local y = `x'-2
gen XPRI3yr`x'=(XPRI`x'-XPRI`y')
}

hth, Chris.

*
*   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/


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