Hi,
I wish to generate a variable which contains the multiplication of the observations in bhar_r by firm_id over the range of the event window.
firm_id ranges from 1 to 952, and evt_window is a dummy variable that takes the value 1 for the observations I wish to multiply.
I tried
but it showed "product not found" so I am not sure which code to use.
If anyone could help out that would be great!
I wish to generate a variable which contains the multiplication of the observations in bhar_r by firm_id over the range of the event window.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int firm_id float(bhar_r evt_window) 1 . . 1 .9700905 . 1 1.0042186 . 1 .9722555 . 1 .9875283 . 1 .9942064 . 1 .9973919 . 1 1.0145581 . 1 .9994059 . 1 .9944378 . 1 .966991 . 1 .9875697 . 1 1.0184855 . 1 .9521099 . 1 1.0115262 . 1 1.0175655 . 1 .9871982 . 1 1.0022153 . 1 1.0117328 . 1 .9948838 . 1 1.03021 . 1 .9838227 . 1 .9647022 . 1 .9604114 . 1 1.0221143 . 1 .9964027 . 1 .9567041 . 1 .9863365 . 1 1.0203692 . 1 .9506603 . 1 1.0470716 . 1 1.013532 . 1 1.0040241 . 1 1.0193344 . 1 .9821148 . 1 1.0022254 . 1 .9911805 . 1 .9896302 . 1 .9828587 . 1 1.0339937 . 1 1.0405011 . 1 .9833869 . 1 1.0028243 . 1 1.0228416 . 1 .9542269 1 1 1.0067475 1 1 .9929196 1 1 .9965523 1 1 1.0032257 1 1 .9893942 1 1 1.0130458 1 1 1.0026551 1 1 1.0008835 1 1 1.0093392 1 1 .9823473 . 1 .9991091 . 1 1.0004455 . 1 .9975471 . 1 1.0004464 . 1 .9778872 . 1 1 . 1 1 . 1 .9866787 . 1 1.0104653 . 1 .9927665 . 1 .9956115 . 1 .9969862 . 1 .9688727 . 1 1.005732 . 1 .9910292 . 1 1.0044357 . 1 1.000598 . 1 1.0044135 . 1 1.0645237 . 1 1.0064509 . 1 .9988908 . 1 .9951046 . 1 1.0127447 . 1 1.0246899 . 1 1.0138699 . 1 .9884909 . 1 .9849897 . 1 1.0212076 . 1 .9940171 . 1 1.0016061 . 1 .9677093 . 1 1 . 1 .9833989 . 1 .9809453 . 1 .9997709 . 1 .9889438 . 1 .9955896 . 1 1.0073014 . 1 .9957183 . 1 .9822155 . 1 1.0151136 . 1 .9972054 . 1 1.0134355 . 1 1.0020688 . 1 .9792348 . end
I tried
Code:
by firm_id: gen bh_r=product bhar_r if evt_window==1
If anyone could help out that would be great!
Comment