[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re:st:panel data manipulation
Thanks for your suggestion. Actually, I tried to create lags and leads for my explanatory variables before. When I include all the leads and lags in an equation like the one below, STATA does not even do the estimation as there is no observation.
Y_i(t)= X_i(t) +L.X_i(t)+L2.X_i(t)....+F.X_i(t)+F2.X_i(t)..F8.X_i(t)
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?
Strategy & Business Economics Group
Sauder School of Business
The University of British Columbia
Caglar Kamu wrote:
> I have a fairly long unbalanced panel which is set by tsset id year. I am
> trying to estimate a pooled linear model within the time period 1987-1997
> such as below.
> Y_i(t) = X_i(t) + X_i1987 + X_i1988+....+X_i1997
> i:1...N while t:1987..1997
> How should I manipulate the variables such that I can include all the past
> and future explanatory variables in the regression above?
Create dummy variables for your year terms if you haven't already.
For your explanatory variables, use the -l.- operator to create lagged terms
. gen lagvar=l.var
and the -f.- operator to create lead terms
. gen leadvar=f.var
I hope this helps.
* For searches and help try: