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

st: RE: programming loops for regressions

From   "Martin Weiss" <>
To   <>
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...

Martin Weiss

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen

Fon: 0049-7071-2978184




-----Original Message-----
[] On Behalf Of emanuele
Sent: Monday, July 07, 2008 11:32 PM
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,


News, entertainment and everything you care about at Get it now!
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index