Announcement

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

  • Fernando,
    This is happening while i'm using notyet, this is why is so strange..
    I've tried dropping units treated in 2001, 2002, 2003. Did not help.
    I've tried dropping units treated in 2001, 2002, 2003 + >=2013. Did not help.
    I've tried without the weights.
    This is the output for the specification with all years:


    Code:
    . csdid tx_fam    [weight=população], ivar(codigo) t(ano) gvar(gvar2)  notyet 
    (importance weights assumed)
    (importance weights assumed)
    Units always treated found. These will be ignored
    Panel is not balanced
    Will use observations with Pair balanced (observed at t0 and t1)
    ..................................................
    ..................................................
    ..................................................
    ..................................................
    ..................................................
    ..................................................
    ..................................................
    ..........xxxxxxxxxxxxxxxxxx
    Difference-in-difference with Multiple Time Periods
    
                                                    Number of obs     =      8,482
    Outcome model  : regression adjustment
    Treatment model: none
    ------------------------------------------------------------------------------
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    g2002        |
     t_2001_2002 |   377.5678   173.8201     2.17   0.030     36.88676    718.2488
     t_2001_2003 |   360.5257   170.8105     2.11   0.035     25.74334    695.3082
     t_2001_2004 |   134.4307   63.72475     2.11   0.035     9.532433    259.3289
     t_2001_2005 |   268.3764    134.952     1.99   0.047     3.875256    532.8775
     t_2001_2006 |   155.9369    75.0274     2.08   0.038     8.885851    302.9879
     t_2001_2007 |   99.18569   48.88817     2.03   0.042     3.366638    195.0047
     t_2001_2008 |   72.46971   45.51243     1.59   0.111    -16.73301    161.6724
     t_2001_2009 |   100.9737    51.5133     1.96   0.050     .0094784    201.9379
     t_2001_2010 |   118.0657   55.40784     2.13   0.033     9.468336    226.6631
     t_2001_2011 |   172.4325   84.83927     2.03   0.042      6.15056    338.7144
     t_2001_2012 |   114.2861   61.14732     1.87   0.062    -5.560476    234.1326
     t_2001_2013 |   82.46096    43.8458     1.88   0.060    -3.475234    168.3971
     t_2001_2014 |   57.88919    28.8927     2.00   0.045     1.260525    114.5178
     t_2001_2015 |   93.97636   44.11169     2.13   0.033     7.519041    180.4337
     t_2001_2016 |   209.3822   102.7519     2.04   0.042     7.992112    410.7723
     t_2001_2017 |   168.3393   81.53679     2.06   0.039     8.530121    328.1485
     t_2001_2018 |   158.3607   73.97697     2.14   0.032     13.36849    303.3529
     t_2001_2019 |   220.4794   106.2255     2.08   0.038     12.28123    428.6776
    -------------+----------------------------------------------------------------
    g2003        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |   636.4733   154.9289     4.11   0.000     332.8183    940.1283
     t_2002_2004 |   220.0944   73.02044     3.01   0.003     76.97697    363.2119
     t_2002_2005 |   258.7428   92.56601     2.80   0.005     77.31675    440.1688
     t_2002_2006 |   203.0289   87.65109     2.32   0.021     31.23591    374.8219
     t_2002_2007 |   199.8195   83.27154     2.40   0.016     36.61032    363.0288
     t_2002_2008 |    117.444   90.04424     1.30   0.192    -59.03951    293.9274
     t_2002_2009 |   186.0873   98.68687     1.89   0.059    -7.335384      379.51
     t_2002_2010 |   120.3802   31.38832     3.84   0.000     58.86021    181.9002
     t_2002_2011 |   151.1641   34.17913     4.42   0.000      84.1742    218.1539
     t_2002_2012 |   128.0283   41.41009     3.09   0.002     46.86597    209.1905
     t_2002_2013 |   138.5136   32.24072     4.30   0.000     75.32293    201.7042
     t_2002_2014 |   231.7048   96.68237     2.40   0.017     42.21086    421.1988
     t_2002_2015 |   362.3911   117.5457     3.08   0.002     132.0058    592.7765
     t_2002_2016 |   317.5082   58.99663     5.38   0.000     201.8769    433.1394
     t_2002_2017 |   282.7615   73.94874     3.82   0.000     137.8246    427.6984
     t_2002_2018 |   723.2222     307.52     2.35   0.019      120.494     1325.95
     t_2002_2019 |   785.6822   332.1037     2.37   0.018     134.7709    1436.594
    -------------+----------------------------------------------------------------
    g2004        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |   566.7824   157.9684     3.59   0.000     257.1699    876.3948
     t_2003_2005 |   444.0577   201.3408     2.21   0.027     49.43701    838.6784
     t_2003_2006 |   170.3002   99.53784     1.71   0.087    -24.79039    365.3908
     t_2003_2007 |   204.0126   130.3524     1.57   0.118    -51.47342    459.4987
     t_2003_2008 |   154.4091   100.7892     1.53   0.126    -43.13413    351.9523
     t_2003_2009 |   178.2771    103.615     1.72   0.085    -24.80461    381.3589
     t_2003_2010 |   257.9323   115.6288     2.23   0.026     31.30394    484.5606
     t_2003_2011 |   234.8115   88.08373     2.67   0.008     62.17053    407.4524
     t_2003_2012 |   218.1416   92.23389     2.37   0.018     37.36646    398.9167
     t_2003_2013 |   169.5868   80.44489     2.11   0.035     11.91776    327.2559
     t_2003_2014 |   347.2385    150.547     2.31   0.021     52.17192    642.3051
     t_2003_2015 |   415.3729   156.1613     2.66   0.008     109.3024    721.4434
     t_2003_2016 |   452.9186   165.8406     2.73   0.006      127.877    777.9602
     t_2003_2017 |   852.2044   546.3594     1.56   0.119    -218.6404    1923.049
     t_2003_2018 |    464.603   148.3925     3.13   0.002     173.7591    755.4469
     t_2003_2019 |   952.5491   561.9572     1.70   0.090    -148.8668    2053.965
    -------------+----------------------------------------------------------------
    g2005        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |   840.1644   278.7975     3.01   0.003     293.7315    1386.597
     t_2004_2006 |   646.3304   350.1179     1.85   0.065    -39.88799    1332.549
     t_2004_2007 |   455.5059    231.336     1.97   0.049     2.095594    908.9161
     t_2004_2008 |    146.401   65.04996     2.25   0.024     18.90538    273.8965
     t_2004_2009 |   59.37724   35.58226     1.67   0.095     -10.3627    129.1172
     t_2004_2010 |   144.1395   78.27356     1.84   0.066    -9.273817    297.5529
     t_2004_2011 |   70.14615   29.61979     2.37   0.018     12.09243    128.1999
     t_2004_2012 |   318.3862   227.3089     1.40   0.161     -127.131    763.9035
     t_2004_2013 |   142.7575   65.34178     2.18   0.029     14.68999    270.8251
     t_2004_2014 |   551.1382   349.2804     1.58   0.115    -133.4387    1235.715
     t_2004_2015 |   389.1617   231.2432     1.68   0.092    -64.06662      842.39
     t_2004_2016 |   459.8534   244.6636     1.88   0.060    -19.67854    939.3853
     t_2004_2017 |   336.1891   210.2576     1.60   0.110    -75.90821    748.2865
     t_2004_2018 |   566.9022   294.7028     1.92   0.054    -10.70468    1144.509
     t_2004_2019 |   781.7242   302.0511     2.59   0.010     189.7149    1373.734
    -------------+----------------------------------------------------------------
    g2006        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |    235.921   92.06046     2.56   0.010      55.4858    416.3562
     t_2005_2007 |   169.4994    91.4368     1.85   0.064    -9.713465    348.7122
     t_2005_2008 |   88.88576   62.10706     1.43   0.152    -32.84184    210.6134
     t_2005_2009 |   174.9229   102.3389     1.71   0.087    -25.65771    375.5036
     t_2005_2010 |    90.7306   61.19574     1.48   0.138    -29.21086     210.672
     t_2005_2011 |   112.9823   67.66658     1.67   0.095    -19.64177    245.6064
     t_2005_2012 |   17.86954      13.87     1.29   0.198    -9.315152    45.05424
     t_2005_2013 |   239.8981   116.0181     2.07   0.039     12.50677    467.2894
     t_2005_2014 |   86.61884    65.5258     1.32   0.186    -41.80937    215.0471
     t_2005_2015 |   68.34231   60.39026     1.13   0.258    -50.02044     186.705
     t_2005_2016 |   978.6573   878.8224     1.11   0.265    -743.8028    2701.117
     t_2005_2017 |   218.4854   128.9768     1.69   0.090    -34.30446    471.2753
     t_2005_2018 |   100.5293   98.10421     1.02   0.305    -91.75141      292.81
     t_2005_2019 |   1373.287   1034.104     1.33   0.184    -653.5192    3400.094
    -------------+----------------------------------------------------------------
    g2007        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |   878.7052   345.6658     2.54   0.011     201.2127    1556.198
     t_2006_2008 |   91.25385   52.12683     1.75   0.080    -10.91286    193.4206
     t_2006_2009 |   486.0775   260.4113     1.87   0.062    -24.31925    996.4742
     t_2006_2010 |   280.7484   114.5914     2.45   0.014     56.15335    505.3435
     t_2006_2011 |   348.3964   248.3936     1.40   0.161    -138.4461    835.2388
     t_2006_2012 |   428.7042    266.751     1.61   0.108    -94.11812    951.5265
     t_2006_2013 |   206.0279    108.434     1.90   0.057    -6.498731    418.5546
     t_2006_2014 |   62.70719   42.04683     1.49   0.136    -19.70308    145.1175
     t_2006_2015 |   421.7042   262.3267     1.61   0.108     -92.4467     935.855
     t_2006_2016 |   687.7423   286.0889     2.40   0.016     127.0183    1248.466
     t_2006_2017 |    318.986   129.7707     2.46   0.014        64.64     573.332
     t_2006_2018 |   273.5795   90.55961     3.02   0.003     96.08597    451.0731
     t_2006_2019 |   542.4943   302.3652     1.79   0.073    -50.13049    1135.119
    -------------+----------------------------------------------------------------
    g2008        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |   1251.702   357.0455     3.51   0.000     551.9061    1951.499
     t_2007_2009 |   752.4329   292.3168     2.57   0.010     179.5026    1325.363
     t_2007_2010 |   365.4911   228.4328     1.60   0.110    -82.22894    813.2112
     t_2007_2011 |   396.5014   226.9616     1.75   0.081    -48.33522     841.338
     t_2007_2012 |          0  (omitted)
     t_2007_2013 |   119.7678   95.17398     1.26   0.208    -66.76974    306.3054
     t_2007_2014 |   399.1443   231.8197     1.72   0.085    -55.21401    853.5026
     t_2007_2015 |   17.71466   18.54841     0.96   0.340    -18.63956    54.06888
     t_2007_2016 |   659.9466   265.2975     2.49   0.013     139.9731     1179.92
     t_2007_2017 |   294.4482   225.5441     1.31   0.192    -147.6101    736.5065
     t_2007_2018 |   276.7335   227.2658     1.22   0.223    -168.6992    722.1663
     t_2007_2019 |   685.8106     295.01     2.32   0.020     107.6017     1264.02
    -------------+----------------------------------------------------------------
    g2009        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |   339.8305    92.1667     3.69   0.000     159.1871     520.474
     t_2008_2010 |   391.5262   153.3112     2.55   0.011     91.04183    692.0106
     t_2008_2011 |   267.8416   149.1589     1.80   0.073    -24.50442    560.1876
     t_2008_2012 |   277.0924   187.7492     1.48   0.140    -90.88915     645.074
     t_2008_2013 |   146.6784   93.97531     1.56   0.119    -37.50979    330.8666
     t_2008_2014 |   48.02713   33.65884     1.43   0.154    -17.94298    113.9972
     t_2008_2015 |   388.4208   229.1062     1.70   0.090    -60.61923    837.4607
     t_2008_2016 |   77.85544    38.0046     2.05   0.041     3.367796    152.3431
     t_2008_2017 |   514.6739   257.0826     2.00   0.045      10.8012    1018.547
     t_2008_2018 |    300.615    187.857     1.60   0.110    -67.57795     668.808
     t_2008_2019 |   288.7477   188.6221     1.53   0.126    -80.94483    658.4401
    -------------+----------------------------------------------------------------
    g2010        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |   903.7799   329.5255     2.74   0.006     257.9218    1549.638
     t_2009_2011 |   334.2608    160.959     2.08   0.038     18.78695    649.7347
     t_2009_2012 |   418.6809   204.4193     2.05   0.041     18.02633    819.3354
     t_2009_2013 |   284.3464   176.8313     1.61   0.108    -62.23656    630.9294
     t_2009_2014 |   91.09765   58.19566     1.57   0.117    -22.96375     205.159
     t_2009_2015 |   159.2517   127.9281     1.24   0.213    -91.48283    409.9862
     t_2009_2016 |   941.0644   890.0643     1.06   0.290    -803.4296    2685.558
     t_2009_2017 |   231.5911   220.1283     1.05   0.293    -199.8524    663.0347
     t_2009_2018 |   279.0368   228.2829     1.22   0.222    -168.3896    726.4631
     t_2009_2019 |   224.0302   220.8766     1.01   0.310    -208.8799    656.9403
    -------------+----------------------------------------------------------------
    g2011        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |   446.0745   153.7441     2.90   0.004     144.7416    747.4074
     t_2010_2012 |   170.0886   113.4156     1.50   0.134    -52.20189     392.379
     t_2010_2013 |    88.0797   73.53934     1.20   0.231    -56.05475    232.2142
     t_2010_2014 |   98.18852   75.55841     1.30   0.194    -49.90324    246.2803
     t_2010_2015 |   362.9287   314.6215     1.15   0.249    -253.7181    979.5754
     t_2010_2016 |    1347.11   1058.468     1.27   0.203    -727.4486    3421.668
     t_2010_2017 |   1096.634   688.4877     1.59   0.111    -252.7768    2446.045
     t_2010_2018 |   1083.539   690.3206     1.57   0.117    -269.4645    2436.542
     t_2010_2019 |   1639.111   945.8856     1.73   0.083    -214.7907    3493.013
    -------------+----------------------------------------------------------------
    g2012        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |   540.5217    237.803     2.27   0.023     74.43628    1006.607
     t_2011_2013 |   287.0652   126.6907     2.27   0.023       38.756    535.3744
     t_2011_2014 |   534.5976   258.2227     2.07   0.038     28.49041    1040.705
     t_2011_2015 |   129.4261   88.94158     1.46   0.146    -44.89615    303.7484
     t_2011_2016 |   941.8183   540.2359     1.74   0.081    -117.0245    2000.661
     t_2011_2017 |   160.8321   61.35481     2.62   0.009     40.57889    281.0853
     t_2011_2018 |   116.3355   79.01812     1.47   0.141    -38.53721    271.2081
     t_2011_2019 |   814.1262   448.1065     1.82   0.069    -64.14639    1692.399
    -------------+----------------------------------------------------------------
    g2013        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |   1066.515   521.1227     2.05   0.041     45.13357    2087.897
     t_2012_2014 |   57.45576   33.66096     1.71   0.088    -8.518506      123.43
     t_2012_2015 |   183.6782   91.70769     2.00   0.045     3.934447     363.422
     t_2012_2016 |   449.6771    206.484     2.18   0.029     44.97587    854.3783
     t_2012_2017 |   312.8228   129.8541     2.41   0.016     58.31342    567.3321
     t_2012_2018 |   434.7591    173.016     2.51   0.012     95.65409    773.8642
     t_2012_2019 |   428.1306   209.4121     2.04   0.041     17.69037    838.5708
    -------------+----------------------------------------------------------------
    g2014        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |   1373.695   822.6856     1.67   0.095    -238.7393    2986.129
     t_2013_2015 |   899.4593   785.6534     1.14   0.252    -640.3931    2439.312
     t_2013_2016 |   273.8856     228.01     1.20   0.230    -173.0058    720.7769
     t_2013_2017 |   187.7465   123.4322     1.52   0.128    -54.17614    429.6691
     t_2013_2018 |   1953.063   1667.347     1.17   0.241    -1314.878    5221.004
     t_2013_2019 |   1458.536   1209.062     1.21   0.228    -911.1816    3828.254
    -------------+----------------------------------------------------------------
    g2015        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |   938.2109   297.9925     3.15   0.002     354.1564    1522.265
     t_2014_2016 |    288.873   129.0693     2.24   0.025     35.90184    541.8441
     t_2014_2017 |    556.219   232.0785     2.40   0.017     101.3535    1011.085
     t_2014_2018 |   420.9647   186.6932     2.25   0.024     55.05272    786.8767
     t_2014_2019 |   497.4608   294.8422     1.69   0.092    -80.41927    1075.341
    -------------+----------------------------------------------------------------
    g2016        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |   556.8952   236.0855     2.36   0.018     94.17611    1019.614
     t_2015_2017 |   372.2236   185.4088     2.01   0.045     8.829083    735.6182
     t_2015_2018 |   391.2797   238.4622     1.64   0.101    -76.09752     858.657
     t_2015_2019 |   202.3161   114.7334     1.76   0.078    -22.55729    427.1895
    -------------+----------------------------------------------------------------
    g2017        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |          0  (omitted)
     t_2016_2017 |   1577.489   727.8485     2.17   0.030     150.9319    3004.046
     t_2016_2018 |   81.39928   60.67497     1.34   0.180    -37.52149      200.32
     t_2016_2019 |   950.5142   791.7166     1.20   0.230    -601.2219     2502.25
    -------------+----------------------------------------------------------------
    g2018        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |          0  (omitted)
     t_2016_2017 |          0  (omitted)
     t_2017_2018 |   389.9271   302.5827     1.29   0.198    -203.1242    982.9784
     t_2017_2019 |   628.7884   550.6484     1.14   0.253    -450.4626    1708.039
    -------------+----------------------------------------------------------------
    g2019        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |          0  (omitted)
     t_2016_2017 |          0  (omitted)
     t_2017_2018 |          0  (omitted)
     t_2018_2019 |    1363.02   589.6503     2.31   0.021     207.3269    2518.714
    -------------+----------------------------------------------------------------
    g2020        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |          0  (omitted)
     t_2016_2017 |          0  (omitted)
     t_2017_2018 |          0  (omitted)
     t_2018_2019 |          0  (omitted)
    -------------+----------------------------------------------------------------
    g2021        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |          0  (omitted)
     t_2016_2017 |          0  (omitted)
     t_2017_2018 |          0  (omitted)
     t_2018_2019 |          0  (omitted)
    -------------+----------------------------------------------------------------
    g2022        |
     t_2001_2002 |          0  (omitted)
     t_2002_2003 |          0  (omitted)
     t_2003_2004 |          0  (omitted)
     t_2004_2005 |          0  (omitted)
     t_2005_2006 |          0  (omitted)
     t_2006_2007 |          0  (omitted)
     t_2007_2008 |          0  (omitted)
     t_2008_2009 |          0  (omitted)
     t_2009_2010 |          0  (omitted)
     t_2010_2011 |          0  (omitted)
     t_2011_2012 |          0  (omitted)
     t_2012_2013 |          0  (omitted)
     t_2013_2014 |          0  (omitted)
     t_2014_2015 |          0  (omitted)
     t_2015_2016 |          0  (omitted)
     t_2016_2017 |          0  (omitted)
     t_2017_2018 |          0  (omitted)
     t_2018_2019 |          0  (omitted)
    ------------------------------------------------------------------------------
    Control: Not yet Treated
    
    See Callaway and Sant'Anna (2021) for details
    
    . estat simple
    Average Treatment Effect on Treated
    ------------------------------------------------------------------------------
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             ATT |   284.7229   50.34089     5.66   0.000     186.0566    383.3893
    ------------------------------------------------------------------------------
    
    . estat group
    ATT by group
    ------------------------------------------------------------------------------
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
        GAverage |   321.9291   40.68171     7.91   0.000     242.1944    401.6638
           G2002 |   164.7299   68.78322     2.39   0.017     29.91731    299.5426
           G2003 |   297.8263   71.53276     4.16   0.000     157.6246    438.0279
           G2004 |   380.1999   142.8274     2.66   0.008     100.2633    660.1364
           G2005 |   393.7811   164.4146     2.40   0.017      71.5345    716.0278
           G2006 |   282.6164   164.3389     1.72   0.085    -39.48191    604.7148
           G2007 |   386.7021   114.0873     3.39   0.001     163.0951    610.3091
           G2008 |   474.5176   92.61699     5.12   0.000     292.9916    656.0436
           G2009 |   276.4826   108.1793     2.56   0.011     64.45519    488.5101
           G2010 |    386.714   195.5736     1.98   0.048     3.396844    770.0311
           G2011 |   703.5282   240.6246     2.92   0.003     231.9126    1175.144
           G2012 |   440.5903   162.3303     2.71   0.007     122.4288    758.7519
           G2013 |   419.0055   139.5929     3.00   0.003     145.4084    692.6027
           G2014 |   1024.398   747.2432     1.37   0.170    -440.1721    2488.967
           G2015 |   540.3457   143.1285     3.78   0.000     259.8189    820.8725
           G2016 |   380.6787   177.5313     2.14   0.032     32.72369    728.6336
           G2017 |   869.8008   494.9679     1.76   0.079    -100.3186     1839.92
           G2018 |   509.3577   410.8836     1.24   0.215    -295.9593    1314.675
           G2019 |    1363.02   589.6503     2.31   0.021     207.3269    2518.714
    ------------------------------------------------------------------------------
    
    . csdid_plot
    (note:  named style % 40 not found in class color, default attributes used)
    (note:  named style % 40 not found in class color, default attributes used)
    (note:  named style % 40 not found in class color, default attributes used)
    (note:  named style % 40 not found in class color, default attributes used)
    (note:  named style % 40 not found in class color, default attributes used)
    } is not a valid command name
    
    . estat event, window(-7 7)
    ATT by Periods Before and After treatment
    Event Study:Dynamic effects
    ------------------------------------------------------------------------------
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         Pre_avg |          0  (omitted)
        Post_avg |   273.4549   43.43951     6.30   0.000      188.315    358.5948
             Tp0 |   582.1241   90.09832     6.46   0.000     405.5347    758.7136
             Tp1 |    345.284   66.09798     5.22   0.000     215.7343    474.8336
             Tp2 |   256.0272   49.37236     5.19   0.000     159.2592    352.7953
             Tp3 |   231.6456   48.91327     4.74   0.000     135.7773    327.5138
             Tp4 |   210.8066   46.81882     4.50   0.000     119.0434    302.5698
             Tp5 |   181.8082   49.43796     3.68   0.000     84.91159    278.7048
             Tp6 |   199.9326   53.51262     3.74   0.000     95.04975    304.8154
             Tp7 |   180.0109    41.6218     4.32   0.000     98.43372    261.5882
    ------------------------------------------------------------------------------
    
     
    end of do-file

    Comment


    • Hi Fernando,

      Thanks for replying! Here are the results.

      Code:
      . tab year first_treat
      
                 |                 first_treat
            year |         0       2013       2014       2015 |     Total
      -----------+--------------------------------------------+----------
            2012 |   309,726     69,788     78,933     76,612 |   535,059 
            2013 |   309,726     69,788     78,933     76,612 |   535,059 
            2014 |   309,726     63,307     71,656     76,612 |   521,301 
            2015 |   309,726     59,404     65,271     69,695 |   504,096 
      -----------+--------------------------------------------+----------
           Total | 1,238,904    262,287    294,793    299,531 | 2,095,515 
      
      .
      
      . csdid outcome `control', ivar(id) time(year) gvar(first_treat) method(dripw) notyet saverif(one) replace
      File one.dta will be used to save all RIFs
      Panel is not balanced
      Will use observations with Pair balanced (observed at t0 and t1)
      .........
      (file one.dta not found)
      file one.dta saved
      
      Difference-in-difference with Multiple Time Periods
      
                                                           Number of obs = 2,095,515
      Outcome model  : least squares
      Treatment model: inverse probability
      ------------------------------------------------------------------------------
                   | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
      g2013        |
       t_2012_2013 |   .0083529   .0010518     7.94   0.000     .0062914    .0104144
       t_2012_2014 |   .0103724   .0011836     8.76   0.000     .0080525    .0126922
       t_2012_2015 |    .011998    .001297     9.25   0.000      .009456      .01454
      -------------+----------------------------------------------------------------
      g2014        |
       t_2012_2013 |   .0009273   .0009624     0.96   0.335     -.000959    .0028137
       t_2013_2014 |   .0056538   .0010934     5.17   0.000     .0035107    .0077969
       t_2013_2015 |   .0110515   .0012572     8.79   0.000     .0085874    .0135157
      -------------+----------------------------------------------------------------
      g2015        |
       t_2012_2013 |    .001189   .0009791     1.21   0.225    -.0007299     .003108
       t_2013_2014 |  -.0010306   .0010361    -0.99   0.320    -.0030613    .0010002
       t_2014_2015 |   .0076515   .0011587     6.60   0.000     .0053804    .0099225
      ------------------------------------------------------------------------------
      Control: Not yet Treated
      
      See Callaway and Sant'Anna (2021) for details
      
      . 
      
      . estat event
      ATT by Periods Before and After treatment
      Event Study:Dynamic effects
      ------------------------------------------------------------------------------
                   | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
           Pre_avg |    .000576   .0004965     1.16   0.246    -.0003972    .0015492
          Post_avg |   .0099735   .0007166    13.92   0.000     .0085691    .0113779
               Tm2 |    .001189   .0009791     1.21   0.225    -.0007299     .003108
               Tm1 |   -.000037    .000706    -0.05   0.958    -.0014208    .0013468
               Tp0 |   .0072053   .0006369    11.31   0.000     .0059571    .0084536
               Tp1 |   .0107171   .0008675    12.35   0.000     .0090168    .0124175
               Tp2 |    .011998    .001297     9.25   0.000      .009456      .01454
      ------------------------------------------------------------------------------
      
      .
      Last edited by Zunyuan Zheng; 03 Nov 2023, 17:04.

      Comment


      • Ahh ok
        yoi are using older original syntax
        you need to use option long2 for a more traditional case

        Comment


        • Hi Fernando,

          Thanks so much! Option long2 helps, allowing me to have -3. In this way -1 is used as a common base period so there is no estimate for Tm1, I suppose.

          I have one more question:

          Since the always-treated individuals don't contribute to the estimation, is it safe to remove them from the dataset entirely?

          Best,
          Zunyuan

          Comment


          • Yes. The command is already doing that for you

            Comment


            • Hi Fernando,

              I've got it now. Thank you for the help. I appreciate it. Have a great day!

              Best,
              Zunyuan

              Comment


              • Hi Fernando
                Just following up:
                I've tried recoding the groups that we don't observe being treated.
                Also tried using using the csdid2 (which runs much faster!!).

                I'm using Stata 14on windows 11. I have replaced the csdid package from ssc to see if there was a version issue (did not help).

                I'm estimating the same model for other variables in the same database (exactly the same dimensions) and they work fine.

                I have tried asinr option, did not work. I have also tried long and long2 (wasn't sure if you meant me on your post): I get the same estimates and the same 0 (omitted) for the pre-avg.

                Would love any help from the community with the command or any other possible way to compute my pre-trends.

                With best regards,



                Comment


                • I think you simply need to recode gvar to 0 if the unit is treated after the last period you have available
                  so if your data spans for 2010 to 2020 recode to 0 if treated in 2021 or later
                  Option not yet May also help
                  Last edited by FernandoRios; 05 Nov 2023, 15:22.

                  Comment


                  • This is happening while I'm using not yet, that is what I don't understand.

                    I have also tried recoding gvar=0 if gvar is later than the end of the panel, as you suggested, but did not work.

                    I've tried dropping units treated in 2001, 2002, 2003 as there were many of them. Did not help.

                    I've tried dropping units where gvar >=2013. Did not help.

                    I've tried without the weights. Did not help.

                    Comment


                    • Can you share your data? Please send me an email so I can look at what it’s going on

                      Comment


                      • Hi Fernando,
                        Thank you very much for creating this command, very useful!
                        I am having an issue with my result and I do not know the reason why the output is like this. So I have a person-year dataset from the year 2011 - 2020 with the year of treatment (inspected) to be 2014, 2015 and 2016. In my event study, I would like to get an event study graph from relative times t = -3 to t = 4. Therefore, for the observations where treatment is 2014, I drop the years 2019 and 2020. For the treatment 2015 I drop years 2011 and 2020, while for treatment year 2016, I drop 2011 and 2012.

                        In creating the dataset, I restrict individuals to be found in the data in the pre periods but I do not balance them in the post periods (that is, workers can drop out of sample). Simple tabulation of number of observations give me the following table
                        Code:
                                year_inspect
                        year    0                 2014       2015         2016          Total
                                        
                        2011    344,674    342,079    0               0                686,753
                        2012    649,296    342,079    308,113    0                1,299,488
                        2013    836,482    342,079    308,113    187,542    1,674,216
                        2014    807,133    313,791    308,113    187,542    1,616,579
                        2015    755,212    292,613    278,228    187,542    1,513,595
                        2016    694,973    272,111    255,007    166,108    1,388,199
                        2017    653,795    257,560    240,066    153,443    1,304,864
                        2018    627,429    248,103    230,494    145,947    1,251,973
                        2019    359,909    0       219,665    138,869    718,443
                        2020    133,091    0       0               131,404     264,495
                                        
                        Total    5,861,994    2,410,415  2,147,799    1,298,397    11,718,605
                        However, when I run CSDID, it seems the years 2019 and 2020 are not used at all in the cohort 2x2 DiD. As you can see from the following table, for group 2015, I do not see years 2019 being used while for group 2016, I also do not see the year 2020 being used.

                        Code:
                        csdid l_wage_avg_def, ivar(id_worker_adj_num) time(year) gvar(year_inspect) method(reg) long2
                        Panel is not balanced
                        Will use observations with Pair balanced (observed at t0 and t1)
                        .......x......xx.....
                        Difference-in-difference with Multiple Time Periods
                        
                        Number of obs = 10,735,667
                        Outcome model : regression adjustment
                        Treatment model: none
                        ------------------------------------------------------------------------------
                        | Coefficient Std. err. z P>|z| [95% conf. interval]
                        -------------+----------------------------------------------------------------
                        g2014 |
                        t_2011_2013 | -.0098055 .0019019 -5.16 0.000 -.0135332 -.0060778
                        t_2012_2013 | -.0052157 .0014805 -3.52 0.000 -.0081175 -.002314
                        t_2013_2014 | -.007637 .0015064 -5.07 0.000 -.0105896 -.0046845
                        t_2013_2015 | -.0135376 .0019543 -6.93 0.000 -.0173679 -.0097073
                        t_2013_2016 | -.022529 .0022495 -10.02 0.000 -.0269379 -.01812
                        t_2013_2017 | -.018743 .002455 -7.63 0.000 -.0235548 -.0139312
                        t_2013_2018 | -.0151736 .0025645 -5.92 0.000 -.0201998 -.0101473
                        -------------+----------------------------------------------------------------
                        g2015 |
                        t_2011_2014 | 0 (omitted)
                        t_2012_2014 | -.0074919 .0018133 -4.13 0.000 -.0110459 -.0039378
                        t_2013_2014 | .0058864 .0015277 3.85 0.000 .0028922 .0088806
                        t_2014_2015 | -.0028282 .001758 -1.61 0.108 -.0062738 .0006175
                        t_2014_2016 | -.0018672 .0021402 -0.87 0.383 -.0060618 .0023274
                        t_2014_2017 | .0003499 .002409 0.15 0.885 -.0043716 .0050714
                        t_2014_2018 | .0062327 .0025483 2.45 0.014 .0012381 .0112273
                        -------------+----------------------------------------------------------------
                        g2016 |
                        t_2011_2015 | 0 (omitted)
                        t_2012_2015 | 0 (omitted)
                        t_2013_2015 | .0026712 .0022852 1.17 0.242 -.0018077 .00715
                        t_2014_2015 | .0035886 .002052 1.75 0.080 -.0004332 .0076104
                        t_2015_2016 | -.0040423 .0023296 -1.74 0.083 -.0086083 .0005236
                        t_2015_2017 | .0040788 .0027307 1.49 0.135 -.0012732 .0094309
                        t_2015_2018 | .0108701 .0029783 3.65 0.000 .0050327 .0167075
                        ------------------------------------------------------------------------------
                        Control: Never Treated
                        
                        See Callaway and Sant'Anna (2021) for details
                        My first guess is that there are no workers that are found (balanced) in all periods t = [-3,4] but as you can see from the following table, this doesnt seem to be the case. Would you be able to help me out with this? Thank you very much!

                        Code:
                        tab year year_inspect if bal_sample_all_period == 1
                        
                                year_inspect
                        year    0                2014          2015        2016         Total
                                        
                        2011    214,472    211,557     0              0                426,029
                        2012    399,967    211,557    184,471    0                795,995
                        2013    512,062    211,557    184,471    110,668    1,018,758
                        2014    512,062    211,557    184,471    110,668    1,018,758
                        2015    512,062    211,557    184,471    110,668    1,018,758
                        2016    512,062    211,557    184,471    110,668    1,018,758
                        2017    512,062    211,557    184,471    110,668    1,018,758
                        2018    512,062    211,557    184,471    110,668    1,018,758
                        2019    297,590    0               184,471    110,668    592,729
                        2020    112,095    0                0               110,668    222,763
                                        
                        Total    4,096,496    1,692,456  1,475,768    885,344    8,150,064
                        Last edited by ariza gusti; 06 Nov 2023, 21:25.

                        Comment


                        • Hi Fernando,

                          Do you have a theory for why the CS estimates could differ significantly from the estimate using the "correct" comparisons in the Bacon decomposition and the estimate using the stacked estimator?

                          Also, how does one plot a combined event analysis for all groups (like a weighted average of the groups)? In the examples, I see that a command csdid_plot without any group specified would do it, but when I try that, I get an error message saying that I need a group. I can get the plot for specific groups, but I want an average across them.

                          Thanks.

                          Comment


                          • ariza gusti
                            It seems to me that you have a problem with the data, or that you are using an older version of csdid.
                            I would see if l_wage_avg_def has any missing data.
                            F

                            Comment


                            • Andre Dupont
                              Not exactly sure what you mean with Stacked estimator. (Sun Abraham?)
                              In any case, the paper review by Roth et al may have an answer for you.
                              For the plot question, you have to plot each group separately, then combine them
                              csdid_plot, group(#)
                              where # is the group number.

                              HTH

                              Comment


                              • Thanks, Fernando.

                                The article by Roth et al. is a very useful reference (I wasn't aware of it), although it doesn't really answer my question. By the way, the stacked estimator that I was talking about is the very last one discussed in section 3.3 of their paper.

                                I have a conjecture that the reason for the difference is that the CS estimator doesn't seem to allow weighing the component ATTs by the size of the underlying population, as both the Bacon decomposition and the stacked estimator allow. Isn't this a concern about the CS estimator?

                                For instance, if in a particular study, the dependent variable is an average outcome at "city level", then one would want to put a higher weight on ATTs derived from larger cities. Since the Census defines as a "city" any type of settlement, some cities may have a few hundred people, while others may have millions. So it would make sense to put more weight on larger cities, not only because the effect in those cities is more relevant from a policy perspective, but also because the outcome variables are less noisy. In a city with several hundred people, if the outcome variable counts some relatively rare event (let's say that one that on average happens once per 100 people per year), you may end up with big random swings in that variable from period to period, which would then be averaged with some small effect of the policy change from a large city.

                                Maybe I'm misunderstanding something..

                                As for my second question. I still don't know how to do what I was asking. I know how to plot the estimates for each group separately (I think that this is what you explained in your response), and in principle I would know how to create a picture that would include each of the graphs of the various groups. But what I would like is just one graph that averages all groups.

                                Comment

                                Working...
                                X