Bookmark and Share

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]

Re: st: Keep observations in panel data


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Keep observations in panel data
Date   Tue, 18 Jan 2011 14:53:55 +0000

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.)

On Tue, Jan 18, 2011 at 2:36 PM, s <[email protected]> wrote:

> I have a panel data with the follow structure:
>
> 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
> 32000    1
> 32001    1
> 32002    1
>
> The data describe reception of subsidy from 2000 to 2005. My purpose is
> evaluate
> the subsidy effect in the two years subsequent to the reception of funds.
> Then I want only those firms
> with subsidies in T but without subsidies in t-1, t+1 and t+2. Consequently,
> in the previous
> example I will keep  only the observations of firm 1 in the period
> 2001-2004.
> How can I do this?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index