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: Observations in a panel data set
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Observations in a panel data set
Date
Fri, 29 Nov 2013 10:21:32 +0000
Let's suppose you have set up the date correctly to Stata as a
quarterly date. If not, then do that. Then 1Q06 in your notation is --
as shown by
. di yq(2006,1)
184
-- quarter 184 to Stata and 1Q08 is 192.
Then you need something like
egen OK = total(qdate == 184 | qdate == 192) , by(firmid)
or
egen OK = total(inlist(qdate, 184, 192)), by(firmid)
So we score 1 every time we find -qdate- of 184 or 192. Acceptable
firms will have total scores 2, unacceptable firms 0 or 1. So
keep if OK == 2
For technique of this kind, see
http://www.stata-journal.com/article.html?article=dm0055
Nick
[email protected]
On 29 November 2013 09:35, Miguel A. Duran <[email protected]> wrote:
> I have a panel data set with about 5,000 different
> firms per quarter and 27 quarters (from 4Q2005 to 2Q2012). I want to impose
> the requirement that the firms included in the final dataset must have been
> in operation in both 1Q06 and 1Q08.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/