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

st: Re: lags and leads


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: lags and leads
Date   Sat, 14 Aug 2004 08:29:52 -0400

On Aug 14, 2004, at 2:33 AM, Caglar wrote:

Even if the above equation were estimated, this equation would not give me coefficients on the variables from the regression

Y_i(t) = X_i(t) + X_i1987 + X_i1988+....+X_i1997

i:1...N while t:1987..1997

I wonder if there is any command in STATA that will include all past and future values of the explanatory variables for every cross section over the 1987-1997 time series?
I don't see that this equation makes any sense. For t=1987, you are regressing y(i,1987) on x(i,1987), x(i,1987), x(i,1988)...x(i,1997): that is, the 1987 value will appear twice in the list. (Stata will take care of this, of course, by dropping one of them). Same thing for t=1988. But what you really want to do here, it seems, is run a cross-sectional regression in which you regress all firms' y values at a point in time on values of past, present and future Xs. The easiest way to do that would be to reshape the data wide, so that X data for a given year become a variable, as do X data for a given year. Then you can regress the variable named y_1987 (which will have values for each firm) on the entire set of X values (one varable per year), and do that again for y_1988, ... with a foreach or forvalues loop.

Kit

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