Announcement

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

  • ttest event study for cumulative abnormal returns

    Hi guys, I am currently conducting an event study regarding a natural disaster (panel data, long form, firmid, date). I have collected returns for multiple stocks, created event windows, pre event windows and so on. Ive also calculated cumulative abnormal returns (CAR) for my event window (0,5) and want to do a ttest to test for significance ( if CARs are different from zero). I calculated a reliable test statistic manually, by using the formula for a ttest. Now I want to use the ttest command, because it is better regarding a good overview, p-values and so on.

    The variable cumulative abnormal return shows the CARs if matched with the event window, otherwise the variable cumulative abmnormal return is empty (.) for all dates except the event window.

    I tried:

    ttest cumulative_abnormal_return, by(firmid)


    that does not work, because firm id is divided in 70 groups. I have teid many other commands also but that did not work either so I wanted to aske someone in this forum if they got an idea.


    best regards


    I am using stata16

  • #2
    Lukas:
    welcome to this forum.
    What about:
    Code:
    regress y i.firmid, vce(cluster firmid)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo, thank you for your quick reply!
      unfortunately the code you provided does not work for what i want to extract. I think I need to explain my problem better. Thanks for your efforts! I have attached som PNGs now, so its easier to understand my data.
      Its panel data (firmid, date). for each of the 70 ids, I have daily stock returns and the fama and french returns for my event study.

      I calculated stock returns and constructed the estimation window( 1 for the 250 days prior the event and otherwise 0). I have constructed 7 event windows also, to calculate abnormal returns (1 for the event window days and otherwise 0).
      As you see in picture 3, every CAR variable (cumulative abnormal return) contains the computed value for the event day and is 0 otherwise.

      Now i want to test the specific CARs, to check if they are different from zero. I tried different solutions, but nothing worked because i couldn't specifiy the by() after the test command (must be two groups)

      Does anyone have an idea how to ttest the CARs (for each firmid individually)? Ive calculated test statistics manually, but thats really laborious... there is no p-value computed as well. Regarding a good overview, a test command would be great.


      Thanks a lot!

      best regards

      Lukas
      Click image for larger version

Name:	Bildschirmfoto 2023-01-23 um 12.15.34.png
Views:	1
Size:	557.0 KB
ID:	1698295
      Click image for larger version

Name:	Bildschirmfoto 2023-01-23 um 12.16.40.png
Views:	1
Size:	444.6 KB
ID:	1698296
      Click image for larger version

Name:	Bildschirmfoto 2023-01-23 um 12.17.22.png
Views:	1
Size:	550.3 KB
ID:	1698297

      Comment


      • #4
        Lukas:
        set aside the FAQ recommendation about not posting screenshots but using CODE delimiters instead, what was your -ttest- code that did not work as expected? Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          I first tried with dataex, but the overview wasn't really useful. Next time I will post dataex CODE first.

          For example I tried :

          ttest cumulative_abnormal_return1 if event_window1==1, by()

          but the by() varible must contain 2 groups, but i got 70 (if i use by(firmid))

          kind regards

          Lukas



          Comment


          • #6
            my target is to extract a table where I have the tested Cars as well as the p-value for the cars for all 70 firmids.

            Comment


            • #7
              Lukas:
              what about:
              Code:
              bysort event_window*:regress depvar indepvars if event_window*!=0
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X