Statalist


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

st: Re: how to regress and outreg by year?


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: how to regress and outreg by year?
Date   Thu, 15 May 2008 08:49:18 -0400

Suggest you use estout:

webuse grunfeld,clear
keep if year < 1940
levelsof year, local(yrs)
eststo clear
foreach y of local yrs {
eststo: qui reg invest mvalue kstock if year == `y'
}
esttab

You could readily modify this to handle more years (for instance, keeping track of the count, and writing a table every five years, then clearing stored estimates).

Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


On May 15, 2008, at 02:33 , statalist-digest wrote:


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