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

Re: st: Accessing tempvars


From   Chris Wallace <[email protected]>
To   [email protected]
Subject   Re: st: Accessing tempvars
Date   Thu, 02 Sep 2004 17:21:15 +0100

Ed Blackburne <[email protected]> writes:

> I have a problem that has surely been answered in the past - I cannot,
> however, figure this out.
>
> I want to access a temporary variable with a compound name.
>
> The (obviuosly incorrect) code fragment is:
>
>
> foreach __ids of global ReS_jv2 {
> tempvar x`__ids'
> quie gen ``x'`__ids''=0
> }
Try
gen `x`__ids''=0

C.

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