Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: programming loops for regressions


From   "Martin Weiss" <martin.weiss@uni-tuebingen.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: programming loops for regressions
Date   Mon, 7 Jul 2008 23:34:54 +0200

If your dataset is -aorder-ed , you could simply say

foreach var of varlist var1 - varn{
	reg var0 `var'
}


 In the special case you are describing, you could even say

forv i=1/n{
	reg var0 var`i'
}

Take a look at -ssc d estout- and the eststo prefix to conveniently assemble
your results for further processing...


HTH
Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of emanuele
canegrati
Sent: Monday, July 07, 2008 11:32 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: programming loops for regressions


Hi Stata users,





do you know if there are routines to run regressions automatically?


I mean if I have an independent variable, say var0, n dependent variables
and I want to run n regressions (i.e. reg var0 var1, reg var0 var2, ... ,
reg var0 varn) how can I write a loop which runs these n regressions?





Thank you in advance.





Kind Regards,





Emanuele




_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
*
*   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index