Announcement

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

  • Staggered Diff-in-Diff

    Hi all, I have a quesiotn about staggered DiD and would appreciate your help.

    I am running two models about the adoption of two different policies on two different datasets. The treatment group in each model is a set of firms, each firm belongs to only one treatment group.

    In both models, I control for time FE, Treatment group FE, and firm FE. My question is why in the first model all Treatment group FE and most of firm FEs will be kept in the model after estimation, but in the second one, all treatment group FEs will be omitted because of collinearity.
    The collinearity happens because of the inclusion of firm FE. If it is a matter of collinearity, it must be the same in both cases. Why isn't it? To me, the structure of the model in both cases is exactly the same...

    Models are attached below. cik is firms' identifier.

    Model 1:
    Code:
     
    . reg Y Dit i.fyear i.Treatment_Group i.cik, vce(cluster cik)
    
    note: 794367.cik omitted because of collinearity.
    note: 861884.cik omitted because of collinearity.
    note: 907471.cik omitted because of collinearity.
    note: 1022079.cik omitted because of collinearity.
    note: 1048286.cik omitted because of collinearity.
    note: 1059556.cik omitted because of collinearity.
    note: 1267238.cik omitted because of collinearity.
    note: 1310067.cik omitted because of collinearity.
    note: 1341318.cik omitted because of collinearity.
    note: 1481792.cik omitted because of collinearity.
    note: 1688568.cik omitted because of collinearity.
    note: 1944013.cik omitted because of collinearity.
    
    Linear regression                               Number of obs     =      1,170
                                                    F(13, 113)        =          .
                                                    Prob > F          =          .
                                                    R-squared         =     0.8999
                                                    Root MSE          =     .09011
    
                                      (Std. err. adjusted for 114 clusters in cik)
    ------------------------------------------------------------------------------
                 |               Robust
    Y            | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             Dit |   .0280684   .0125965     2.23   0.028     .0031124    .0530243
                 |
           fyear |
           2011  |  -.0027005   .0091129    -0.30   0.768    -.0207548    .0153539
           2012  |  -.0128803   .0131201    -0.98   0.328    -.0388737     .013113
           2013  |  -.0208039   .0157418    -1.32   0.189    -.0519913    .0103836
           2014  |  -.0127386   .0166187    -0.77   0.445    -.0456633     .020186
           2015  |  -.0176427   .0164005    -1.08   0.284     -.050135    .0148495
           2016  |  -.0158391   .0183057    -0.87   0.389     -.052106    .0204279
           2017  |  -.0099859    .018531    -0.54   0.591    -.0466991    .0267273
           2018  |  -.0109125   .0206403    -0.53   0.598    -.0518045    .0299796
           2019  |  -.0041595   .0199703    -0.21   0.835    -.0437242    .0354052
           2020  |   .0054283   .0201148     0.27   0.788    -.0344228    .0452794
           2021  |  -.0034748   .0226715    -0.15   0.878    -.0483912    .0414415
           2022  |   .0336464   .0554807     0.61   0.545    -.0762708    .1435637
           2023  |   .0835204   .0492043     1.70   0.092    -.0139621    .1810029
                 |
    Treatment_Group |
           2010  |   .5461846   .0067165    81.32   0.000     .5328781    .5594911
           2011  |   .6583245   .0067165    98.02   0.000      .645018     .671631
           2012  |   .8085951   .0077708   104.06   0.000     .7931996    .8239905
           2013  |    .129572   .0067165    19.29   0.000     .1162654    .1428785
           2014  |   .2153763   .0067165    32.07   0.000     .2020697    .2286828
           2015  |   .5402799   .0067165    80.44   0.000     .5269734    .5535864
           2016  |   .2684022   .0075935    35.35   0.000     .2533582    .2834462
           2017  |   .7142837   .0088295    80.90   0.000     .6967908    .7317766
           2018  |   .6121213   .0075935    80.61   0.000     .5970773    .6271653
           2019  |   .5901068   .0067165    87.86   0.000     .5768002    .6034133
           2020  |  -.0752191   .0079652    -9.44   0.000    -.0909997   -.0594386
           2021  |   .6172731   .0074409    82.96   0.000     .6025313    .6320149
                 |
             cik |
           4457  |   .1513102   .0042898    35.27   0.000     .1428114     .159809
           4962  |  -.4800946   .0035268  -136.13   0.000    -.4870818   -.4731074
           7536  |  -.4374177   .0011647  -375.56   0.000    -.4397252   -.4351102
           8670  |   .3191581   .0027083   117.84   0.000     .3137925    .3245237
           8868  |  -.0477404    .009486    -5.03   0.000    -.0665339   -.0289469
           9389  |   .3618816   .0100514    36.00   0.000     .3419678    .3817953
          12927  |    .451338    .001124   401.55   0.000     .4491112    .4535648
          14272  |   .3447496    .006826    50.51   0.000     .3312262    .3582731
         ..................
    .....................
       
         789019  |   .4309862    .006826    63.14   0.000     .4174628    .4445097
         794367  |          0  (omitted)
         860748  |   .8515967   .0050526   168.55   0.000     .8415865    .8616069
         861884  |          0  (omitted)
         885639  |  -.3109489   .0069952   -44.45   0.000    -.3248077   -.2970901
         894671  |   .7622711   .0081693    93.31   0.000     .7460862     .778456
         902274  |  -.2795213    .003396   -82.31   0.000    -.2862493   -.2727933
         907471  |          0  (omitted)
           4980  |   .2634658    .001124   234.40   0.000     .2612389    .2656926
        1022079  |          0  (omitted)
        1024478  |   .2228396    .006826    32.65   0.000     .2093161     .236363
        1032208  |  -.0950473    .006826   -13.92   0.000    -.1085708   -.0815239
        1035002  |   .5532175    .006826    81.05   0.000     .5396941     .566741
        1039828  |   .7657814    .006826   112.19   0.000     .7522579    .7793048
        1041061  |    .111915    .006826    16.40   0.000     .0983915    .1254384
        1048286  |          0  (omitted)
        1049782  |   .6380497   .0036464   174.98   0.000     .6308255    .6452738
        1059556  |          0  (omitted)
        1105705  |   .0289986   .0037411     7.75   0.000     .0215868    .0364105
        1122304  |   .2095745   .0059417    35.27   0.000     .1978029    .2213461
        1122976  |  -.3695582   .0054198   -68.19   0.000    -.3802959   -.3588205
        1124198  |   .1101359   .0036464    30.20   0.000     .1029117      .11736
        1135971  |   .7953738   .0128755    61.77   0.000     .7698652    .8208824
        1143068  |   .8521349   .0149329    57.06   0.000     .8225502    .8817197
        1267238  |          0  (omitted)
        1275283  |   .8132747   .0117016    69.50   0.000     .7900916    .8364578
        1310067  |          0  (omitted)
        1326160  |   .1657204   .0047975    34.54   0.000     .1562158    .1752251
        1331875  |  -.1925357   .0047975   -40.13   0.000    -.2020404   -.1830311
        1341318  |          0  (omitted)
        1373835  |   .2368121   .0117016    20.24   0.000      .213629    .2599951
        1378946  |   .5941125   .0077564    76.60   0.000     .5787456    .6094794
        1481792  |          0  (omitted)
        1604028  |   .5350732   .0036464   146.74   0.000     .5278491    .5422973
        1688568  |          0  (omitted)
        1944013  |          0  (omitted)
                 |
           _cons |   .1599165   .0190851     8.38   0.000     .1221054    .1977276
    ------------------------------------------------------------------------------
    
    .
    and Model 2:

    Code:
     
    . reg Y Dit  i.fyear i.cik i.Treatment_group , vce(cluster cik)
    
    note: 2000.breachyear omitted because of collinearity.
    note: 2006.breachyear omitted because of collinearity.
    note: 2007.breachyear omitted because of collinearity.
    note: 2008.breachyear omitted because of collinearity.
    note: 2010.breachyear omitted because of collinearity.
    note: 2011.breachyear omitted because of collinearity.
    note: 2012.breachyear omitted because of collinearity.
    note: 2013.breachyear omitted because of collinearity.
    note: 2014.breachyear omitted because of collinearity.
    note: 2015.breachyear omitted because of collinearity.
    note: 2016.breachyear omitted because of collinearity.
    note: 2017.breachyear omitted because of collinearity.
    note: 2018.breachyear omitted because of collinearity.
    note: 2019.breachyear omitted because of collinearity.
    note: 2020.breachyear omitted because of collinearity.
    note: 2021.breachyear omitted because of collinearity.
    note: 2022.breachyear omitted because of collinearity.
    
    Linear regression                               Number of obs     =      2,648
                                                    F(13, 371)        =          .
                                                    Prob > F          =          .
                                                    R-squared         =     0.9235
                                                    Root MSE          =     .08574
    
                                      (Std. err. adjusted for 372 clusters in cik)
    ------------------------------------------------------------------------------
                 |               Robust
    Y     | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             Dit |   .0261452   .0111887     2.34   0.020      .004144    .0481464
                 |
           fyear |
           2011  |   -.016803   .0066192    -2.54   0.012    -.0298189    -.003787
           2012  |  -.0184841   .0071518    -2.58   0.010    -.0325472    -.004421
           2013  |  -.0128866   .0095036    -1.36   0.176    -.0315742     .005801
           2014  |  -.0118556   .0100748    -1.18   0.240    -.0316664    .0079552
           2015  |  -.0117674   .0116588    -1.01   0.313    -.0346931    .0111582
           2016  |   -.012376   .0121683    -1.02   0.310    -.0363036    .0115516
           2017  |  -.0209325   .0128857    -1.62   0.105    -.0462706    .0044057
           2018  |  -.0225738   .0131857    -1.71   0.088    -.0485019    .0033544
           2019  |  -.0260919    .013323    -1.96   0.051      -.05229    .0001062
           2020  |  -.0184946   .0131037    -1.41   0.159    -.0442613    .0072722
           2021  |  -.0379104    .014371    -2.64   0.009    -.0661692   -.0096516
           2022  |   .0400507   .0323113     1.24   0.216    -.0234855    .1035868
           2023  |   .0709154   .0336523     2.11   0.036     .0047422    .1370886
                 |
             cik |
           3146  |   .6446921   .0083495    77.21   0.000     .6282738    .6611104
           4281  |  -.2054449   .0009324  -220.34   0.000    -.2072784   -.2036115
           6845  |   .4167743   .0015272   272.89   0.000     .4137712    .4197775
           7084  |  -.0832123   .0023131   -35.98   0.000    -.0877607    -.078664
           7789  |   .6237169   .0039269   158.83   0.000     .6159951    .6314388
           8146  |   .4724508   .0038127   123.92   0.000     .4649536     .479948
           8818  |  -.1622675   .0008506  -190.76   0.000    -.1639402   -.1605948
           8868  |  -.2456957   .0055676   -44.13   0.000    -.2566438   -.2347477
           9092  |   .1093303   .0035347    30.93   0.000     .1023798    .1162808
           9389  |   .1798618   .0035329    50.91   0.000     .1729148    .1868087
           9892  |    -.03082   .0074153    -4.16   0.000    -.0454013   -.0162387
          10795  |   .0053476   .0037296     1.43   0.152    -.0019861    .0126814
    
       
       ..................................
    ..................................
    .
     ..
    .
    
        1556727  |   .3657087   .0053536    68.31   0.000     .3551814    .3762359
        1571508  |   .6557614   .0088063    74.47   0.000     .6384449     .673078
        1598428  |   .0544575   .0030316    17.96   0.000     .0484962    .0604188
        1602658  |   .5810628   .0037107   156.59   0.000     .5737661    .5883595
        1604028  |   .3623358   .0030316   119.52   0.000     .3563745    .3682971
        1616318  |   .4820546   .0042532   113.34   0.000     .4736912     .490418
        1624794  |   .1532119   .0069113    22.17   0.000     .1396216    .1668021
        1635718  |   .2698516   .0038399    70.28   0.000     .2623009    .2774024
        1636286  |   .6456811   .0055899   115.51   0.000     .6346892     .656673
        1646383  |   .3994345   .0042532    93.91   0.000     .3910711    .4077979
        1666700  |   .0895345    .005811    15.41   0.000     .0781078    .1009612
        1674335  |  -.2330401   .0069113   -33.72   0.000    -.2466304   -.2194498
        1681206  |   .3586259   .0069113    51.89   0.000     .3450356    .3722162
        1688568  |  -.1637423   .0047005   -34.84   0.000    -.1729852   -.1544994
        1711269  |   .5271598   .0053257    98.98   0.000     .5166875     .537632
        1746109  |   .6480332   .0065936    98.28   0.000     .6350678    .6609987
        1750735  |   .6112961   .0065936    92.71   0.000     .5983306    .6242615
        1754226  |   .6160019   .0079011    77.96   0.000     .6004653    .6315385
        1760965  |  -.1186772    .005811   -20.42   0.000    -.1301038   -.1072505
        1766368  |   .5841928   .0121748    47.98   0.000     .5602525    .6081332
        1767837  |   .4929741   .0096057    51.32   0.000     .4740857    .5118626
        1790982  |   -.166308   .0065936   -25.22   0.000    -.1792735   -.1533426
        1849867  |   .4509114   .0156182    28.87   0.000        .4202    .4816227
        1850398  |   .4301086   .0170735    25.19   0.000     .3965356    .4636816
                 |
     Treatment_Group|
           2000  |          0  (omitted)
           2006  |          0  (omitted)
           2007  |          0  (omitted)
           2008  |          0  (omitted)
           2010  |          0  (omitted)
           2011  |          0  (omitted)
           2012  |          0  (omitted)
           2013  |          0  (omitted)
           2014  |          0  (omitted)
           2015  |          0  (omitted)
           2016  |          0  (omitted)
           2017  |          0  (omitted)
           2018  |          0  (omitted)
           2019  |          0  (omitted)
           2020  |          0  (omitted)
           2021  |          0  (omitted)
           2022  |          0  (omitted)
                 |
           _cons |   .3442386   .0088063    39.09   0.000      .326922    .3615551
    ------------------------------------------------------------------------------
    
    .
    Thank you,
    Mahtab

  • #2
    Why not just use xtdidregress to solve this problem? I'm sure there's a reason as Stata suggests, but why not use the native command designed for this

    Comment


    • #3
      The treatment group is redundant once you have firm fixed effects because a firm can only be treated first at one time period. Stata has rules about which collinear variables are dropped, and it usually drops the last set of collinear variables. Notice how in the first regression, i.cik is last and in the second, i.Treatment_group is last. The problem is easily solved by dropping i.Treatment_group because these are redundant. It won't change you estimate on Dit.

      Comment


      • #4
        Jeff Wooldridge Thank you so much. That was really helpful. Since you are here, I have one more general question and would appreciate your comment. I come across good papers that control for both industry FE and firm FE. Chances are high in practice one group of those variables will be omitted during estimation. Is it a professional practice to show that the researcher is trying to take account of any unobserved
        heterogeneity no matter what happens during estimation? Why do people show both industry and firm FE on the tables?

        Thank you,
        Mahtab

        Comment

        Working...
        X