Announcement

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

  • Event study (CAR)

    Hi, we are now calculating the average CAR for the Acquisitions in 1981. But we have a problem about how to incorporate when there are more than one deals for a company in this year. Stata only recognized the earliest deal. Here I attach my do file. Do we need to change some commands? Thank you in advance
    Attached Files

  • #2
    Wow, thanks for the code.
    The question you posted doesn't seem difficult. For example, you could create a new variable which defines each transaction a unique id number. Does it help?

    Comment


    • #3
      I'm presenting Lu Yang's code as we ask people to present it, directly as CODE. I don't do this kind of stuff and won't comment further, but this may be (much too) much code for most people to try to follow mentally what is going on.

      Code:
      use stockdata1981.dta, replace
      
      sort company_id date
      replace prc= abs(prc)
      by company_id: gen ret= (prc - prc[_n-1])/prc[_n-1]
      
      merge m:m company_id using eventdates1981.dta
      
      keep if _merge==3
      sort company_id date
      by company_id: gen datenum=_n
      by company_id: gen target=datenum if date==event_date
      egen td=min(target), by(company_id)
      drop target
      gen dif=datenum-td
      
      *set the window*
      by company_id: gen event_window=1 if dif>=-1 & dif<=1
      egen count_event_obs=count(event_window), by(company_id)
      by company_id: gen estimation_window=1 if dif<=-6 & dif>=-205
      egen count_est_obs=count(estimation_window), by(company_id)
      replace event_window=0 if event_window==.
      replace estimation_window=0 if estimation_window==.
      
      *list of company_ids that do not have enough observations within the event and estimate window*
      set more off
      tab company_id if count_event_obs<3
      tab company_id if count_est_obs<200
      
      *drop if not enough*
      drop if count_event_obs < 3
      drop if count_est_obs < 200
      drop count_event_obs count_est_obs
      
      *Estimating Normal Performance*
      set more off /* this command just keeps stata from pausing after each screen of output */
      
      gen predicted_return=.
      egen id=group(company_id)
      
      /* for multiple event dates, use: egen id = group(group_id) */
      forvalues i=1(1)98 { /*note: replace N with the highest value of id */
      l id company_id if id==`i' & dif==0
      reg ret market_return if id==`i' & estimation_window==1
      predict p if id==`i'
      replace predicted_return = p if id==`i' & event_window==1
      drop p
      }
      
      *Abnormal and Cumulative Abnormal Returns*
      sort id fyear
      gen abnormal_return=ret-predicted_return if event_window==1
      sort company_id
      by company_id: egen cumulative_abnormal_return = sum(abnormal_return)
      sort id
      egen evacar = mean(abnormal_return)

      Comment


      • #4
        Originally posted by Elizabeth Zhu View Post
        Wow, thanks for the code.
        The question you posted doesn't seem difficult. For example, you could create a new variable which defines each transaction a unique id number. Does it help?
        @ Elizabeth Zhu We also have thought to add some numbers to these deals. But the problem is that we also have to do this in CRSP data. It is really hard to do this manually in such a huge data sheet. Do you have any good idea about it?

        Comment

        Working...
        X