Statalist


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

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


From   "[email protected]" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Re: how to regress and outreg by year?
Date   Fri, 16 May 2008 07:40:09 -0700

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/

_____________________________________________________________________
Mensaje analizado y protegido por Telefonica Empresas
*
*   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/

Privileged, confidential or patient identifiable information may be contained in this message. This information is meant only for the use of the intended recipients. If you are not the intended recipient, or if the message has been addressed to you in error, do not read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. Instead, please notify the sender by reply e-mail, and then destroy all copies of the message and any attachments.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index