Announcement

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

  • Eventstudy2 command: variable date does not uniquely identify observations in the using data

    Hi all,
    I am a beginner to Stata and am trying to implement eventstudy2. I have the three datasets as per the eventstudy2 command. See extracts below:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(id date)
     1 19722
     2 16090
     3 14840
     4 17482
     5 20636
     6 16799
     7 16922
     8 17293
     9 17247
    10 17342
    end
    format %tdCCYYNNDD date

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float date double market_return
    16105 -.0032235758302995
    20690  .0016239458820888
    21403  .0042454733949306
    18612  .0007458461270442
    18658 -.0034791198532365
    17990 -.0277580454202991
    18570  .0211383465881081
    19703 -.0047738846490797
    17195  -.001274013082227
    17596  .0243282944443468
    end
    format %tdCCYYNNDD date

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float date str12 company_id float(ret id)
    16105 "DK0010181759"  .0018913386 3
    20690 "DK0010181759"  -.008723926 3
    21403 "DK0010181759" -.0020652357 3
    18612 "DK0010181759"  -.002695639 3
    18658 "DK0010181759"   .000922011 3
    17990 "DK0010181759"   .017489128 3
    18570 "DK0010181759"    .01612985 3
    19703 "DK0010181759"            0 3
    17195 "DK0010181759"   .007005032 3
    17596 "DK0010181759"    .04180083 3
    end
    format %tdCCYYNNDD date
    I am trying to run an event study using the market model:
    Code:
    eventstudy2 id date using security_returns, returns(ret) model(FM) marketfile(factor_returns) marketreturns(market_return) evwlb(-10) evwub(10) eswlb(-210) eswub(20) aarfile(output_average_abn_ret_file) carfile(output_cum_average_abn_ret_file) arfile(output_abn_ret_file) crossfile(output_cross_sec_file) diagnosticsfile(output_diag_file) graphfile(output_graph_file) car1LB(-10) car1UB(10) car2LB(-5) car2UB(5) car3LB(-2) car3UB(2) car4LB(-1) car4UB(1)
    However I get an error:
    variable date does not uniquely identify observations in the using data
    r(459);

    Just wondering if its because I have multiple event dates for the same company? For more context I have 1443 observations with 558 unique companies. I havent been able to find if this command can be used in this scenario. I have also followed the princeton tutorial on the event study but realised it lacks a complete overview on the significance tests which eventstudy2 seems to be able to offer. Any help is greatly appreciated!
Working...
X