On 6/23/03 6:30 AM, "Christopher F Baum" <[email protected]> wrote:
> On Monday, June 23, 2003, at 02:33 AM, Ash wrote:
>
>> I am trying to run a SUR reg that has many equations.
>>
>> i.e.
>>
>> sureg (xret1 xmkt1) (xret2 xmkt2) (xret3 xmkt3) ...
>> (xretN xmktN),
>> corr
>>
>> Is there a way to form a variable, like "rhs", which
>> can be easily
>> set to equal (xret1 xmkt1) (xret2 xmkt2) (xret3 xmkt3)
>> ... (xretN
>> xmktN) through like a "for loop"?
>
> * sureg (xret1 xmkt1) (xret2 xmkt2) (xret3 xmkt3) ...(xretN xmktN), corr
> local rhs
> * replace with number of firms
> local nfirm 5
> forv i=1/`nfirm' {
> local rhs "`rhs' (xret`i' xmkt`i')"
> }
> di "`rhs'"
> sureg `rhs',corr
>
> Note well the lack of an equal sign in the definition of local rhs.
>
> Kit
Is this so that the local variable <rhs> exists outside of the -forvalue-
loop?
*
* 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/