Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Dherani, Mukesh" <M.K.Dherani@liverpool.ac.uk> |
To | "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu> |
Subject | st: loop issue |
Date | Wed, 10 Jul 2013 09:01:35 +0000 |
Dear all, I have a very basic problem in creating a loop. In my data I want to run successive logistic regression models after dropping a few variables. I have developed following code: local all var1 var2 var3 ..................... var 10 // include all variables local exclvar1 in var2 var3 ................ var10 // exclude var1 local exclvar15 in var2 var3 ................ var10 // exclude var1 & var5 foreach log in all exclvar1 exclvar15 { eststo `log' { } } logistic outcome `log' I want stata to produce three different outputs with i) all variables, ii) excluding var1 & iii) excluding var1 & var5. After this it would store the output accordingly. Stata runs the code but only produces one output with "outcome" only. Any corrections .... please. [thank you in advance] Thank you. BW, Mukesh * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/