Announcement

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

  • xthdidregress - Understanding differing results with TWFE (Woolridge) & AIPW (Callaway and Sant'Anna) - Stata 18

    I want to select the most robust model for a paper on economic growth after an exogenous event, affecting some units starting all during the same year. I have read through both papers below but am seeking a clear explanation as to why I get differing results and which is more robust to the issues in my analysis.(Pardon the vagueness; I do not want to be recognized by reviewers).

    A toy version (arbitrarily altered subset) of my data and models are below, and these behave like my real data: classic TWFE and DiD are fairly similar to AIPW (positive, significant) but distinct from Wooldridge's TWFE (positive, insignificant) accounting for heterogeneity when I use RHS controls (log_pop). They are more similar without controls, but they are important. There is, indeed, heterogeneity in the control variable levels (log_pop). Potentially important factors: the treatment_event should have a positive effect on the control log_pop (I want to isolate growth beyond this); the control cases are matched using pre-treatment trends.

    My reading of the papers below left me with the impression that Wooldridge is more specifically concerned with unit heterogeneity. I understood more about the staggered timing heterogeneity in Callaway and Sant'Anna than I did about unit heterogeneity; however the quote below from Stata makes it seems like the latter is more likely to be a robust method, generally.

    Under what circumstances should we expect differing results between the two methods? Based on my data and analysis, which should I expect to perform better?

    xthdidregress provides four estimators: TWFE, outlined in Wooldridge (2021); RA, IPW, and
    AIPW, outlined in Callaway and Sant’Anna (2021). ... For example, RA and
    TWFE model the outcome; IPW models the treatment; and AIPW models both. If the model for the
    outcome is correctly specified, RA and TWFE are best, with TWFE being more efficient. If the treatment
    model is correctly specified, IPW should be best. AIPW models both treatment and outcome. If at
    least one of the models is correctly specified, it provides consistent estimates.
    Code in next comment:
    Last edited by David Ray McCoy; 06 Jan 2025, 04:32.

  • #2
    Reproducible examples (sorry for length):

    Code:
    clear all
    input id    year    treat_group    treatment_event    log_gdp    log_pop
    1    2006    0    0    20.728    10.874
    1    2007    0    0    20.735    10.914
    1    2008    0    0    20.754    10.951
    1    2009    0    0    20.711    11.019
    1    2010    0    0    20.777    11.095
    1    2011    0    0    20.816    11.135
    2    2006    0    0    20.536    10.651
    2    2007    0    0    20.539    10.662
    2    2008    0    0    20.526    10.672
    2    2009    0    0    20.518    10.692
    2    2010    0    0    20.548    10.661
    2    2011    0    0    20.538    10.671
    3    2006    1    0    20.001    10.253
    3    2007    1    0    19.816    10.28
    3    2008    1    0    19.904    10.306
    3    2009    1    1    20.023    10.355
    3    2010    1    1    20.033    10.425
    3    2011    1    1    20.038    10.457
    4    2006    1    0    20.411    10.707
    4    2007    1    0    20.401    10.699
    4    2008    1    0    20.49    10.691
    4    2009    1    1    20.549    10.676
    4    2010    1    1    20.534    10.657
    4    2011    1    1    20.59    10.649
    5    2006    1    0    24.021    13.641
    5    2007    1    0    24.055    13.66
    5    2008    1    0    24.024    13.678
    5    2009    1    1    24.027    13.713
    5    2010    1    1    24.114    13.836
    5    2011    1    1    24.14    13.897
    6    2006    1    0    20.466    10.352
    6    2007    1    0    20.375    10.362
    6    2008    1    0    20.503    10.371
    6    2009    1    1    20.515    10.388
    6    2010    1    1    20.539    10.414
    6    2011    1    1    20.616    10.426
    7    2006    1    0    20.42    10.642
    7    2007    1    0    20.454    10.666
    7    2008    1    0    20.437    10.69
    7    2009    1    1    20.44    10.734
    7    2010    1    1    20.492    10.791
    7    2011    1    1    20.479    10.817
    8    2006    1    0    20.765    10.888
    8    2007    1    0    20.74    10.903
    8    2008    1    0    20.817    10.916
    8    2009    1    1    20.78    10.943
    8    2010    1    1    20.748    10.979
    8    2011    1    1    20.776    10.995
    9    2006    1    0    20.03    10.085
    9    2007    1    0    20.036    10.105
    9    2008    1    0    20.049    10.123
    9    2009    1    1    20.022    10.158
    9    2010    1    1    20.083    10.205
    9    2011    1    1    20.16    10.227
    10    2006    1    0    19.947    10.186
    10    2007    1    0    19.936    10.215
    10    2008    1    0    19.931    10.242
    10    2009    1    1    19.945    10.293
    10    2010    1    1    19.974    10.359
    10    2011    1    1    19.93    10.388
    11    2006    1    0    20.554    10.673
    11    2007    1    0    20.48    10.689
    11    2008    1    0    20.605    10.704
    11    2009    1    1    20.632    10.732
    11    2010    1    1    20.634    10.772
    11    2011    1    1    20.604    10.79
    12    2006    1    0    19.844    10.185
    12    2007    1    0    19.859    10.206
    12    2008    1    0    19.905    10.225
    12    2009    1    1    19.928    10.262
    12    2010    1    1    19.933    10.31
    12    2011    1    1    20.018    10.332
    13    2006    1    0    20.086    10.343
    13    2007    1    0    20.09    10.365
    13    2008    1    0    20.074    10.385
    13    2009    1    1    20.074    10.423
    13    2010    1    1    20.219    10.654
    13    2011    1    1    20.429    10.764
    14    2006    1    0    21.211    11.178
    14    2007    1    0    21.232    11.197
    14    2008    1    0    21.238    11.214
    14    2009    1    1    21.202    11.248
    14    2010    1    1    21.204    11.293
    14    2011    1    1    21.219    11.314
    15    2006    1    0    19.91    9.893
    15    2007    1    0    19.912    9.909
    15    2008    1    0    19.913    9.925
    15    2009    1    1    19.972    9.954
    15    2010    1    1    20.079    9.994
    15    2011    1    1    20.187    10.012
    16    2006    1    0    19.744    9.883
    16    2007    1    0    19.697    9.897
    16    2008    1    0    19.7    9.91
    16    2009    1    1    19.708    9.936
    16    2010    1    1    19.834    9.97
    16    2011    1    1    19.831    9.985
    17    2006    1    0    19.611    10.119
    17    2007    1    0    19.612    10.139
    17    2008    1    0    19.67    10.158
    17    2009    1    1    19.686    10.194
    17    2010    1    1    19.609    10.242
    17    2011    1    1    19.641    10.265
    18    2006    0    0    20.248    11.187
    18    2007    0    0    20.272    11.205
    18    2008    0    0    20.289    11.223
    18    2009    0    0    20.25    11.256
    18    2010    0    0    20.23    11.27
    18    2011    0    0    20.225    11.285
    19    2006    0    0    20.746    11.659
    19    2007    0    0    20.681    11.673
    19    2008    0    0    20.751    11.685
    19    2009    0    0    20.736    11.708
    19    2010    0    0    20.622    11.726
    19    2011    0    0    20.644    11.736
    20    2006    0    0    19.586    10.595
    20    2007    0    0    19.552    10.615
    20    2008    0    0    19.549    10.634
    20    2009    0    0    19.843    10.67
    20    2010    0    0    19.921    10.683
    20    2011    0    0    19.937    10.698
    21    2006    0    0    21.311    11.204
    21    2007    0    0    21.095    11.216
    21    2008    0    0    21.069    11.229
    21    2009    0    0    21.14    11.252
    21    2010    0    0    21.015    11.269
    21    2011    0    0    20.887    11.28
    22    2006    0    0    20.174    10.987
    22    2007    0    0    20.14    11.003
    22    2008    0    0    20.161    11.019
    22    2009    0    0    20.078    11.048
    22    2010    0    0    20.11    11.063
    22    2011    0    0    20.157    11.076
    23    2006    0    0    20.136    11
    23    2007    0    0    20.145    11.012
    23    2008    0    0    20.21    11.024
    23    2009    0    0    20.129    11.046
    23    2010    0    0    20.132    11.064
    23    2011    0    0    20.133    11.074
    24    2006    0    0    20.682    11.317
    24    2007    0    0    20.672    11.335
    24    2008    0    0    20.653    11.353
    24    2009    0    0    20.606    11.386
    24    2010    0    0    20.581    11.4
    24    2011    0    0    20.539    11.414
    25    2006    0    0    19.581    10.48
    25    2007    0    0    19.622    10.498
    25    2008    0    0    19.673    10.515
    25    2009    0    0    19.723    10.547
    25    2010    0    0    19.723    10.561
    25    2011    0    0    19.726    10.574
    26    2006    0    0    20.605    11.507
    26    2007    0    0    20.546    11.524
    26    2008    0    0    20.578    11.54
    26    2009    0    0    20.549    11.57
    26    2010    0    0    20.56    11.585
    26    2011    0    0    20.531    11.598
    27    2006    0    0    20.309    11.333
    27    2007    0    0    20.354    11.348
    27    2008    0    0    20.374    11.362
    27    2009    0    0    20.369    11.388
    27    2010    0    0    20.496    11.404
    27    2011    0    0    20.5    11.416
    28    2006    0    0    21.155    11.853
    28    2007    0    0    21.203    11.854
    28    2008    0    0    21.207    11.855
    28    2009    0    0    21.257    11.856
    28    2010    0    0    21.151    11.881
    28    2011    0    0    21.226    11.883
    29    2006    0    0    21.977    11.849
    29    2007    0    0    21.961    11.873
    29    2008    0    0    21.735    11.897
    29    2009    0    0    21.881    11.939
    29    2010    0    0    21.803    11.949
    29    2011    0    0    21.956    11.967
    30    2006    0    0    21.183    11.186
    30    2007    0    0    21.024    11.202
    30    2008    0    0    21.094    11.217
    30    2009    0    0    21.045    11.245
    30    2010    0    0    20.902    11.261
    30    2011    0    0    20.911    11.273
    31    2006    0    0    19.828    10.644
    31    2007    0    0    19.866    10.657
    31    2008    0    0    19.986    10.67
    31    2009    0    0    19.848    10.694
    31    2010    0    0    19.816    10.711
    31    2011    0    0    19.927    10.722
    32    2006    0    0    19.712    10.568
    32    2007    0    0    19.713    10.58
    32    2008    0    0    19.702    10.591
    32    2009    0    0    19.739    10.612
    32    2010    0    0    19.676    10.63
    32    2011    0    0    19.614    10.64
    33    2006    0    0    21.594    12.122
    33    2007    0    0    21.641    12.146
    33    2008    0    0    21.693    12.168
    33    2009    0    0    21.661    12.209
    33    2010    0    0    21.649    12.22
    33    2011    0    0    21.585    12.237
    34    2006    0    0    22.54    12.11
    34    2007    0    0    22.404    12.126
    34    2008    0    0    22.542    12.142
    34    2009    0    0    22.367    12.172
    34    2010    0    0    22.293    12.187
    34    2011    0    0    22.505    12.2
    35    2006    0    0    19.041    9.918
    35    2007    0    0    19.015    9.915
    35    2008    0    0    19.066    9.912
    35    2009    0    0    19.118    9.907
    35    2010    0    0    19.08    9.935
    35    2011    0    0    19.142    9.934
    36    2006    0    0    20.237    11.241
    36    2007    0    0    20.258    11.261
    36    2008    0    0    20.324    11.281
    36    2009    0    0    20.287    11.316
    36    2010    0    0    20.256    11.329
    36    2011    0    0    20.263    11.344
    37    2006    0    0    20.648    11.7
    37    2007    0    0    20.701    11.728
    37    2008    0    0    20.752    11.754
    37    2009    0    0    20.812    11.801
    37    2010    0    0    20.758    11.81
    37    2011    0    0    20.79    11.83
    38    2006    0    0    19.938    10.98
    38    2007    0    0    19.963    10.998
    38    2008    0    0    20.055    11.015
    38    2009    0    0    20.039    11.047
    38    2010    0    0    20.063    11.062
    38    2011    0    0    20.063    11.075
    39    2006    0    0    21.586    11.904
    39    2007    0    0    21.475    11.919
    39    2008    0    0    21.419    11.932
    39    2009    0    0    21.432    11.957
    39    2010    0    0    21.415    11.974
    39    2011    0    0    21.308    11.985
    40    2006    0    0    20.247    11.101
    40    2007    0    0    20.258    11.117
    40    2008    0    0    20.223    11.133
    40    2009    0    0    20.26    11.162
    40    2010    0    0    20.242    11.177
    40    2011    0    0    20.187    11.19
    41    2006    0    0    19.524    9.593
    41    2007    0    0    19.538    9.611
    41    2008    0    0    19.586    9.628
    41    2009    0    0    19.61    9.66
    41    2010    0    0    19.5    9.674
    41    2011    0    0    19.526    9.688
    42    2006    0    0    19.358    10.289
    42    2007    0    0    19.196    10.303
    42    2008    0    0    19.236    10.317
    42    2009    0    0    19.202    10.341
    42    2010    0    0    19.153    10.358
    42    2011    0    0    19.129    10.369
    43    2006    0    0    19.2    9.468
    43    2007    0    0    19.139    9.487
    43    2008    0    0    19.191    9.505
    43    2009    0    0    19.188    9.539
    43    2010    0    0    19.219    9.577
    43    2011    0    0    19.162    9.594
    44    2006    0    0    20.169    10.189
    44    2007    0    0    19.953    10.208
    44    2008    0    0    20.008    10.227
    44    2009    0    0    19.918    10.262
    44    2010    0    0    20    10.299
    44    2011    0    0    19.971    10.316
    45    2006    0    0    20.58    10.838
    45    2007    0    0    20.486    10.86
    45    2008    0    0    20.411    10.882
    45    2009    0    0    20.428    10.923
    45    2010    0    0    20.452    10.962
    45    2011    0    0    20.533    10.982
    46    2006    0    0    20.873    11.043
    46    2007    0    0    20.8    11.07
    46    2008    0    0    20.812    11.097
    46    2009    0    0    20.906    11.147
    46    2010    0    0    20.952    11.19
    46    2011    0    0    20.996    11.214
    47    2006    0    0    20.799    10.837
    47    2007    0    0    20.763    10.862
    47    2008    0    0    20.78    10.887
    47    2009    0    0    20.733    10.934
    47    2010    0    0    20.728    10.975
    47    2011    0    0    20.687    10.997
    48    2006    0    0    19.358    9.646
    48    2007    0    0    19.325    9.639
    48    2008    0    0    19.383    9.631
    48    2009    0    0    19.683    9.617
    48    2010    0    0    19.539    9.6
    48    2011    0    0    19.557    9.592
    49    2006    0    0    18.567    9.111
    49    2007    0    0    18.575    9.118
    49    2008    0    0    18.791    9.125
    49    2009    0    0    18.497    9.138
    49    2010    0    0    18.473    9.137
    49    2011    0    0    18.538    9.141
    50    2006    0    0    19.129    9.59
    50    2007    0    0    19.122    9.603
    50    2008    0    0    19.168    9.615
    50    2009    0    0    19.098    9.639
    50    2010    0    0    19.074    9.642
    50    2011    0    0    19.108    9.653
    51    2006    0    0    20.867    11.42
    51    2007    0    0    20.873    11.433
    51    2008    0    0    20.889    11.446
    51    2009    0    0    20.896    11.469
    51    2010    0    0    20.951    11.473
    51    2011    0    0    20.964    11.485
    52    2006    0    0    19.197    9.623
    52    2007    0    0    19.168    9.627
    52    2008    0    0    19.203    9.631
    52    2009    0    0    19.359    9.638
    52    2010    0    0    19.441    9.633
    52    2011    0    0    19.424    9.636
    53    2006    0    0    19.41    10.261
    53    2007    0    0    19.375    10.276
    53    2008    0    0    19.423    10.291
    53    2009    0    0    19.479    10.318
    53    2010    0    0    19.481    10.323
    53    2011    0    0    19.546    10.337
    54    2006    0    0    18.619    8.807
    54    2007    0    0    18.656    8.817
    54    2008    0    0    18.563    8.827
    54    2009    0    0    18.505    8.846
    54    2010    0    0    18.508    8.846
    54    2011    0    0    18.587    8.856
    55    2006    0    0    19.43    10.23
    55    2007    0    0    19.395    10.245
    55    2008    0    0    19.4    10.26
    55    2009    0    0    19.378    10.287
    55    2010    0    0    19.388    10.292
    55    2011    0    0    19.453    10.305
    56    2006    0    0    18.663    9.119
    56    2007    0    0    18.709    9.13
    56    2008    0    0    18.734    9.141
    56    2009    0    0    18.692    9.163
    56    2010    0    0    18.66    9.165
    56    2011    0    0    18.724    9.175
    57    2006    0    0    18.8    9.367
    57    2007    0    0    18.82    9.352
    57    2008    0    0    18.854    9.337
    57    2009    0    0    18.735    9.309
    57    2010    0    0    18.685    9.284
    57    2011    0    0    18.747    9.268
    58    2006    0    0    18.804    9.397
    58    2007    0    0    18.784    9.407
    58    2008    0    0    18.792    9.416
    58    2009    0    0    18.739    9.434
    58    2010    0    0    18.751    9.435
    58    2011    0    0    18.812    9.444
    59    2006    0    0    18.731    9.424
    59    2007    0    0    18.747    9.435
    59    2008    0    0    18.706    9.445
    59    2009    0    0    18.718    9.466
    59    2010    0    0    18.735    9.467
    59    2011    0    0    18.781    9.477
    60    2006    0    0    18.998    9.432
    60    2007    0    0    18.944    9.364
    60    2008    0    0    19.059    10.123
    60    2009    0    0    18.88    10.071
    60    2010    0    0    18.94    10.145
    60    2011    0    0    19.001    10.126
    61    2006    0    0    21.96    11.57
    61    2007    0    0    21.574    11.592
    61    2008    0    0    21.622    11.612
    61    2009    0    0    21.605    11.648
    61    2010    0    0    21.789    11.63
    61    2011    0    0    21.713    11.644
    62    2006    0    0    18.59    9.754
    62    2007    0    0    18.613    9.758
    62    2008    0    0    18.64    9.761
    62    2009    0    0    18.622    9.748
    62    2010    0    0    18.666    9.762
    62    2011    0    0    18.702    9.765
    63    2006    0    0    18.473    9.344
    63    2007    0    0    18.476    9.357
    63    2008    0    0    18.504    9.371
    63    2009    0    0    18.478    9.395
    63    2010    0    0    18.518    9.39
    63    2011    0    0    18.606    9.4
    64    2006    0    0    19.289    10.055
    64    2007    0    0    19.36    10.071
    64    2008    0    0    19.353    10.085
    64    2009    0    0    19.308    10.113
    64    2010    0    0    19.353    10.098
    64    2011    0    0    19.349    10.104
    65    2006    0    0    18.529    9.429
    65    2007    0    0    18.591    9.449
    65    2008    0    0    18.635    9.468
    65    2009    0    0    18.629    9.502
    65    2010    0    0    18.634    9.483
    65    2011    0    0    18.656    9.495
    66    2006    0    0    18.938    9.713
    66    2007    0    0    18.964    9.733
    66    2008    0    0    18.985    9.752
    66    2009    0    0    19.023    9.788
    66    2010    0    0    18.994    9.768
    66    2011    0    0    18.991    9.783
    67    2006    0    0    20.028    10.832
    67    2007    0    0    20.046    10.843
    67    2008    0    0    20.057    10.854
    67    2009    0    0    20.041    10.874
    67    2010    0    0    20.005    10.876
    67    2011    0    0    20.037    10.885
    68    2006    0    0    20.923    11.918
    68    2007    0    0    20.986    11.93
    68    2008    0    0    21.074    11.941
    68    2009    0    0    21.136    11.96
    68    2010    0    0    21.029    11.943
    68    2011    0    0    21.119    11.952
    69    2006    0    0    19.843    9.451
    69    2007    0    0    19.495    9.458
    69    2008    0    0    19.551    9.465
    69    2009    0    0    19.618    9.478
    69    2010    0    0    19.73    9.461
    69    2011    0    0    19.497    9.467
    70    2006    0    0    20.526    11.13
    70    2007    0    0    20.468    11.13
    70    2008    0    0    20.716    11.13
    70    2009    0    0    20.796    11.13
    70    2010    0    0    20.657    11.116
    70    2011    0    0    20.717    11.116
    71    2006    0    0    21.044    11.683
    71    2007    0    0    20.888    11.69
    71    2008    0    0    21.062    11.696
    71    2009    0    0    21.081    11.707
    71    2010    0    0    21.138    11.691
    71    2011    0    0    21.144    11.696
    72    2006    0    0    20.809    11.263
    72    2007    0    0    20.823    11.273
    72    2008    0    0    20.787    11.279
    72    2009    0    0    20.606    11.29
    72    2010    0    0    20.598    11.256
    72    2011    0    0    20.632    11.261
    73    2006    0    0    19.21    10.118
    73    2007    0    0    19.196    10.112
    73    2008    0    0    19.269    10.119
    73    2009    0    0    19.243    10.132
    73    2010    0    0    19.279    10.101
    73    2011    0    0    19.321    10.107
    74    2006    0    0    20.705    11.641
    74    2007    0    0    20.754    11.647
    74    2008    0    0    20.816    11.652
    74    2009    0    0    20.732    11.661
    74    2010    0    0    20.8    11.626
    74    2011    0    0    20.844    11.622
    75    2006    0    0    20.143    10.929
    75    2007    0    0    20.158    10.935
    75    2008    0    0    20.107    10.94
    75    2009    0    0    20.043    10.972
    75    2010    0    0    20.026    10.938
    75    2011    0    0    19.979    10.942
    76    2006    0    0    20.461    11.204
    76    2007    0    0    20.437    11.208
    76    2008    0    0    20.423    11.213
    76    2009    0    0    20.384    11.222
    76    2010    0    0    20.42    11.186
    76    2011    0    0    20.421    11.189
    77    2006    0    0    19.468    9.44
    77    2007    0    0    19.349    9.45
    77    2008    0    0    19.48    9.459
    77    2009    0    0    19.586    9.477
    77    2010    0    0    19.414    9.489
    77    2011    0    0    19.42    9.498
    78    2006    0    0    19.849    9.653
    78    2007    0    0    19.807    9.662
    78    2008    0    0    19.783    9.671
    78    2009    0    0    19.947    9.689
    78    2010    0    0    19.639    9.7
    78    2011    0    0    19.715    9.709
    79    2006    0    0    19.738    10.164
    79    2007    0    0    19.784    10.18
    79    2008    0    0    19.73    10.196
    79    2009    0    0    19.66    10.225
    79    2010    0    0    19.761    10.247
    79    2011    0    0    19.764    10.263
    80    2006    0    0    20.262    9.775
    80    2007    0    0    20.237    9.78
    80    2008    0    0    20.281    9.784
    80    2009    0    0    20.619    9.793
    80    2010    0    0    20.325    9.788
    80    2011    0    0    20.363    9.792
    81    2006    0    0    20.765    10.684
    81    2007    0    0    20.79    10.693
    81    2008    0    0    20.781    10.701
    81    2009    0    0    20.854    10.716
    81    2010    0    0    20.754    10.72
    81    2011    0    0    20.776    10.728
    82    2006    0    0    19.434    9.174
    82    2007    0    0    19.304    9.175
    82    2008    0    0    19.481    9.175
    82    2009    0    0    19.402    9.175
    82    2010    0    0    19.421    9.152
    82    2011    0    0    19.474    9.15
    83    2006    0    0    19.702    9.648
    83    2007    0    0    19.741    9.66
    83    2008    0    0    19.758    9.672
    83    2009    0    0    19.692    9.695
    83    2010    0    0    19.679    9.708
    83    2011    0    0    19.652    9.719
    84    2006    0    0    19.567    9.573
    84    2007    0    0    19.651    9.595
    84    2008    0    0    19.692    9.615
    84    2009    0    0    19.606    9.653
    84    2010    0    0    19.577    9.672
    84    2011    0    0    19.574    9.691
    85    2006    0    0    20.813    10.69
    85    2007    0    0    20.812    10.701
    85    2008    0    0    20.767    10.712
    85    2009    0    0    20.701    10.734
    85    2010    0    0    20.74    10.746
    85    2011    0    0    20.734    10.749
    86    2006    0    0    21.831    10.73
    86    2007    0    0    21.806    10.751
    86    2008    0    0    21.763    10.77
    86    2009    0    0    21.661    10.807
    86    2010    0    0    21.721    10.836
    86    2011    0    0    21.609    10.855
    87    2006    0    0    21.679    10.922
    87    2007    0    0    21.709    10.938
    87    2008    0    0    21.563    10.953
    87    2009    0    0    21.574    10.981
    87    2010    0    0    21.4    11.01
    87    2011    0    0    21.836    11.024
    88    2006    0    0    22.676    12.263
    88    2007    0    0    22.738    12.286
    88    2008    0    0    22.795    12.308
    88    2009    0    0    22.685    12.349
    88    2010    0    0    22.772    12.397
    88    2011    0    0    22.779    12.42
    89    2006    0    0    21.74    12.543
    89    2007    0    0    21.776    12.561
    89    2008    0    0    21.772    12.578
    89    2009    0    0    21.755    12.609
    89    2010    0    0    21.756    12.641
    89    2011    0    0    21.781    12.659
    90    2006    0    0    21.411    12.127
    90    2007    0    0    21.454    12.142
    90    2008    0    0    21.429    12.156
    90    2009    0    0    21.41    12.183
    90    2010    0    0    21.437    12.207
    90    2011    0    0    21.487    12.222
    end 
    
    xtset id year
    * 1. "Classic" TWFE & Event Study
    xtreg log_gdp i.treatment_event log_pop i.year , fe
    xtdidregress (log_gdp log_pop) (treatment_event) , group(id) time(year) 
    estat grangerplot, nodraw verbose
    estat grangerplot
    * 2. Calhoun & Sant'Anna AIPW DiD
    xthdidregress aipw (log_gdp log_pop) (treatment_event) , group(id) 
    estat aggregation
    * 3. Wooldridge TWFE DiD
    xthdidregress twfe (log_gdp log_pop) (treatment_event) , group(id) hettype(time)
    estat aggregation

    Comment


    • #3
      David, please show the Stata output. If the estimates are similar but they differ in their precision, that's more easily explained than if the estimates differ in practically important ways.

      Having said that, I'm not sure why you're using the hettype(time) option in the extended TWFE. If you want to make the results comparable, you should drop this option so the effects are estimated separately by treatment cohort and time period.

      Comment


      • #4
        Code:
        xthdidregress aipw (log_gdp log_pop) (treatment_event) , group(id)
        Heterogeneous-treatment-effects regression              Number of obs    = 540
                                                                Number of panels =  90
        Estimator:       Augmented IPW
        Panel variable:  id
        Treatment level: id
        Control group:   Never treated
        
                                            (Std. err. adjusted for 90 clusters in id)
        ------------------------------------------------------------------------------
                     |               Robust
        Cohort       |       ATET   std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                year |
               2007  |   .0025336   .0175682     0.14   0.885    -.0318995    .0369667
               2008  |   .0102605    .015251     0.67   0.501    -.0196308    .0401519
               2009  |   .0230131   .0151939     1.51   0.130    -.0067663    .0527926
               2010  |    .072187   .0215461     3.35   0.001     .0299574    .1144165
               2011  |   .0932267   .0303568     3.07   0.002     .0337285    .1527249
        Code:
        xthdidregress twfe (log_gdp log_pop) (treatment_event) , group(id) //hettype(time)
        
        Heterogeneous-treatment-effects regression        Number of obs    = 540
                Number of panels =  90
        Estimator:       Two-way fixed effects
        Panel variable:  id
        Treatment level: id
        Control group:   Never treated
        Heterogeneity:   Cohort and time
        
        (Std. err.    adjusted    for 90 clusters in id)
                
        Robust
        Cohort              ATET   std. err.      t    P>t    [95% conf. interval]
                
        year
        2009      .010132   .0273639     0.37    0.712    -.0442395    .0645034
        2010     .0371997   .0416416     0.89    0.374    -.0455413    .1199407
        2011     .0485145   .0471431     1.03    0.306    -.045158    .1421869

        Comment


        • #5
          In the dataex, there is only one treated cohort (all in year 2009).

          Comment


          • #6
            Thanks in advance for taking a look Jeff Wooldridge (it's an honor!). The output from the four models is below (with some minor copying and pasting to improve readability). I used the "hettype(time)" option in the the final model, because all treatment units are treated in 2009, as George Ford alluded, I believe. I checked and the output is nearly identical without "hettype(time)", as expected.

            I did not notice until I just checked, but all the coefficients for the event study lead and lags are identical for the three other types of xthdidregress (ra, ipw, and aipw) are identical, which I suppose answers part of my question in that "xthdidregress aipw" model (#3 below) does not add additional robustness for unit heterogeneity beyond "ra" and "ipw". This makes me question the language quoted from the Stata manual above, which led me to believe AIPW dealt with unit heterogeneity (and not just group). I will update the language of my questions after some additional information.

            Additional info: the influence of heterogeneity in Model 4 seems to stem from the control variable log_pop. When that control is left out, there is a strong and significant effect on treated units in post-treatment years. The treatment in this case is a rapid, exogenous onset from a mass migration/refugee event to a subset units that are border cities. These border/treated cities have heterogeneity in population level, and the treatment, itself, has an effect on log_population in the post-treatment years for treatment units, notably in smaller population units. I mentioned that the control cases are matched based on pre-treatment trends for all three variables (but not on levels, although levels are similar).

            I'll reiterate the original questions in light of the above:

            What if anything is the AIPW model doing to account for unit heterogeneity (beyond staggered groups not present here)? Is the AIPW model inappropriate here?

            Given that Model 4 is interacting log_pop with post-treatment time dummies (if I understand the model) and log_pop, itself, is affected by the treatment, could including log_pop result in bias? Or is Model 4 still the correctly specified model and I simply fail to reject the null hypothesis after considering heterogeneity? How could I explain the importance of heterogeneity for a reader in this scenario?

            Code:
             
            (1) (2) (3) (4)
            TWFE Classic_DiD AIPW TWFE Woolridge
            main
            treatment_event=0 0.000
            (.)
            treatment_event=1 0.069*** 0.069***
            (0.017) (0.017)
            log_pop 0.028 0.028
            (0.074) (0.096)
            year=2006 0.000 0.000
            (.) (.)
            year=2007 -0.024* -0.024** 0.003
            (0.011) (0.009) (0.018)
            year=2008 0.004 0.004 0.010
            (0.011) (0.011) (0.015)
            year=2009 -0.011 -0.011 0.023 0.010
            (0.012) (0.016) (0.015) (0.027)
            year=2010 -0.017 -0.017 0.072*** 0.037
            (0.012) (0.016) (0.022) (0.042)
            year=2011 0.007 0.007 0.093** 0.046
            (0.013) (0.017) (0.030) (0.048)
            Constant 19.913*** 19.913***
            (0.780) (1.016)
            Last edited by David Ray McCoy; 08 Jan 2025, 14:08.

            Comment

            Working...
            X