Announcement

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

  • Event Study based on Princeton example

    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.

    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.
    Click image for larger version

Name:	stata.PNG
Views:	1
Size:	55.9 KB
ID:	1466814




    Thanks in advance.
    Last edited by Nick Frank; 21 Oct 2018, 08:28.

  • #2
    See Robert Picard's solution : https://www.statalist.org/forums/forum/general-stata-discussion/general/1407083-event-study-with-r2000-no-observations-coding-issue .

    Comment

    Working...
    X