Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: geting e-class returns in outreg2 for multiple models


From   Doug Hess <douglasrhess@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: geting e-class returns in outreg2 for multiple models
Date   Fri, 8 Jul 2011 10:49:38 -0400

Thanks, Dan. The append did work great for putting multiple models
side-by-side, which is very cool. But it still gave each model the
same LL.

Maybe I created the outreg2 loop incorrectly? I'm just figuring
looping out. Below is what I wrote; it comes after running and storing
by "est store" a dozen models. Is the issue that I need the LL to be
stored perhaps as a local macro call "LL1" , "LL2" etc. after each
model and then called up in the "addstat()" option with LL`i' ? Or
should I do an "outreg, append" after each model is run and forget the
loop? I was hoping for shorter code, but maybe pithiness isn't the
right virture here.

forvalues i=1/12 {
outreg2 [fullmodellogit`i'] using July8fullmodel, sideway  ///
		stats(coef se pval aster) addstat(LL, `e(ll)') noparen dec(3) excel append
}
	
Thank you!

-Doug

Date: Thu, 7 Jul 2011 19:56:09 -0400
From: "Miller, Daniel P" <dpmiller@bu.edu>
Subject: Re: st: geting e-class returns in outreg2 for multiple models

Hi Doug, I can't speak to the repeat of the LL, but my experience has
been that append stores the results side by side when you use the
excel option.

Dan

On Jul 7, 2011, at 6:10 PM, Doug Hess wrote:

> Hi, all.
>
> I am trying to produce a single file with multiple regressions
> side-by-side, which outreg2 does wonderfully. However, when I run the
> outreg2 code below after running the regressions and storing after
> each with -est store- using sequential names, the LL that is presented
> underneath each model is the same one (the one from the last
> regression run).  Should I also be storing the e-class returns somehow
> and then calling them up? Or will this require a -foreach- loop, which
> loses the side by side model output (I assume -append- puts things at
> the bottom?).
>
> outreg2 [model*] using July7models, sideway stats(coef se pval aster)
> addstat(LL, `e(ll)') noparen dec(3) excel word replace
>
> Thanks for any ideas.
>
> Doug
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index