| From | chris wallace <[email protected]> |
| To | statalist <[email protected]> |
| Subject | Re: st: manipulating part of a variable name. |
| Date | 05 Apr 2004 14:16:50 +0100 |
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/
| © Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |