Dear Statalist,
I'd really appreciate any help. I'm running an event study on the princeton method (http://dss.princeton.edu/online_help...ventstudy.html). For some reason the event dates do not become visible in the stockdata.
This is a picture of a small excerpt from my data.
Thanks in advance.
I'd really appreciate any help. I'm running an event study on the princeton method (http://dss.princeton.edu/online_help...ventstudy.html). For some reason the event dates do not become visible in the stockdata.
Code:
use eventdates, clear sort company_id by company_id: gen event_id = _n joinby company_id using "stockdata.dta" egen group_id = group(company_id event_id) isid group_id date, sort save "data2useRP.dta", replace use "data2useRP.dta", clear by group_id: gen tradeday = _n by group_id: gen event_obs = event_date == date bysort group_id (event_obs): gen days = tradeday - tradeday[_N] if event_date[_N] == date[_N] gen w_event = inrange(days,-2,2) gen w_estim = inrange(days,-60,-31) by group_id: egen N_w_event = total(w_event) by group_id: egen N_w_estim = total(w_estim) drop if N_w_event < 5 drop if N_w_estim < 30
This is a picture of a small excerpt from my data.
Thanks in advance.
Comment