Announcement

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

  • Creating an event month variable

    • In our model the event month (in our case a share repurchase announcement) is the month j=0. At j=6 the event took place half a year ago and at j=48 the event took place four years ago.
    • We have data on all stock repurchases in a certain time period (event date, firm identifier).
    • We have data on all monthly stock returns in the same time period (date, firm identifier).
    We want to create a variable for the event month, being j=0, 1, 2, ... , 48.

    For example: if there was a share repurchase announcement of firm A in January 2000, then we want to accomplish that at the data point of the montly stock return of firm A in January 2001, the value "12" will appear as the value for the variable event month (because at that particular moment the event took place exactly twelve months ago).

    But in order to accomplish this, STATA should recognise for every firm identifier (CUSIP) and date if and when the event took place for that specific firm, and based on that calculate how many months ago it was and then store the right value for the event month variable.

    Can anyone advise on how to do this? Much appreciated.

    p.s.:

    - For firms in our database that never had an event, the value in event month should be a missing value.

    - If within 48 months there is a second event for the same firm, the event month variable should restart counting from 0.


  • #2
    The specifics of how to do this depend on exactly what the data you are starting from consist of. If you don't already have the -dataex- command, run -ssc install dataex- and read the simple directions in -help dataex-. Then use -dataex- to post a brief example of your data (preferrably including a firm where there is a second event.) I think if you do that, someone will be able to provide concrete advice how to proceed.

    Comment

    Working...
    X