Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: HELP DESPERATE PANEL DATA FOREACH


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: HELP DESPERATE PANEL DATA FOREACH
Date   Sun, 22 Jun 2003 15:59:28 +0100

naddiasimoes
 
> I'm regressing productivity on time for a panel of 2000 firms for
> five years. can someone tell me how can I create a macro and run a
> program with foreach, regressing this for each  firm and store the
> coefficients in a matrix?

With the obvious reservations about fitting 
a regression to subsets of five data points, 
I recommend -statsby- for this problem. 
That is, there is a wired-in command that 
makes it unnecessary to write your own here. 
If you really want a matrix, not variables, 
to store results then use -mkmat-. 

Nick 
[email protected] 
*
*   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