Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Keep observations in panel data
From
s <[email protected]>
To
[email protected]
Subject
st: Keep observations in panel data
Date
Tue, 18 Jan 2011 16:19:57 +0100
Dear s or S:
This sounds like
bysort id (year) : keep if subsidy == 1 & subsidy[_n+1] == 0 &
subsidy[_n+2] == 0
Nick
P.S. as a native English speaker, frequent reviewer and Editor, I
advise firmly against the English usage "a panel data", which does not
qualify as standard. (It seems mildly viral recently, but I'm not
deflected by that.)
Dear Nick,
Thanks for your help, but I am implementing your solution and it
only keep the information for the
year in which subsidy==1. I also need the information for the rest
of the years. In the example,
the data corresponding to firm 1 for the years 2001, 2002, 2003 and
2004.
id year subsidy
1 2000 0
1 2001 0
1 2002 1
1 2003 0
1 2004 0
1 2005 1
2 2000 0
2 2001 0
2 2002 1
2 2003 1
2 2004 0
2 2005 1
3 2000 1
3 2001 1
3 2002 1
Sergio
P.S. I will take note of your observation about panel data.