Statalist


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

st: simple reg


From   "Nirina F" <fstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: simple reg
Date   Thu, 4 Oct 2007 13:07:49 -0400

Hello all,

I would very much appreciate your help on this.

With the code below, I would have regressions run one by one like: reg
a x1 and then reg a x2  until reg a z3 and then reg b x1 and so on.

But what I would like is for it to run :

reg a $x, reg a $x $y, reg a $x $y  $z and then the same for b etc...
Could anyone help on how to program it please.

global x  "x1 x2 x3 x4 x5 x6 x7"
global y  "y1 y2 y3 y4 y5 y6 y7 y8 y9"
global z "z1 z2 z3"

local yis "a b c d e f g h i g k  "
local xis "$x $y $z"

foreach y in `xis'{
foreach x in `yis'{

local v= "replace"
local n=1
	reg `x'  `y'

local v="append"
local n=`n'+1
outreg2 using res100407, `v' br e(all) seeout
}
}
Many thanks in advance
Nirina
*
*   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