Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: problem with macro in a loop


From   Leila Ben Aoun <[email protected]>
To   [email protected]
Subject   Re: st: problem with macro in a loop
Date   Wed, 10 Jun 2009 10:46:21 +0200

Thanks to Martin Weiss, Tirthankar Chakravarty and Nick Cox for their
replies. I used the solution from  Tirthankar Chakravarty with local
instead og global and it worked.
 /* begin */
 sysuse auto, clear
 local M_1 "gear_ratio displacement turn"
 local M_2 "length weight trunk"
 local M_3 "headroom rep78 mpg"

 forv i=1/3 {
        logit foreign `M_`i''
        estimates store logit_M_`i' , title(M_`i')
 }
 /* end */
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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