No announcement yet.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy observation to blank observations within specified time frame

    Dear all,

    I am looking for a solution to copy an announcement date to all dates within a specified time frame. This time frame ranges from -250 days to +1 day to the announcement date. My data is organized as panel data and looks like:
    ncusip Date AnnouncementDate
    10 20-7-2017 .
    10 21-7-2017 .
    10 22-7-2017 22-7-2017
    10 23-7-2017 .
    The problem is each nscusip might have more than 1 announcement dates. A command such as: bysort ncusip: egen AnnouncementDate2 = mean(AnnouncementDate) would not work therefore unfortunately. Are there any ideas to solve this problem?

    Kind regards,

    Gerwin Coljé
    Last edited by Gerwin Pieter Colje; 13 Jun 2018, 12:04. Reason: event study

  • #2
    Dear all,

    I think I have made a solution with this loop:

    forvalues i=-1(1)250 {
    by permno: replace DateAnnounced1 = DateAnnounced[_n+`i'] if DateAnnounced1==.