Announcement

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

  • -xtevent- Stata module to estimate and visualize linear panel event-study models updated on SSC

    Thanks to Kit Baum, -xtevent- 2.0.0 is now available on SSC.

    -xtevent- provides commands to estimate linear panel event-study models, create event-study plots, and conduct hypothesis tests after estimation. It implements the plotting suggestions and many of the estimators discussed in Freyaldenhoven et al. (2021).

    -xtevent- 2.0.0 adds new features:
    • Option nostaggered has been deprecated. There are new options to handle imputation of the policy variable in scenarios where it may be missing for some units or time periods. In -xtevent- 1.0.0 the default was to impute the policy variable at missing values and at the beginning and end of each timeseries in a manner consistent with staggered adoption. This default behavior has changed to not imputing the policy variable. To obtain similar results to those using -xtevent- 1.0.0 please use the option impute(stag).
    • Options for trend extrapolation when the variable is not binary
    • Bug fixes
    We are now developing -xtevent- on Github. Check the Github page to see new releases, to follow development, to report bugs, and to request features:

    https://github.com/JMSLab/xtevent

    See general information about -xtevent- in the initial post:

    https://www.statalist.org/forums/for...ailable-on-ssc

    Here's the companion paper:

    https://www.nber.org/papers/w29170

    Here's an ungated version:

    https://jorgeperezperez.com/files/EventStudy.pdf



    Jorge Eduardo Pérez Pérez
    www.jorgeperezperez.com

  • #2
    Dear Jorge Eduardo Pérez Pérez,
    Thank you very much for making this package available!

    I must be misunderstanding what xtevent does, and I am having troubles with reghdfe option. Somehow, it drops many more observations than default, and I find a large discrepancy in standard errors between reghdfe result and default.

    I installed it through
    Code:
     net install xtevent, from("https://raw.githubusercontent.com/JMSLab/xtevent/master")
    And I noticed a large discrepancy in standard errors between reghdfe result and default.
    I used the example dataset
    Code:
     *** setup
    webuse nlswork, clear * year variable has many missing observations * Create a time variable that ignores the gaps
    by idcode (year): gen time=_n
    xtset idcode time
    In particular, I compare
    Code:
    . xtevent ln_w age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure , pol(union) w(3) cluster(idcode) plot
    
    Using options panelvar and timevar from xtset
    
    No proxy or instruments provided. Implementing OLS estimator
    note: 12.time omitted because of collinearity.
    
    Linear regression, absorbing indicators             Number of obs     =    421
    Absorbed variable: idcode                           No. of categories =    373
                                                        F(19, 372)        =   5.87
                                                        Prob > F          = 0.0000
                                                        R-squared         = 0.9929
                                                        Adj R-squared     = 0.8979
                                                        Root MSE          = 0.1308
    
                                          (Std. err. adjusted for 373 clusters in idcode)
    -------------------------------------------------------------------------------------
                        |               Robust
                ln_wage | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    --------------------+----------------------------------------------------------------
               _k_eq_m4 |    .042523   .8339359     0.05   0.959    -1.597296    1.682343
               _k_eq_m3 |   .0296822   .5998528     0.05   0.961    -1.149845     1.20921
               _k_eq_m2 |  -.0793981   .4049379    -0.20   0.845    -.8756523    .7168561
               _k_eq_p0 |   .0497396   .2800496     0.18   0.859     -.500939    .6004183
               _k_eq_p1 |   .0292423   .5159146     0.06   0.955    -.9852324    1.043717
               _k_eq_p2 |  -.1286404   .7467273    -0.17   0.863    -1.596976    1.339695
               _k_eq_p3 |  -.2677541   .7636168    -0.35   0.726    -1.769301    1.233793
               _k_eq_p4 |  -.1567835   .8617116    -0.18   0.856     -1.85122    1.537653
                    age |   .0886796   .3813574     0.23   0.816    -.6612068    .8385661
                        |
            c.age#c.age |  -.0012995   .0041129    -0.32   0.752    -.0093869    .0067879
                        |
                ttl_exp |   -.162915   .5205288    -0.31   0.754    -1.186463    .8606329
                        |
    c.ttl_exp#c.ttl_exp |   .0014087   .0070491     0.20   0.842    -.0124523    .0152697
                        |
                 tenure |   .0045693   .0389143     0.12   0.907    -.0719503    .0810889
                        |
                   time |
                     6  |   .2856202   .5228734     0.55   0.585    -.7425378    1.313778
                     7  |   .5344666   .8962087     0.60   0.551    -1.227804    2.296737
                     8  |   .6918545   1.258341     0.55   0.583    -1.782498    3.166207
                     9  |    .975965   1.772744     0.55   0.582    -2.509892    4.461822
                    10  |   1.246936   2.153808     0.58   0.563    -2.988229    5.482101
                    11  |    1.41785   2.445418     0.58   0.562    -3.390725    6.226425
                    12  |          0  (omitted)
                        |
                  _cons |   1.398587   6.385553     0.22   0.827    -11.15772    13.95489
    -------------------------------------------------------------------------------------
    against

    Code:
    .. xtevent ln_w age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure , pol(union) w(3) cluster(idcode) plot reghdfe
    
    Using options panelvar and timevar from xtset
    
    No proxy or instruments provided. Implementing OLS estimator
    (dropped 350 singleton observations)
    (MWFE estimator converged in 7 iterations)
    
    HDFE Linear regression                            Number of obs   =         71
    Absorbing 2 HDFE groups                           F(  13,     22) =       4.70
    Statistics robust to heteroskedasticity           Prob > F        =     0.0007
                                                      R-squared       =     0.9406
                                                      Adj R-squared   =     0.8514
                                                      Within R-sq.    =     0.3040
    Number of clusters (idcode)  =         23         Root MSE        =     0.1331
    
                                           (Std. err. adjusted for 23 clusters in idcode)
    -------------------------------------------------------------------------------------
                        |               Robust
                ln_wage | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    --------------------+----------------------------------------------------------------
               _k_eq_m4 |    .042523   .2621444     0.16   0.873    -.5011312    .5861773
               _k_eq_m3 |   .0296822   .1885613     0.16   0.876    -.3613701    .4207344
               _k_eq_m2 |  -.0793981   .1272906    -0.62   0.539    -.3433827    .1845864
               _k_eq_p0 |   .0497396   .0880325     0.57   0.578    -.1328285    .2323078
               _k_eq_p1 |   .0292423   .1621757     0.18   0.859    -.3070895    .3655741
               _k_eq_p2 |  -.1286404   .2347307    -0.55   0.589    -.6154422    .3581613
               _k_eq_p3 |  -.2677541   .2400399    -1.12   0.277    -.7655663    .2300581
               _k_eq_p4 |  -.1567835   .2708756    -0.58   0.569    -.7185451    .4049781
                    age |   .0886796   .1198782     0.74   0.467    -.1599324    .3372917
                        |
            c.age#c.age |  -.0012995   .0012929    -1.01   0.326    -.0039808    .0013817
                        |
                ttl_exp |   -.162915   .1636261    -1.00   0.330    -.5022549    .1764249
                        |
    c.ttl_exp#c.ttl_exp |   .0014087   .0022158     0.64   0.532    -.0031867    .0060041
                        |
                 tenure |   .0045693   .0122326     0.37   0.712    -.0207995     .029938
                  _cons |   1.964052   2.039996     0.96   0.346    -2.266641    6.194746
    -------------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
          idcode |        23          23           0    *|
            time |         7           0           7     |
    -----------------------------------------------------+
    * = FE nested within cluster; treated as redundant for DoF computation
    Why does xtevent drops 350 observations only under reghdfe option??

    I would very much appreciate your response.
    Kindest,
    Hideto
    Last edited by Hideto Koizumi; 12 Jan 2023, 02:43.

    Comment

    Working...
    X