Announcement

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

  • Event Study: best commands and how to do

    I am trying to work on creating event study plots and I am curious what the best command to do this is, and any advice on how to do this. Currently, I am trying with eventdd but haven't gotten too far. I have a couple important variables:
    activemonth: This is in stata time like 2020m3, 2020m4,......
    callspermonth: This variable counts the number of child abuse welfare calls per month.

    My baseline value would be 2020m3, I think, as I am trying to estimate the effect of COVID-19 on the number of calls. I want to compare the drop in calls after COVID with the drop in similar months of the previous years. Can anyone help me think this through? Sorry, not a ton of information--thanks in advance for the help on this as I am a bit confused.

  • #2
    Can someone help me think about this some more? When I am running a two-way fixed effects model, it looks like this: Y=B*Treat + monthfe + yearfe +error. Basically, I am treating the months of April and May (right after March) of every year except 2020 as control months, while the treated months are those right after COVID actually happened. I am trying to figure out how to plot this type of thing in an event study way that basically shows the coefficient on the years before (May and April of 2019, of 2018, so on...)

    I tried making my time variable, activemonth_final, to look different. For instance, I made it =0 if March of 2020, and -1 if March of 2019, and -2 if March of 2018, and so on...then tried running:
    Code:
    eventdd callspermonth, timevar(timevar) fe
    But it doesn't seem quite right. Can you help with this? Thanks!

    Comment


    • #3
      Using -dataex- to display an example data would lead to more specific advice. For now, I assume your data are time series (you may have a panel). Below is an example.

      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input float(activemonth callspermonth)
      636 104
      637 121
      638  50
      639  55
      640  69
      641  34
      642 103
      643 111
      644 123
      645  79
      646  78
      647  22
      648  63
      649  68
      650  28
      651  68
      652  98
      653  58
      654 123
      655  54
      656  22
      657  14
      658 128
      659 142
      660  71
      661  83
      662 129
      663  89
      664  56
      665  99
      666 112
      667 125
      668  83
      669  91
      670  66
      671  69
      672  68
      673  62
      674  55
      675  71
      676  66
      677  40
      678 112
      679 107
      680  52
      681  23
      682 106
      683 109
      684  61
      685 107
      686 101
      687 125
      688  53
      689 129
      690  68
      691 149
      692  80
      693 152
      694  58
      695  74
      696 114
      697 107
      698 139
      699  58
      700  40
      701 117
      702 130
      703 103
      704 114
      705 103
      706  70
      707 123
      708  82
      709  49
      710  88
      711  71
      712 120
      713 110
      714  53
      715  63
      716 136
      717  74
      718  22
      719  98
      720  19
      721  58
      722  66
      723 242
      724 316
      725 343
      726 280
      727 381
      728 476
      729 504
      730 295
      731 288
      end
      format %tm activemonth
      
      gen year = year(dofm(activemonth))
      gen month = month(dofm(activemonth))
      
      gen d = year == 2020
      gen p = month >= 4
      
      reghdfe callspermonth c.d##ib(3).month, a(year month)
      
      mat result = (r(table)["b", "1.month#c.d".."12.month#c.d"] \ ///
                    r(table)["ll".."ul", "1.month#c.d".."12.month#c.d"])'
      svmat result, n(col)
      gen m = _n in 1/12
      
      twoway connected b m || rcap ul ll m, yline(0, lp(dash)) xlab(1/12) ///
             yti("Effects of COVID-19 on calls") xti("Months") leg(off)
      Results in red are effects before Apr and those in blue are effects after Apr. March is treated as the base month.

      Code:
         month#c.d |
                1  |  -43.14286   51.52471    -0.84   0.405    -146.0153    59.72955
                2  |         -9   51.52471    -0.17   0.862    -111.8724    93.87241
                4  |   183.5714   51.52471     3.56   0.001     80.69902    286.4438
                5  |   262.5714   51.52471     5.10   0.000      159.699    365.4438
                6  |   277.4286   51.52471     5.38   0.000     174.5562     380.301
                7  |   198.1429   51.52471     3.85   0.000     95.27045    301.0153
                8  |   297.5714   51.52471     5.78   0.000      194.699    400.4438
                9  |   407.1429   51.52471     7.90   0.000     304.2704    510.0153
               10  |   445.7143   51.52471     8.65   0.000     342.8419    548.5867
               11  |   237.8571   51.52471     4.62   0.000     134.9847    340.7296
               12  |   215.2857   51.52471     4.18   0.000     112.4133    318.1581
      The results above can be plotted as

      Click image for larger version

Name:	Graph.png
Views:	1
Size:	357.6 KB
ID:	1639055

      Comment


      • #4
        Hey Collin. Check this link, this one, or this one. Happy event studying, plenty of advancements on this in the last year and a half. Collin James

        Comment


        • #5
          Hey Collin. Check this link, this one, or this one. Happy event studying, plenty of advancements on this in the last year and a half. Collin James

          Comment

          Working...
          X