Try -eststo- and -esttab- from the -estout- package (-ssc describe
estout-). Example:
. sysuse auto
. keep if rep>=3
. generate year = 2007+(uniform()<.5)
. xi: bysort year: eststo: reg price mpg i.rep78
(output suppressed)
. esttab, mtitles nonumber
--------------------------------------------
2007 2008
--------------------------------------------
mpg -298.7** -227.3**
(-3.15) (-2.82)
_Irep78_4 -494.9 795.2
(-0.39) (0.82)
_Irep78_5 2315.8 335.7
(1.35) (0.28)
_cons 12948.2*** 10451.9***
(6.18) (6.48)
--------------------------------------------
N 29 30
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. eststo clear
ben
On Wed, May 14, 2008 at 6:04 PM, Ziyang Wang <[email protected]> wrote:
> Dear all,
>
> May I ask a novice question? I'm really new to Stata. I want to run regression by year and the outreg the coefficients for each year. I want to use like :
> by year: xi: areg score age education , absorb(nation), but stata tells me "by" can not be combined with xi. Anyone has good solutions? Also I don't think using by can outreg coefficients for each year.
>
> Many thanks in advance!
>
> Best,
>
> Martin
>
>
> *
> * 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/