Announcement

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

  • How to tell the number of firms used in an event study with areg?

    Hey there,
    I am new here, so I hope I ll do this request correctly. (If not, let me know (; )
    I am currently doing an event study on the stocks of fashion firms and the collapse of the Rana Plaza factory.
    The regression is working, but I can't find out how to make stata tell me the number of firms it is basing the regression on.

    This is my code:
    gen sampleselection = (all==1)
    bys firmevent: egen sampelselection2= max(sampleselection)
    keep if sampelselection2==1

    quietly xi: areg rs i.firmevent|index all, absorb(firmevent) cluster(date)
    outreg2 using output.xls, keep(all) addtext(Firm-Event FE, YES, Firm-Event Index Return Interactions, YES) label replace ctitle(model 1, all events & all firms)


    all = name of the event
    index = lead index

    I would be so grateful to anybody who can help.
    Greetings from Germany
    Julia

  • #2
    I find your question unclear (please read the FAQ), but here is my guess; you want the following saved result:
    "e(k_absorb) number of absorbed categories"
    see the bottom of the following help file for what is saved by the -areg- command:
    Code:
    h areg

    Comment


    • #3
      Ju(L)ia:
      welcome to this forum.
      In addition to Rich's helpful advice, that I do share, three, points, in my opinion, are worth addressing:
      1) why using the -xi:- prefix, that is totally redundant with the -fvvarlist- notation?
      2) how could you use the pipe (|) sign in your code, when it is not legal with -areg-?
      Code:
      . areg price i.foreign mpg|trunk, abs(rep78)
      '|' not allowed in varlist
      r(198);
      3) the number of absorbed groups is also reported in the -areg- output:
      Code:
      . areg price i.foreign mpg trunk, abs(rep78)
      
      Linear regression, absorbing indicators          Number of obs     =        69
      Absorbed variable: rep78                         No. of categories =         5
                                                       F(3, 61)          =      7.61
                                                       Prob > F          =    0.0002
                                                       R-squared         =    0.2829
                                                       Adj R-squared     =    0.2007
                                                       Root MSE          = 2603.9028
      
      ------------------------------------------------------------------------------
             price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
           foreign |
          Foreign  |   1285.113   934.6183     1.38   0.174    -583.7714    3153.998
               mpg |  -271.2618   73.23691    -3.70   0.000     -417.708   -124.8155
             trunk |   75.04772   96.38955     0.78   0.439    -117.6951    267.7906
             _cons |   10484.82   2570.992     4.08   0.000       5343.8    15625.83
      ------------------------------------------------------------------------------
      F test of absorbed indicators: F(4, 61) = 0.347               Prob > F = 0.845
      
      .
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X