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

Re: st: panel data manipulation

From   "Clive Nicholas" <>
Subject   Re: st: panel data manipulation
Date   Sat, 14 Aug 2004 02:12:38 +0100 (BST)

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.

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e:
Newcastle University  |
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index