Hi to everyone!
I am writing an article with use of event study. Unfortunately I am new to Stata and experience a lot of difficulties with this program.
I ve used this link https://dss.princeton.edu/online_hel...udy.html#clean as benchmark.
So what I have. Let's say that I have trial for 20 companies at first. So everything goes right with estimation if returns and event windows.
The problem (or I would better say my lack of knowledge) arises in testing market model.
As far as I am concerned I need market returns for such procedure. I ve downloaded S&P500. But I am kind of lost about how should I match it to my data. I mean every firm have their own date set.
Of course I can do it by hands and fit copy.past by firm individually but it seems really inefficient when my sample will go much more larger than just 20 firms.
Can anyone give me an advice?
I am really sorry if this question is super stupid, but I am so lost at my Stata skills that I do not know what else should I do.
I am attaching my current code
*format
format date %td
format edate %td
*calculating event windows
sort company_id date
by company_id: gen datenum=_n
by company_id: gen target=datenum if date==edate
egen td=min(target), by(company_id)
drop target
gen dif=datenum-td
by company_id: gen event_window=1 if dif>=-5 & dif<=5
egen count_event_obs=count(event_window), by(company_id)
by company_id: gen estimation_window=1 if dif<-30 & dif>=-60
egen count_est_obs=count(estimation_window), by(company_id)
replace event_window=0 if event_window==.
replace estimation_window=0 if estimation_window==.
tab company_id if count_event_obs<5
tab company_id if count_est_obs<30
drop if count_event_obs < 2
drop if count_est_obs < 30
so next step should probably be normal returns - so I wonder how to match market return with firms id.
Related Posts with event study
Would this be a good instrumental variableI am running a regression : hours worked per year= days ill per year+ age+ gender+ region + u. Would…
clad model-[variable] not found not foundwhen I use CLAD model, it always saids "[variable] not found post: above message corresponds to expr…
How to estimate marginal effects after nbreg, with multiple interaction terms and fixed effectsHi everybody. I'm trying to use margins command to estimate marginal effects for an interaction term…
Stata 10.1I am currently using Stata 15. However, some user-written commands do not work in Stata 15 and requi…
Merging datasets in Stata on long strings and less precise matching criterionIn my new blog post, I have discussed a problem that I usually encounter in merging two datasets on …
Subscribe to:
Post Comments (Atom)
0 Response to event study
Post a Comment