Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating non-overlapping events


From   Kaspar Dardas <kaspar.dardas@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Creating non-overlapping events
Date   Tue, 24 Nov 2009 16:08:23 +0100

Hello together,

I have the following problem. I need to create a non-overlapping event
data set. I have two date variables 1st: "eventdate" which is the
start of the event and 2nd: "postdays", which is the end of the event.
 The length of the event is exactly 20 days (which is, of course, the
difference between "eventdate" and "postdays"). If two events overlap
(which happens in trade 1 and 2, in the example below)  I only take
the first event and drop the 2nd (trade 2).
How can I do this in Stata? I have about 140000 trades, several
thousands companies etc....

trade         companyname                  name         eventdate
  postdays
1               Company A             Margetts, Rob      14-Feb-03
  06-Mar-03
2                Company A            Margetts, Rob       17-Feb-03
   09-Mar-03
3                Company A            Margetts, Rob      14-Nov-03
   04-Dec-03
4                Company A            Margetts, Rob       14-May-04
 03-Jun-04
5                 Company A           Margetts, Rob         06-Aug-04
   26-Aug-04



Many thanks for any help in advance!


Kaspar
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index