Statalist The Stata Listserver


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

Re: st: -outreg- in a loop


From   "Dimitriy V. Masterov" <dvmaster@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: -outreg- in a loop
Date   Mon, 18 Sep 2006 07:45:31 -0400

I would do something like this if you want your regressions bundled together:

local append "replace"

foreach X in x y z {;
reg a `X;
outreg using "D:/filename.out", title("Reg of a on `X'") bdec(4)
coefastr se 3aster addnote("Note here") `append';
local append "append";
};

If you want them separately, do

local append "replace"

foreach X in x y z {;
reg a `X;
outreg using "D:/`X'.out", title("Reg of a on `X'") bdec(4) coefastr
se 3aster addnote("Note here") `append';
local append "append";
};

The problem with using a backslash in the path name is that it has
special meaning when combined with a single quote. It means don't
expand the macro, which is why you're running into a problem.

DVM
*
*   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