Hi, I have unabalanced panel data of 1850+ companies with 26 yearly observation
xtdes
coid: 1, 2, ..., 1955 n = 1873
year: 1990, 1991, ..., 2015 T = 26
Delta(year) = 1 unit
Span(year) = 26 periods
(coid*year uniquely identifies each observation)
I have unbalanced panel with gaps
xtset coid year
panel variable: coid (unbalanced)
time variable: year, 1990 to 2015, but with gaps
delta: 1 unit
I know following command will give me balanced Panel with 15 years
by coid: gen nyear=[_N]
keep if nyear == 15
but my problem is that in my data some companies does not have data of 2015 or 2014, so in above command the companies having data from 1998 to 2013 are having Nyear=15 but i want to discard them.
My Specific Requirement,
In my balanced panel, I want to retain only those companies whose data is available from 2000 to 2015 without any gap. Do remember some of my companies does not have yearly observation of 2003 or 2015 or 2014 too.
Can someone help me in either adjusting above two command or giving a new command for my requirement?
Mubeen
Comment