Announcement

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

  • Help for apply staggered DID in Stata 16

    I want to causally study how lagged number of implementation (x1) affect performance (y1) for a panel dataset. This effect must include some delay in implementation, so I plan to use a 5 years lagged variable. Since almost all units in the panel apply this implementation, I assume standard DID analysis cannot be applied since I do not have typical control units (never takers). So, I am aware of this new method called staggered DID which fits for implementation in different years, and especially when there is no never taker (control units will be those treated, but in the pre treatment period).

    So, in order to define the treatment, what I do is to create the growth rate for the number of implementations and take as treatment if a unit of the panel in a given year is above the 75 percentile from its own growth rate in the whole period (if you believe there would be a better way to define the treatment, please tell me, maybe this is a strong way of defining treatment, and using the threshold for all unit would give some never taker units which could be better). So, eventually all units will get treated, and in fact a unit can be treated in different years (see the "shock" variable in the code below). Because of the latter, I define the start of the treatment, the first year it gets treated.

    My main question is how could I perform this staggered DID in Stata 16, and which tests should I do to be convinced about the power of the estimation. I mean, standard DID rely on the parallel trend assumption, but I assume that in my case, when there are no typical control units (never takers) this parallel trend assumption is useless, right? Is there any other test should I do for this staggered DID?

    Many thanks for your help, below I put the treatment definition (and some possible control variables x2-x6) and some data example.

    PS. I thought of using a two way fixed effects estimation (unit and years) for the raw x1 variable (number of implementation), but I am afraid someone could tell that this is a correlation analysis, not a causal one.

    Code:
    bys id (year): gen gr_x1 = ( x1 - L.x1)/L.x1      // growth rate 
    egen p75 = pctile(gr_x1), by(id) p(75)            // 75 percentile for the shock
    gen shock = (gr_x1 > p75) & !missing(gr_x1, p75)  // the shock (treatment)
    bysort id (year): egen first_shock_year = min(year) if shock == 1 
    bys id ( first_shock_year): replace first_shock_year = first_shock_year[1]
    sort id year
    gen pre_treatment = (year < first_shock_year) & !missing(first_shock_year)  // pre treatment indicator
    gen event_time = year - first_shock_year  // pre and post treatment periods
    br id year gr_x1 p75 shock first_shock_year pre_treatment event_time
    tab event_time, gen(event)
    
    * Not totally sure about the following for capturing what I want
    
    xtreg y1 L5.event1 L5.event2 L5.event3 L5.event4 L5.event5 L5.event6 L5.event7 L5.event8 L5.event9 L5.event10 L5.event11 L5.event12 L5.event13 L5.event14 L5.event15 L5.event16 L5.event17 L5.event18 L5.event19 L5.event20 L5.event21 L5.event22 L5.event23 L5.event24, fe robust
    test (L5.event1 L5.event2 L5.event3 L5.event4 L5.event5 L5.event6 L5.event7 L5.event8 L5.event9)
    test (L5.event10 L5.event11 L5.event12 L5.event13 L5.event14 L5.event15 L5.event16 L5.event17 L5.event18 L5.event19)
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float id int year float(y1 x1 x2 x3 x4 x5 x6)
     1 2006  5  70 17.8 1.5 25451.15  279590   6
     1 2007  5  97 15.9   . 26226.57  280521 4.9
     1 2008  8 120 14.3 1.4 26298.87  281890 3.7
     1 2009  9 115 12.1   . 25778.82  283210 2.8
     1 2010  9 117 11.8 1.5  26232.1  284140 3.6
     1 2011  7 152 12.8 2.4  26925.7  285182 4.3
     1 2012  9 163 13.6 2.7    27304  286237 4.7
     1 2013 11 125 13.9   3 27618.34  287055 4.2
     1 2014 12 147 13.3 2.8 27650.34  287886 3.8
     1 2015  7 153 13.8 2.9 27756.28  289684 4.1
     1 2016  8 159 14.4 2.8 27999.32  291477 4.3
     1 2017  4 158 12.8 2.6 28882.27  292310 4.2
     1 2018  9 194 14.3 4.3 29055.78  293055 4.6
     1 2019 10 176 13.6 4.4 29214.89  293936 4.9
     1 2020 13 237 12.4 4.9 27289.89  295224 4.1
     1 2021  9 237 12.6 5.3 27714.08  296798 4.4
     1 2022  6 234    .   . 28706.85  299418   .
     9 2006  8  34   28   2 40744.37  363450 8.1
     9 2007 20  70 25.7   2  42167.5  364924 7.5
     9 2008  8  46 24.8 1.9 42611.79  366318 6.3
     9 2009 21 126 25.4 2.2 40411.15  367712 6.8
     9 2010 26  89 24.6 2.1 41212.26  368834 6.8
     9 2011 33 101   26 2.6 42728.87  370100 7.4
     9 2012 30 107 25.2 3.3 42766.69  371765   7
     9 2013 26  56   25 3.6 43201.16  373943 7.5
     9 2014 39  74 25.7 3.6 44120.01  376970   8
     9 2015 39  99 26.5 3.7 44683.38  381370 8.8
     9 2016 46  96 26.5 3.9 44448.77  386450 8.2
     9 2017 32  94 26.2   4 45282.64  390247 8.3
     9 2018 35 107 26.6 5.6 45482.29  393030   8
     9 2019 35 135 26.4 5.6 45991.43  395719 7.6
     9 2020 35 141 25.8 6.1  43010.1  398188 7.7
     9 2021 36 102   28 6.7 44509.65  400470   9
     9 2022 44 187    .   . 45846.17  404035   .
    18 2006 24  82 13.8 4.5 25617.93 1043900 3.8
    18 2007 18 157 14.1 4.5 26282.68 1050569   4
    18 2008 22 198 14.6 4.3 26345.05 1056880 3.6
    18 2009 31 314 13.7 4.4 25682.22 1063850 4.1
    18 2010 26 289 12.3   5 25930.05 1074912 3.2
    18 2011 22 317 12.6 3.9 26408.26 1085070 3.8
    18 2012 33 371 11.3 4.5 26380.38 1090610 3.5
    18 2013 23 376 11.1 4.5  26235.4 1094428 3.4
    18 2014 29 379 11.5 5.1 26114.16 1097290 3.5
    18 2015 28 349   12 4.8 26311.34 1101180 3.4
    18 2016 33 369 10.8 5.6 26435.88 1104760 3.2
    18 2017 40 330 10.7 5.8 26875.31 1107180 2.4
    18 2018 53 366 12.5 6.3 27218.43 1109190 4.3
    18 2019 43 424 11.7 6.5 27540.48 1112000 4.6
    18 2020 40 390 12.6 6.3  25756.9 1113635 4.5
    18 2021 30 421 11.1   6 27733.52 1114707 3.3
    18 2022 19 388    .   . 27959.22 1119180   .
    19 2006  8  12 11.1 4.9 23702.35  259900 2.5
    19 2007  9  11 10.6 4.1 23825.54  262630 2.1
    19 2008  6  26 10.9 4.5 23346.88  265520 2.3
    19 2009 10  23  9.1 4.4 22721.22  267990   .
    19 2010  6  27 11.2 4.9 23056.01  271115 1.9
    19 2011  6  29   11 4.3 23267.58  274490   .
    19 2012  4  47  9.8 4.6 22801.12  276700 2.3
    19 2013  7  31  9.8 5.1 22672.03  277990 1.9
    19 2014 10  24  9.6 4.6 22689.66  279200 2.1
    19 2015  8  29   10 5.2 22962.53  281800   2
    19 2016  5  32 10.7 5.1 22930.24  283890   2
    19 2017  2  23   11 6.3  23312.2  284790 3.3
    19 2018  9  38  9.4 5.5 23524.15  285800   2
    19 2019  8  37  9.3 5.4  23763.1  288100   .
    19 2020  5  29  9.5 5.7 22459.07  290710 2.2
    19 2021  6  38 10.4 6.8 23755.92  293090 2.9
    19 2022 11  21    .   . 23610.62  295990   .
    20 2006  1  45 11.5 4.9 24578.65  460300 3.3
    20 2007  8  41 10.8 4.8 24826.82  463650   4
    20 2008  5  81 10.6 4.1 25203.84  466994 3.6
    20 2009  8  98  9.2 4.8 24625.63  470444 3.1
    20 2010  5  71  9.4 4.6 25228.24  475834 3.2
    20 2011  8 101   10 3.7 25311.65  481090 3.5
    20 2012  7 105  8.5   4 25093.36  483800 2.9
    20 2013 16  89  8.1   4 24823.52  485580 3.5
    20 2014 17  96  8.7 3.9 25049.62  487600 3.3
    20 2015  9 101  9.3 3.8 25153.56  490490 3.6
    20 2016 13  80  9.4 4.7  25446.8  493080 3.7
    20 2017 12  68  8.2 5.1  25665.7  494643 3.5
    20 2018 12 102  8.9 6.3 25993.47  496000 3.1
    20 2019 14 117  8.8 5.9 26175.86  498200 3.4
    20 2020  8 107  7.6 6.3 24872.04  500010 2.8
    20 2021 12 111  8.1 6.9 26201.57  501949 3.7
    20 2022  8 101    .   .    26679  504990   .
    21 2006  0   0 25.5 1.4   3688.1  925533 4.3
    21 2007  0  36 26.9 1.4  3806.31  907340 5.1
    21 2008  0  72   27 1.3  3960.42  889973 4.7
    21 2009  0  87   26 1.1   3773.6  873454 3.7
    21 2010  0  76 23.4 1.1  3723.22  856236 2.5
    21 2011  0 103 23.2   2  3771.95  841871   3
    21 2012  0 115 24.3   2   3770.9  826741 3.8
    21 2013  0 161 24.4   2  3807.34  809111 3.8
    21 2014  0 132 24.9 2.5  4004.04  793267 3.3
    21 2015  2 170 23.4 2.6   3965.7  777079 3.2
    21 2016  1 214 23.9 2.3  4135.34  761015 4.4
    21 2017  1 432 23.6 2.2  4405.68  744925 4.4
    21 2018  3 342 22.7 2.6  4938.04  728773 4.2
    21 2019  2 385 22.4 2.5  4864.97  712665 4.9
    21 2020  0 369 21.7 2.5  4958.53  700453 4.8
    end

  • #2
    Dear all, I am asking your help in order to understand what I am doing with this command for staggered DID estimation. As I explain in #1, my aim is to estimate the effect of the number of implementation on the number of innovations in a given region. However, all regions have implemented R&D processes and therefore I do not have clear treatment and control here (very few regions in just few years have 0 R&D implementation).

    So, I use the growth rate for these number of implementations and use a threshold in growth for creating the treatment. Notice that a region can have explosive growth in different and non-consecutive years, so, I define treatment using the first time in the period a region have the first explosive grow. Therefore, “pre_treatment” is dummy variable equal to 1 for pre treatment years and 0 otherwise.

    I am using this new command “jwdid”, however, I have problems in understanding what am I doing with it. For instance, if no indep variables are used (see first table below), I see “0_pre_treatment” as omitted but then year.2007 only. If I have years from 2006 to 2022, I do not understand what this year.2007 is.

    If I include the growth rate from the number of implementation (the variable from which I want to study the treatment) lagged 5 periods “L5_x1” (see second table below), then its coefficient in the baseline year and its interaction with the rest of years appear (not as before with only year.2007). But again “0.pre_treatment” is again omitted, and now I do not know which is the treatment effect. Are the treatment those interacted coefficients L5_x1#year? Even though the treatment in the command comes from “gvar( pre_treatment )”? Or is the command taking L5_x1 and its interactions as a control variable?

    Finally, if I include a control variable (say L5_x2), it interacts it with time? Why?

    After having read the help section of the command, I must to confess that still I do not understand what am I doing with the command. Can someone please help me understand?

    Thanks for your help in advance!

    Code:
    . jwdid y1 , ivar(id) tvar( year ) gvar( pre_treatment ) cluster(id) method(poisson)
    note: 0.pre_treatment omitted because of collinearity
    
    Iteration 0:   log pseudolikelihood = -162841.02  
    Iteration 1:   log pseudolikelihood = -162841.02  
    
    Poisson regression                              Number of obs     =      4,214
                                                    Wald chi2(1)      =      26.13
    Log pseudolikelihood = -162841.02               Prob > chi2       =     0.0000
    
                                          (Std. Err. adjusted for 274 clusters in id)
    ---------------------------------------------------------------------------------
                    |               Robust
                 y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
    0.pre_treatment |          0  (omitted)
                    |
               year |
              2007  |  -.3143793   .0615027    -5.11   0.000    -.4349225   -.1938362
                    |
              _cons |   3.764616   .1020398    36.89   0.000     3.564622    3.964611
    ---------------------------------------------------------------------------------
    Code:
    . jwdid y1 L5_x1 , ivar(id) tvar( year ) gvar( pre_treatment ) cluster(id) method(poisson)
    note: 0.pre_treatment omitted because of collinearity
    
    Iteration 0:   log pseudolikelihood = -435220.88  
    Iteration 1:   log pseudolikelihood = -197219.87  
    Iteration 2:   log pseudolikelihood = -120032.68  
    Iteration 3:   log pseudolikelihood = -114339.89  
    Iteration 4:   log pseudolikelihood =  -113959.4  
    Iteration 5:   log pseudolikelihood = -113956.56  
    Iteration 6:   log pseudolikelihood = -113956.56  
    
    Poisson regression                              Number of obs     =      3,265
                                                    Wald chi2(23)     =    1338.83
    Log pseudolikelihood = -113956.56               Prob > chi2       =     0.0000
    
                                          (Std. Err. adjusted for 274 clusters in id)
    ---------------------------------------------------------------------------------
                    |               Robust
                 y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
              L5_x1 |   .0003009   .0000227    13.26   0.000     .0002564    .0003454
                    |
       year#c.L5_x1 |
              2012  |  -.0000602   8.42e-06    -7.14   0.000    -.0000767   -.0000437
              2013  |  -.0000728   7.46e-06    -9.76   0.000    -.0000875   -.0000582
              2014  |  -.0000825   8.63e-06    -9.57   0.000    -.0000995   -.0000656
              2015  |  -.0000895   8.70e-06   -10.29   0.000    -.0001066   -.0000725
              2016  |  -.0000978   9.58e-06   -10.20   0.000    -.0001166    -.000079
              2017  |  -.0000842   .0000114    -7.40   0.000    -.0001065   -.0000619
              2018  |  -.0000792   .0000167    -4.76   0.000    -.0001119   -.0000466
              2019  |  -.0000806   .0000213    -3.78   0.000    -.0001225   -.0000388
              2020  |  -.0000662   .0000276    -2.40   0.017    -.0001204   -.0000121
              2021  |  -.0000434    .000015    -2.89   0.004    -.0000728    -.000014
              2022  |  -.0000854   .0000323    -2.64   0.008    -.0001487   -.0000221
                    |
    0.pre_treatment |          0  (omitted)
                    |
               year |
              2012  |   .0856446   .0214874     3.99   0.000     .0435302    .1277591
              2013  |   .1240499    .024065     5.15   0.000     .0768833    .1712164
              2014  |    .080304    .024497     3.28   0.001     .0322907    .1283173
              2015  |   .0611429   .0274726     2.23   0.026     .0072977    .1149881
              2016  |   .0439377   .0301096     1.46   0.144    -.0150759    .1029514
              2017  |  -.0038198   .0337586    -0.11   0.910    -.0699854    .0623457
              2018  |   .0205351   .0371884     0.55   0.581    -.0523529     .093423
              2019  |   .0686304   .0457529     1.50   0.134    -.0210435    .1583044
              2020  |   .0730107   .0470196     1.55   0.120     -.019146    .1651674
              2021  |   .0099284   .0435794     0.23   0.820    -.0754858    .0953425
              2022  |    .000999    .050644     0.02   0.984    -.0982615    .1002595
                    |
              _cons |   3.534539    .101131    34.95   0.000     3.336325    3.732752
    ---------------------------------------------------------------------------------
    Code:
    . jwdid y1 L5_x1 L5_x2 , ivar(id) tvar( year ) gvar( pre_treatment ) cluster(id) method(poisson)
    note: 0.pre_treatment omitted because of collinearity
    
    Iteration 0:   log pseudolikelihood = -547478.36  
    Iteration 1:   log pseudolikelihood = -218785.23  
    Iteration 2:   log pseudolikelihood = -112769.53  
    Iteration 3:   log pseudolikelihood = -103733.18  
    Iteration 4:   log pseudolikelihood = -102683.52  
    Iteration 5:   log pseudolikelihood = -102669.71  
    Iteration 6:   log pseudolikelihood = -102669.66  
    Iteration 7:   log pseudolikelihood = -102669.66  
    
    Poisson regression                              Number of obs     =      3,049
                                                    Wald chi2(35)     =    2007.46
    Log pseudolikelihood = -102669.66               Prob > chi2       =     0.0000
    
                                          (Std. Err. adjusted for 259 clusters in id)
    ---------------------------------------------------------------------------------
                    |               Robust
                 y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
              L5_x1 |   .0003573   .0000292    12.24   0.000        .0003    .0004145
              L5_x2 |   .0489624    .018778     2.61   0.009     .0121582    .0857666
                    |
       year#c.L5_x1 |
              2012  |  -.0000794   9.22e-06    -8.61   0.000    -.0000974   -.0000613
              2013  |  -.0000963   9.54e-06   -10.10   0.000     -.000115   -.0000777
              2014  |  -.0001087   .0000109    -9.97   0.000      -.00013   -.0000873
              2015  |  -.0001167    .000012    -9.72   0.000    -.0001402   -.0000932
              2016  |  -.0001237   .0000124    -9.96   0.000     -.000148   -.0000993
              2017  |  -.0001081   .0000116    -9.31   0.000    -.0001309   -.0000854
              2018  |  -.0001224   .0000347    -3.53   0.000    -.0001905   -.0000544
              2019  |  -.0001246   .0000398    -3.13   0.002    -.0002027   -.0000465
              2020  |    -.00011   .0000478    -2.30   0.021    -.0002037   -.0000164
              2021  |  -.0000832   .0000293    -2.84   0.005    -.0001406   -.0000257
              2022  |  -.0001352   .0000469    -2.88   0.004    -.0002271   -.0000432
                    |
       year#c.L5_x2 |
              2012  |   -.003367   .0040286    -0.84   0.403     -.011263     .004529
              2013  |  -.0130079   .0046067    -2.82   0.005    -.0220368   -.0039789
              2014  |  -.0088045   .0053329    -1.65   0.099    -.0192567    .0016478
              2015  |  -.0128513   .0066354    -1.94   0.053    -.0258564    .0001538
              2016  |  -.0161953   .0073594    -2.20   0.028    -.0306194   -.0017712
              2017  |  -.0192547   .0074633    -2.58   0.010    -.0338826   -.0046269
              2018  |  -.0232433   .0079048    -2.94   0.003    -.0387364   -.0077503
              2019  |  -.0261795   .0097183    -2.69   0.007    -.0452271    -.007132
              2020  |  -.0256759   .0089945    -2.85   0.004    -.0433049   -.0080469
              2021  |   -.026063   .0091544    -2.85   0.004    -.0440053   -.0081208
              2022  |  -.0351268   .0109593    -3.21   0.001    -.0566066   -.0136469
                    |
    0.pre_treatment |          0  (omitted)
                    |
               year |
              2012  |   .1848934   .0846749     2.18   0.029     .0189337    .3508531
              2013  |   .4420843   .1090486     4.05   0.000     .2283529    .6558157
              2014  |   .3581225    .128275     2.79   0.005     .1067081     .609537
              2015  |   .4283458   .1545595     2.77   0.006     .1254147    .7312769
              2016  |      .4593   .1655084     2.78   0.006     .1349096    .7836904
              2017  |   .4754771   .1675233     2.84   0.005     .1471375    .8038166
              2018  |   .5715135   .1802768     3.17   0.002     .2181775    .9248495
              2019  |   .6654786   .2059588     3.23   0.001     .2618067     1.06915
              2020  |   .6560216   .2041399     3.21   0.001     .2559147    1.056129
              2021  |   .5899703    .204938     2.88   0.004     .1882993    .9916413
              2022  |   .7346112    .234759     3.13   0.002      .274492     1.19473
                    |
              _cons |   2.572122   .3417041     7.53   0.000     1.902394     3.24185
    ---------------------------------------------------------------------------------

    Comment


    • #3
      Hi Doris

      I cannot help beyond suggesting "staggered" (version 0.7.1, 24Sep2024, at SSC): module implementing R staggered package based on Roth and Sant'Anna (2023). This requires at least Stata version 14.1.

      The help file suggests access to more detail @ https://github.com/mcaceresb/stata-staggered#readme


      john moran

      Comment


      • #4
        Dear John, thanks for the suggested command. I will have a look, even though I would also like to understand this jwdid command.

        Comment


        • #5
          Hi Doris
          To understand the JWDID you may first want to take a look at Prof Wooldridge's papers (see references in help file) his lectures on DID, or some of the notes I have on my site
          https://friosavila.github.io/

          Bottom line. JWDID assumes that Standard TWFE DID estimation can avoid the problems described in the literature, by simply allowing for full heterogeneity across treatment timing (when are groups treated) treatment relative timing (how long since treatment you are estimating the effect), and heterogeneity based on other observed characteristics.

          So, instead of having a single post x treatment variable, (assume all individual and time fe are already "absorbed"), one needs to have a i.T x i.G, where G are all the different groups (years where they were treated the first time, and zero if never treated). and i.T are the years at which you want to estimate those effects. (dropping the one before treatment, so you need to drop a different one depending on G).

          If you exclude the interactions where T<G, you are using not-yet treated and never treated as controls. If you include those interactions, your control group are the never treated.

          Only using never treated, you can estimate treatment effects before treatment, to verify and test for PTA.

          HTH
          F

          Comment


          • #6
            Hi FernandoRios , thanks for your reply.

            I believe I understand the general idea for the command. After looking at your examples, I see that the gvar variable must register the year for the first treatment (not if the region is treated or not 0-1). For example, if region AT11 receives the first implementation in 2007, I must have a variable gvar=2007 for all obs of that region… So, after building such variable (see commands below), I do the following (see first table below), for which “gvar#year#c.__tr__” must be the treatment on the treated effects for each cohort (for instance, for those treated in 2007, which are the effects on the following years, for those treated in 2015 which are the effects in the following years) which assumes that treatment could be different in different periods. Notice that now I have never treated groups (see first commands below).

            Then I see gvar in the table for the different cohorts, which I assume are the pre treatment effects (am I right?). If this is the case, then we must expect all these gvar##cohorts to be non-significant, which would imply parallel trend, right? In my case most are not, so, that is a problem, right? Please let me know if I am getting it wrong.

            However, all these interactions are a lot of information, so, I would like to condense all those interactions for the treatment on the treated in a table with the single general effect, as a first main message of the study. However, when using the post estimation commands, I get errors (see below). Notice that the estimation creates these variables always (__tr__, __etr__) and sometimes also this one (__event__). Anyway, none of the following commands work: estat event, estat simple, estat calendar, estat group, estat plot. What am I doing wrong?

            Another relevant issue from this study is that in theory, the indep variable “implementation” must take at least two years for showing some effect on regional innovation (there is a delayed effect). Is there any way I can implement this into the command? I mean, in a regular regression I would lag the indep by 2 periods at least. But here, I have the treatment in a given year, and the effect on that same year and in subsequent years. But in this case, the same year and the following two years have not sense.

            Finally, when using the option “never” to use only never treated as control group, the effect from “gvar#year#c.__tr__” changes and now gives the effects for that cohort in the pre treated periods. Why is it different from not using never as option? So, I am not clear from where does the parallel trend assumption comes (from gvar in the table when not interacted? Or from these interactions before the first treatment takes place only when using "never" as option?).

            Sorry for the long post, but I really want to understand this.

            Code:
            . bys id (year): gen gr_x1 = ( x1 - L.x1)/L.x1      // growth rate 
            (306 missing values generated)
            
            . egen mn_gr = mean(gr_x1)
            
            . gen shock = (gr_x1 > mn_gr) & !missing(gr_x1, mn_gr)  // the shock (treatment)
            
            . bysort id (year): egen first_shock_year = min(year) if shock == 1 
            (4124 missing values generated)
            
            . bys id ( first_shock_year): replace first_shock_year = first_shock_year[1]
            (3053 real changes made)
            
            . sort id year
            
            . gen pre_treatment = (year < first_shock_year) & !missing(first_shock_year)  // pre treatment indicator
            
            . gen event_time = year - first_shock_year  // pre and post treatment periods
            (1,071 missing values generated)
            
            . gen gvar = first_shock_year
            (1,071 missing values generated)
            
            . recode gvar (. = 0)
            (gvar: 1071 changes made)
            
            . xtset id year
                   panel variable:  id (strongly balanced)
                    time variable:  year, 2006 to 2022
                            delta:  1 unit
            
            . 
            . jwdid y1 , ivar(id) tvar( year ) gvar( gvar ) cluster(id) method(poisson) 
            
            Iteration 0:   log pseudolikelihood = -136822.15  
            Iteration 1:   log pseudolikelihood = -136396.23  
            Iteration 2:   log pseudolikelihood = -136381.36  
            Iteration 3:   log pseudolikelihood = -136381.15  
            Iteration 4:   log pseudolikelihood = -136381.15  
            
            Poisson regression                              Number of obs     =      4,658
                                                            Wald chi2(100)    =          .
            Log pseudolikelihood = -136381.15               Prob > chi2       =          .
            
                                                     (Std. Err. adjusted for 274 clusters in id)
            ------------------------------------------------------------------------------------
                               |               Robust
                            y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------------+----------------------------------------------------------------
            gvar#year#c.__tr__ |
                    2007 2007  |  -.0058656   .0388075    -0.15   0.880    -.0819268    .0701957
                    2007 2008  |  -.0036748   .0525051    -0.07   0.944    -.1065829    .0992332
                    2007 2009  |   .0442753   .0608219     0.73   0.467    -.0749334    .1634841
                    2007 2010  |     .02684   .0632879     0.42   0.671     -.097202     .150882
                    2007 2011  |   .0970439   .0675241     1.44   0.151    -.0353009    .2293886
                    2007 2012  |   .0778547   .0675422     1.15   0.249    -.0545256     .210235
                    2007 2013  |   .1217667   .0749863     1.62   0.104    -.0252036    .2687371
                    2007 2014  |    .088322   .0722266     1.22   0.221    -.0532395    .2298835
                    2007 2015  |    .083717   .0817656     1.02   0.306    -.0765406    .2439746
                    2007 2016  |   .1615289   .0852265     1.90   0.058    -.0055119    .3285697
                    2007 2017  |   .1331068   .0923482     1.44   0.149    -.0478924     .314106
                    2007 2018  |   .1760413   .0935658     1.88   0.060    -.0073442    .3594269
                    2007 2019  |   .2274064   .1056118     2.15   0.031     .0204111    .4344017
                    2007 2020  |   .1246463   .1016719     1.23   0.220     -.074627    .3239195
                    2007 2021  |   .1099738   .1130409     0.97   0.331    -.1115823    .3315299
                    2007 2022  |   .1078134   .1102384     0.98   0.328    -.1082498    .3238766
                    2008 2008  |     .15109   .1786484     0.85   0.398    -.1990544    .5012345
                    2008 2009  |   .3028546    .165628     1.83   0.067    -.0217704    .6274796
                    2008 2010  |   .7567113   .2861474     2.64   0.008     .1958727     1.31755
                    2008 2011  |   .3450961   .1993052     1.73   0.083     -.045535    .7357271
                    2008 2012  |   .0885603   .1798988     0.49   0.623    -.2640349    .4411554
                    2008 2013  |   .2078005   .1340067     1.55   0.121    -.0548478    .4704489
                    2008 2014  |   .3341765   .1529518     2.18   0.029     .0343965    .6339565
                    2008 2015  |   .1780501   .1356763     1.31   0.189    -.0878706    .4439709
                    2008 2016  |     .22364   .1466288     1.53   0.127    -.0637472    .5110273
                    2008 2017  |    .311836   .1658129     1.88   0.060    -.0131513    .6368232
                    2008 2018  |   .4107417   .1895355     2.17   0.030     .0392589    .7822245
                    2008 2019  |   .4756951   .1764716     2.70   0.007     .1298172     .821573
                    2008 2020  |   .0417543   .2046489     0.20   0.838    -.3593501    .4428587
                    2008 2021  |   .1589098   .2074094     0.77   0.444    -.2476051    .5654248
                    2008 2022  |   .0543444   .1498769     0.36   0.717    -.2394088    .3480977
                    2009 2009  |   .0031167   .0405023     0.08   0.939    -.0762663    .0824998
                    2009 2010  |   .1650785   .0429453     3.84   0.000     .0809073    .2492497
                    2009 2011  |   .0745695   .0552871     1.35   0.177    -.0337912    .1829302
                    2009 2012  |   .0031767   .0535023     0.06   0.953    -.1016859    .1080393
                    2009 2013  |   .0907133   .0516962     1.75   0.079    -.0106093    .1920359
                    2009 2014  |   .1373464   .0556628     2.47   0.014     .0282494    .2464434
                    2009 2015  |   .1005457   .0595511     1.69   0.091    -.0161723    .2172637
                    2009 2016  |   .1700691   .0664543     2.56   0.010     .0398211    .3003171
                    2009 2017  |   .1535597   .0684606     2.24   0.025     .0193793      .28774
                    2009 2018  |   .1576077   .0769121     2.05   0.040     .0068627    .3083527
                    2009 2019  |   .2056947   .0780259     2.64   0.008     .0527667    .3586227
                    2009 2020  |   .1788179   .0828404     2.16   0.031     .0164536    .3411822
                    2009 2021  |   .1118995   .0863509     1.30   0.195    -.0573451    .2811441
                    2009 2022  |   .1327511   .0827364     1.60   0.109    -.0294092    .2949115
                    2010 2010  |   .1147498   .0895373     1.28   0.200    -.0607401    .2902396
                    2010 2011  |   .1539323   .0703836     2.19   0.029     .0159829    .2918817
                    2010 2012  |   -.108933   .1375301    -0.79   0.428     -.378487     .160621
                    2010 2013  |   .0858724   .0954397     0.90   0.368     -.101186    .2729308
                    2010 2014  |   .1344464   .1141006     1.18   0.239    -.0891867    .3580795
                    2010 2015  |   .1785264   .0815908     2.19   0.029     .0186114    .3384415
                    2010 2016  |   .2162039   .0877757     2.46   0.014     .0441667    .3882411
                    2010 2017  |   .1306938   .1104585     1.18   0.237    -.0858008    .3471884
                    2010 2018  |   .2362373   .0940287     2.51   0.012     .0519443    .4205302
                    2010 2019  |   .2282374   .1605447     1.42   0.155    -.0864245    .5428992
                    2010 2020  |   .2506685   .1174983     2.13   0.033     .0203762    .4809608
                    2010 2021  |   .3014615   .0914793     3.30   0.001     .1221654    .4807576
                    2010 2022  |    .239219   .1110255     2.15   0.031      .021613     .456825
                    2011 2011  |   .2510793   1.102443     0.23   0.820     -1.90967    2.411828
                    2011 2012  |   .1186919   .1600998     0.74   0.458    -.1950979    .4324818
                    2011 2013  |   1.202295    .160605     7.49   0.000     .8875147    1.517075
                    2011 2014  |   1.320164   .1161295    11.37   0.000     1.092555    1.547774
                    2011 2015  |   1.324186   .3961857     3.34   0.001     .5476759    2.100695
                    2011 2016  |   1.850361   .0632331    29.26   0.000     1.726427    1.974296
                    2011 2017  |   1.045016   .4978831     2.10   0.036     .0691827    2.020849
                    2011 2018  |   1.811204    .085816    21.11   0.000     1.643008      1.9794
                    2011 2019  |   1.574713   .0771858    20.40   0.000     1.423431    1.725994
                    2011 2020  |   .9424406   .2985452     3.16   0.002     .3573027    1.527578
                    2011 2021  |   1.572687   .4524373     3.48   0.001     .6859259    2.459448
                    2011 2022  |    1.57407   .2407297     6.54   0.000     1.102248    2.045891
                    2012 2012  |  -.9499872   .4613039    -2.06   0.039    -1.854126   -.0458481
                    2012 2013  |  -.1664887   .2267182    -0.73   0.463    -.6108482    .2778708
                    2012 2014  |   .0283418   .2477022     0.11   0.909    -.4571455    .5138292
                    2012 2015  |   -.373102   .3230797    -1.15   0.248    -1.006326    .2601226
                    2012 2016  |   .0459756   .2720712     0.17   0.866    -.4872741    .5792252
                    2012 2017  |  -.4291283   .3458825    -1.24   0.215    -1.107046    .2487888
                    2012 2018  |   .1939589   .4137406     0.47   0.639    -.6169579    1.004876
                    2012 2019  |  -.4384279   .3712404    -1.18   0.238    -1.166046    .2891899
                    2012 2020  |  -.1262384   .1095014    -1.15   0.249    -.3408572    .0883804
                    2012 2021  |  -.2691821   .2945495    -0.91   0.361    -.8464886    .3081243
                    2012 2022  |  -.0671283   .4302167    -0.16   0.876    -.9103374    .7760809
                    2013 2013  |   .0818346   .3015739     0.27   0.786    -.5092394    .6729086
                    2013 2014  |   .1684516   .1988243     0.85   0.397    -.2212368    .5581399
                    2013 2015  |  -.0686892    .223317    -0.31   0.758    -.5063825    .3690041
                    2013 2016  |  -.3309709   .3453583    -0.96   0.338    -1.007861     .345919
                    2013 2017  |  -.3096379   .1999935    -1.55   0.122     -.701618    .0823422
                    2013 2018  |   .0998752   .2657571     0.38   0.707    -.4209992    .6207496
                    2013 2019  |   .1665704   .2219213     0.75   0.453    -.2683873    .6015281
                    2013 2020  |   .5528678   .2729381     2.03   0.043     .0179189    1.087817
                    2013 2021  |   .9852882   .1392248     7.08   0.000     .7124127    1.258164
                    2013 2022  |   .5654579    .202387     2.79   0.005     .1687867    .9621291
                    2014 2014  |  -.1297388    .045871    -2.83   0.005    -.2196443   -.0398332
                    2014 2015  |  -.1805257   .0597295    -3.02   0.003    -.2975933    -.063458
                    2014 2016  |  -.5583921   .0448766   -12.44   0.000    -.6463486   -.4704356
                    2014 2017  |  -.5590381   .0718485    -7.78   0.000    -.6998585   -.4182176
                    2014 2018  |  -.4104088   .1273733    -3.22   0.001     -.660056   -.1607617
                    2014 2019  |  -.2806555   .0643148    -4.36   0.000    -.4067102   -.1546008
                    2014 2020  |  -.6181281   .0557631   -11.08   0.000    -.7274219   -.5088344
                    2014 2021  |   -.505825    .154887    -3.27   0.001     -.809398   -.2022521
                    2014 2022  |  -.2660309   .1020032    -2.61   0.009    -.4659534   -.0661083
                    2015 2015  |   .0363529    .035873     1.01   0.311    -.0339569    .1066628
                    2015 2016  |    .092525   .0403916     2.29   0.022     .0133588    .1716911
                    2015 2017  |  -.2074625   .0471538    -4.40   0.000    -.2998822   -.1150428
                    2015 2018  |    .054893   .0489223     1.12   0.262     -.040993     .150779
                    2015 2019  |   .1566148   .0559374     2.80   0.005     .0469795    .2662501
                    2015 2020  |  -.2892036   .0518415    -5.58   0.000     -.390811   -.1875961
                    2015 2021  |   .0224897   .0557254     0.40   0.687    -.0867302    .1317096
                    2015 2022  |  -.4086732   .0662262    -6.17   0.000    -.5384742   -.2788721
                    2016 2016  |   .1342601   .0877062     1.53   0.126    -.0376409     .306161
                    2016 2017  |   .3468036    .112648     3.08   0.002     .1260175    .5675896
                    2016 2018  |   .2319617   .1949391     1.19   0.234    -.1501119    .6140353
                    2016 2019  |    .235089   .2815869     0.83   0.404    -.3168111    .7869892
                    2016 2020  |   .2412742   .2967554     0.81   0.416    -.3403557     .822904
                    2016 2021  |   .2039868   .2988427     0.68   0.495    -.3817341    .7897077
                    2016 2022  |   .2329368   .2182048     1.07   0.286    -.1947368    .6606104
                    2017 2017  |   .1997166   .0989995     2.02   0.044     .0056811    .3937521
                    2017 2018  |     .14314   .2028189     0.71   0.480    -.2543778    .5406577
                    2017 2019  |   .3361289   .1564579     2.15   0.032     .0294769    .6427808
                    2017 2020  |   .1995564    .133774     1.49   0.136    -.0626358    .4617487
                    2017 2021  |   .3585729   .2381475     1.51   0.132    -.1081876    .8253333
                    2017 2022  |   .0998792   .2387566     0.42   0.676    -.3680751    .5678335
                    2018 2018  |   .1435982   .1121601     1.28   0.200    -.0762315    .3634279
                    2018 2019  |  -.1169904   .0572575    -2.04   0.041    -.2292131   -.0047677
                    2018 2020  |  -.1981447   .1683635    -1.18   0.239    -.5281311    .1318417
                    2018 2021  |  -.0310674   .1314961    -0.24   0.813     -.288795    .2266603
                    2018 2022  |   -.040047   .1737334    -0.23   0.818    -.3805582    .3004642
                    2019 2019  |   .0980247   .0820911     1.19   0.232    -.0628709    .2589203
                    2019 2020  |   .1682543   .0839469     2.00   0.045     .0037215    .3327872
                    2019 2021  |   .0672493   .0924126     0.73   0.467     -.113876    .2483746
                    2019 2022  |   .0433146   .1206954     0.36   0.720    -.1932441    .2798734
                    2021 2021  |  -.1982675   .1894729    -1.05   0.295    -.5696276    .1730926
                    2021 2022  |  -.4317239   .1656426    -2.61   0.009    -.7563774   -.1070705
                    2022 2022  |  -.1425375   .0490836    -2.90   0.004    -.2387396   -.0463354
                               |
                          gvar |
                         2007  |  -.8867836   .2281717    -3.89   0.000    -1.333992   -.4395753
                         2008  |  -2.883739    .352515    -8.18   0.000    -3.574655   -2.192822
                         2009  |  -.8086948   .6737408    -1.20   0.230    -2.129203    .5118129
                         2010  |  -.6659928   .4394184    -1.52   0.130    -1.527237    .1952514
                         2011  |  -4.201725   .4347609    -9.66   0.000     -5.05384   -3.349609
                         2012  |  -2.727581   .4323151    -6.31   0.000    -3.574903   -1.880258
                         2013  |  -3.406687    .531931    -6.40   0.000    -4.449252   -2.364121
                         2014  |  -.7369185   .6585393    -1.12   0.263    -2.027632    .5537949
                         2015  |   .3518676   .1763668     2.00   0.046     .0061949    .6975402
                         2016  |  -.8761854   .3721342    -2.35   0.019    -1.605555   -.1468158
                         2017  |  -2.063657   .3155607    -6.54   0.000    -2.682145    -1.44517
                         2018  |  -1.281356   .7102562    -1.80   0.071    -2.673433    .1107204
                         2019  |  -.5915278   .4008181    -1.48   0.140    -1.377117    .1940613
                         2021  |  -1.639985    .305977    -5.36   0.000    -2.239689   -1.040281
                         2022  |  -4.356905   .1699295   -25.64   0.000    -4.689961   -4.023849
                               |
                          year |
                         2007  |   .0732145   .0224847     3.26   0.001     .0291452    .1172838
                         2008  |   .2218784   .0254692     8.71   0.000     .1719598     .271797
                         2009  |   .2615087   .0306342     8.54   0.000     .2014667    .3215507
                         2010  |    .391848   .0318813    12.29   0.000     .3293617    .4543342
                         2011  |   .4590458   .0405114    11.33   0.000      .379645    .5384467
                         2012  |   .5914332   .0373639    15.83   0.000     .5182014     .664665
                         2013  |   .6064425   .0365882    16.57   0.000      .534731    .6781539
                         2014  |   .5939334   .0459138    12.94   0.000     .5039441    .6839228
                         2015  |   .5899121   .0555702    10.62   0.000     .4809965    .6988277
                         2016  |   .5337401   .0588477     9.07   0.000     .4184007    .6490795
                         2017  |   .5124071   .0660759     7.75   0.000     .3829007    .6419136
                         2018  |   .5083591   .0683538     7.44   0.000     .3743882    .6423301
                         2019  |   .5217066   .0732431     7.12   0.000     .3781529    .6652604
                         2020  |   .6149823   .0686824     8.95   0.000     .4803672    .7495974
                         2021  |   .6037753   .0725652     8.32   0.000     .4615501    .7460006
                         2022  |   .6023922   .0795555     7.57   0.000     .4464663    .7583181
                               |
                         _cons |   3.897065   .1877433    20.76   0.000     3.529095    4.265035
            ------------------------------------------------------------------------------------
            
            . estat event
            varlist required
            
            . estat simple
            varlist required
            
            . estat calendar
            varlist required
            
            . estat group
            varlist required
            
            . estat plot
            invalid syntax
            
            . 
            . jwdid y1 , ivar(id) tvar( year ) gvar( gvar ) cluster(id) method(poisson) never
            
            Iteration 0:   log pseudolikelihood = -136751.25  
            Iteration 1:   log pseudolikelihood = -136304.66  
            Iteration 2:   log pseudolikelihood = -136284.07  
            Iteration 3:   log pseudolikelihood =  -136282.1  
            Iteration 4:   log pseudolikelihood = -136281.65  
            Iteration 5:   log pseudolikelihood = -136281.55  
            Iteration 6:   log pseudolikelihood = -136281.54  
            Iteration 7:   log pseudolikelihood = -136281.53  
            Iteration 8:   log pseudolikelihood = -136281.53  
            Iteration 9:   log pseudolikelihood = -136281.53  
            Iteration 10:  log pseudolikelihood = -136281.53  
            
            Poisson regression                              Number of obs     =      4,658
                                                            Wald chi2(105)    =          .
            Log pseudolikelihood = -136281.53               Prob > chi2       =          .
            
                                                     (Std. Err. adjusted for 274 clusters in id)
            ------------------------------------------------------------------------------------
                               |               Robust
                            y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------------+----------------------------------------------------------------
            gvar#year#c.__tr__ |
                    2007 2007  |  -.0012211    .041371    -0.03   0.976    -.0823067    .0798644
                    2007 2008  |    .006277   .0558234     0.11   0.910    -.1031348    .1156888
                    2007 2009  |   .0526769   .0637276     0.83   0.408    -.0722268    .1775807
                    2007 2010  |   .0495766   .0644345     0.77   0.442    -.0767127    .1758658
                    2007 2011  |   .1139195   .0698947     1.63   0.103    -.0230717    .2509106
                    2007 2012  |   .0965426   .0692677     1.39   0.163    -.0392195    .2323048
                    2007 2013  |   .1419741   .0763223     1.86   0.063    -.0076149    .2915631
                    2007 2014  |   .1070115   .0753259     1.42   0.155    -.0406245    .2546475
                    2007 2015  |   .1122059   .0855444     1.31   0.190    -.0554581    .2798698
                    2007 2016  |    .180082   .0890051     2.02   0.043     .0056352    .3545289
                    2007 2017  |   .1544662   .0960708     1.61   0.108    -.0338292    .3427616
                    2007 2018  |   .1950995   .0966693     2.02   0.044     .0056311    .3845679
                    2007 2019  |   .2442002   .1073682     2.27   0.023     .0337624    .4546381
                    2007 2020  |   .1383449   .1037845     1.33   0.183     -.065069    .3417588
                    2007 2021  |   .1266329    .115213     1.10   0.272    -.0991804    .3524462
                    2007 2022  |    .124676   .1125068     1.11   0.268    -.0958333    .3451853
                    2008 2006  |   -.184138   .1358563    -1.36   0.175    -.4504114    .0821355
                    2008 2008  |   .0739491   .1612901     0.46   0.647    -.2421736    .3900718
                    2008 2009  |   .2241654   .1462799     1.53   0.125    -.0625378    .5108687
                    2008 2010  |   .6923536   .3117992     2.22   0.026     .0812383    1.303469
                    2008 2011  |   .2748804   .1870845     1.47   0.142    -.0917985    .6415593
                    2008 2012  |   .0201572   .1757316     0.11   0.909    -.3242705    .3645849
                    2008 2013  |   .1409165   .1369033     1.03   0.303    -.1274091     .409242
                    2008 2014  |   .2657737   .1629546     1.63   0.103    -.0536114    .5851588
                    2008 2015  |   .1194478   .1296474     0.92   0.357    -.1346565    .3735521
                    2008 2016  |    .155102   .1549376     1.00   0.317    -.1485702    .4587743
                    2008 2017  |   .2461039   .1866537     1.32   0.187    -.1197307    .6119384
                    2008 2018  |   .3427077   .2165685     1.58   0.114    -.0817587    .7671741
                    2008 2019  |   .4053959   .1969094     2.06   0.040     .0194606    .7913313
                    2008 2020  |  -.0316381   .2404196    -0.13   0.895    -.5028519    .4395757
                    2008 2021  |   .0884778   .2299404     0.38   0.700    -.3621971    .5391526
                    2008 2022  |  -.0158841   .1750587    -0.09   0.928    -.3589928    .3272247
                   ...
                               |
                          gvar |
                         2007  |  -.9036458   .2270913    -3.98   0.000    -1.348737   -.4585549
                         2008  |  -2.813503    .366221    -7.68   0.000    -3.531283   -2.095723
                         2009  |  -.8256686   .6723811    -1.23   0.219    -2.143511    .4921741
                         2010  |   -.670526   .4202458    -1.60   0.111    -1.494193    .1531406
                         2011  |  -4.282981   .7295316    -5.87   0.000    -5.712837   -2.853125
                         2012  |  -2.909172   .5178238    -5.62   0.000    -3.924088   -1.894257
                         2013  |  -2.982588   .5732818    -5.20   0.000      -4.1062   -1.858977
                         2014  |    -.79886   .6277028    -1.27   0.203    -2.029135    .4314148
                         2015  |   .2815186   .1695168     1.66   0.097    -.0507281    .6137654
                         2016  |  -.6560692   .3570693    -1.84   0.066    -1.355912    .0437738
                         2017  |  -2.054207   .2851338    -7.20   0.000    -2.613059   -1.495355
                         2018  |  -1.226922   .6882977    -1.78   0.075     -2.57596     .122117
                         2019  |  -.4714025   .3955197    -1.19   0.233    -1.246607    .3038018
                         2021  |  -2.030303   .2375551    -8.55   0.000    -2.495903   -1.564704
                         2022  |  -18.77198   1.016281   -18.47   0.000    -20.76386   -16.78011
                               |
                          year |
                         2007  |   .0685701   .0266665     2.57   0.010     .0163048    .1208354
                         2008  |   .2119269   .0317513     6.67   0.000     .1496956    .2741583
                         2009  |   .2531076   .0360605     7.02   0.000     .1824304    .3237849
                         2010  |   .3691122   .0341007    10.82   0.000      .302276    .4359484
                         2011  |   .4421713   .0443503     9.97   0.000     .3552464    .5290962
                         2012  |   .5727464   .0403995    14.18   0.000     .4935648     .651928
                         2013  |   .5862363   .0392537    14.93   0.000     .5093004    .6631721
                         2014  |   .5752451   .0506496    11.36   0.000     .4759736    .6745166
                         2015  |   .5614244   .0609941     9.20   0.000     .4418781    .6809707
                         2016  |   .5151881   .0641983     8.02   0.000     .3893617    .6410144
                         2017  |   .4910489    .071186     6.90   0.000     .3515269    .6305708
                         2018  |   .4893021   .0725441     6.74   0.000     .3471183    .6314859
                         2019  |    .504914   .0757538     6.67   0.000     .3564393    .6533886
                         2020  |   .6012848   .0717728     8.38   0.000     .4606128    .7419568
                         2021  |   .5871174   .0759046     7.73   0.000     .4383471    .7358877
                         2022  |   .5855308   .0826702     7.08   0.000     .4235001    .7475614
                               |
                         _cons |   3.913927   .1864287    20.99   0.000     3.548533    4.279321
            ------------------------------------------------------------------------------------

            Comment


            • #7
              without never, there is no pretreatment estimates.
              and for Summary measures look into post estimation
              estat simple
              ... event
              etc

              Comment


              • #8
                Dear FernandoRios, thanks for your help. Just a couple of questions for clarification.

                1. Summary measures are not working, since as you can see in #6 (right after the first table) all give error. In fact, following the commands in your paper (The European Single Market and Intra-EU Trade: An Assessment with
                Heterogeneity-Robust Di¤erence-in-Di¤erences Methods) for the pre treatment graph in Figure 4, I got the following error.
                Code:
                . estat event, predict(xb) pretrend window(-4 -1)
                varlist required
                What can I do?

                2. Without "never" option we cannot test parallel trend because there is no pre treatment estimates? That would only be for the first treated year, right? For the following ones, not yet treated should be the controls.

                3. What is "gvar" (2007, 2008, 2009,...) in the estimation table? Is it the average of treatment effects for that year (e.g. 2007)? Which I do not think since most of the effects from 2007 are positive, and gvar==2007 is -.9036458.
                Or is it the pre treatment effect (e.g. for treated obs in 2008, it would be the effect in 2006 and 2007, I mean before treatment effect)?

                4. Finally, if the effect I am studying is supposed to be delayed by 2 years (it is not possible that treatment have an effect on the current and 2 following years) which in a regular estimation would imply to lag the indep. by 2 years. How could I make it here for the treatment?

                Thanks a lot in advance for your help, I really appreciate it!

                Comment


                • #9
                  1) did you download the latest version ? and did you run this for a model with the -never- option?
                  2) You would think so. If you run different models for each cohort, then yes, you can have the notyet-treated as controls and test PTA with not-yet treated. But jwdid runs a single model. In that one, you either have a never group and can do PTA, or you cant
                  you could drop the last treated unit (units) and make them your Never treated.
                  3) Gvar is the year of treatment. Ids the cohorts treated in the given year. In the output of jwdid its just your control. DO NOT interpret it.
                  4) Empirical question. Its not supposed to have an effect. But does it? I would just show what you see
                  F

                  On an added note. Perhaps would be easier if you go and do the examples Wooldridge has, the outputs he obtains, and how they are interpreted or aggregated. once you get an idea of how that is done by hand, you can come back to jwdid.

                  Comment


                  • #10
                    Dear FernandoRios, thanks again for your patience and help. Yes, the estimation was done with the "never" option, and yet it gives error for all post estimation commands (see below with the versions of the commands I am using).

                    I assume your suggestion is about the paper: "Two-Way Fixed Effects, the Two-Way Mundlak Regression, and Event Study Estimators"?

                    Thanks again! and sorry for bothering you with this issue.

                    Code:
                    . jwdid y1 , ivar(id) tvar( year ) gvar( gvar ) cluster(id) method(poisson) never
                    
                    Iteration 0:   log pseudolikelihood = -136751.25  
                    Iteration 1:   log pseudolikelihood = -136304.66  
                    Iteration 2:   log pseudolikelihood = -136284.07  
                    Iteration 3:   log pseudolikelihood =  -136282.1  
                    Iteration 4:   log pseudolikelihood = -136281.65  
                    Iteration 5:   log pseudolikelihood = -136281.55  
                    Iteration 6:   log pseudolikelihood = -136281.54  
                    Iteration 7:   log pseudolikelihood = -136281.53  
                    Iteration 8:   log pseudolikelihood = -136281.53  
                    Iteration 9:   log pseudolikelihood = -136281.53  
                    Iteration 10:  log pseudolikelihood = -136281.53  
                    
                    Poisson regression                              Number of obs     =      4,658
                                                                    Wald chi2(105)    =          .
                    Log pseudolikelihood = -136281.53               Prob > chi2       =          .
                    
                                                             (Std. Err. adjusted for 274 clusters in id)
                    ------------------------------------------------------------------------------------
                                       |               Robust
                                    y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                    -------------------+----------------------------------------------------------------
                    gvar#year#c.__tr__ |
                            2007 2007  |  -.0012211    .041371    -0.03   0.976    -.0823067    .0798644
                            2007 2008  |    .006277   .0558234     0.11   0.910    -.1031348    .1156888
                            2007 2009  |   .0526769   .0637276     0.83   0.408    -.0722268    .1775807
                            2007 2010  |   .0495766   .0644345     0.77   0.442    -.0767127    .1758658
                            2007 2011  |   .1139195   .0698947     1.63   0.103    -.0230717    .2509106
                            2007 2012  |   .0965426   .0692677     1.39   0.163    -.0392195    .2323048
                            2007 2013  |   .1419741   .0763223     1.86   0.063    -.0076149    .2915631
                            2007 2014  |   .1070115   .0753259     1.42   0.155    -.0406245    .2546475
                            2007 2015  |   .1122059   .0855444     1.31   0.190    -.0554581    .2798698
                            2007 2016  |    .180082   .0890051     2.02   0.043     .0056352    .3545289
                            2007 2017  |   .1544662   .0960708     1.61   0.108    -.0338292    .3427616
                            2007 2018  |   .1950995   .0966693     2.02   0.044     .0056311    .3845679
                            2007 2019  |   .2442002   .1073682     2.27   0.023     .0337624    .4546381
                            2007 2020  |   .1383449   .1037845     1.33   0.183     -.065069    .3417588
                            2007 2021  |   .1266329    .115213     1.10   0.272    -.0991804    .3524462
                            2007 2022  |    .124676   .1125068     1.11   0.268    -.0958333    .3451853
                            2008 2006  |   -.184138   .1358563    -1.36   0.175    -.4504114    .0821355
                            2008 2008  |   .0739491   .1612901     0.46   0.647    -.2421736    .3900718
                            2008 2009  |   .2241654   .1462799     1.53   0.125    -.0625378    .5108687
                            2008 2010  |   .6923536   .3117992     2.22   0.026     .0812383    1.303469
                            2008 2011  |   .2748804   .1870845     1.47   0.142    -.0917985    .6415593
                            2008 2012  |   .0201572   .1757316     0.11   0.909    -.3242705    .3645849
                            2008 2013  |   .1409165   .1369033     1.03   0.303    -.1274091     .409242
                            2008 2014  |   .2657737   .1629546     1.63   0.103    -.0536114    .5851588
                            2008 2015  |   .1194478   .1296474     0.92   0.357    -.1346565    .3735521
                            2008 2016  |    .155102   .1549376     1.00   0.317    -.1485702    .4587743
                            2008 2017  |   .2461039   .1866537     1.32   0.187    -.1197307    .6119384
                            2008 2018  |   .3427077   .2165685     1.58   0.114    -.0817587    .7671741
                            2008 2019  |   .4053959   .1969094     2.06   0.040     .0194606    .7913313
                            2008 2020  |  -.0316381   .2404196    -0.13   0.895    -.5028519    .4395757
                            2008 2021  |   .0884778   .2299404     0.38   0.700    -.3621971    .5391526
                            2008 2022  |  -.0158841   .1750587    -0.09   0.928    -.3589928    .3272247
                            2009 2006  |  -.0298274   .0391418    -0.76   0.446    -.1065438    .0468891
                            2009 2007  |   .0430447   .0429254     1.00   0.316    -.0410875     .127177
                            2009 2009  |     .01163   .0461666     0.25   0.801    -.0788548    .1021148
                            2009 2010  |    .187927   .0518201     3.63   0.000     .0863615    .2894924
                            2009 2011  |   .0915567   .0631499     1.45   0.147    -.0322147    .2153282
                            2009 2012  |   .0219762   .0586309     0.37   0.708    -.0929383    .1368907
                            2009 2013  |   .1110322   .0597409     1.86   0.063    -.0060578    .2281222
                            2009 2014  |   .1561474   .0641004     2.44   0.015      .030513    .2817818
                            2009 2015  |   .1291461   .0639351     2.02   0.043     .0038356    .2544566
                            2009 2016  |   .1887338   .0734648     2.57   0.010     .0447453    .3327222
                            2009 2017  |   .1750307   .0713285     2.45   0.014     .0352294    .3148319
                            2009 2018  |   .1767774   .0806936     2.19   0.028     .0186209    .3349339
                            2009 2019  |      .2226   .0845602     2.63   0.008      .056865     .388335
                            2009 2020  |   .1926279   .0844353     2.28   0.023     .0271378     .358118
                            2009 2021  |   .1286701   .0839687     1.53   0.125    -.0359054    .2932457
                            2009 2022  |   .1497252    .081499     1.84   0.066      -.01001    .3094603
                            2010 2006  |   .0310453   .0722825     0.43   0.668    -.1106259    .1727164
                            2010 2007  |  -.0161336   .0784137    -0.21   0.837    -.1698218    .1375545
                            2010 2008  |  -.0352612   .0827158    -0.43   0.670    -.1973812    .1268589
                            2010 2010  |   .1251577   .0854494     1.46   0.143    -.0423201    .2926354
                            2010 2011  |   .1584789   .0633388     2.50   0.012     .0343371    .2826206
                            2010 2012  |  -.1025741    .148699    -0.69   0.490    -.3940188    .1888707
                            2010 2013  |   .0937505   .1206582     0.78   0.437    -.1427351    .3302362
                            2010 2014  |   .1408065   .1340068     1.05   0.293    -.1218419    .4034549
                            2010 2015  |   .1946859    .095983     2.03   0.043     .0065626    .3828091
                            2010 2016  |   .2224277   .1048046     2.12   0.034     .0170145    .4278408
                            2010 2017  |    .139724   .1120615     1.25   0.212    -.0799125    .3593605
                            2010 2018  |    .242966    .079395     3.06   0.002     .0873546    .3985774
                            2010 2019  |   .2327018   .1422825     1.64   0.102    -.0461667    .5115703
                            2010 2020  |   .2520374   .1011204     2.49   0.013      .053845    .4502298
                            2010 2021  |   .3057908    .087399     3.50   0.000     .1344919    .4770896
                            2010 2022  |   .2437519   .0960408     2.54   0.011     .0555153    .4319885
                            2011 2006  |  -.3237115   .0341023    -9.49   0.000    -.3905508   -.2568723
                            2011 2007  |   .3005421   .0346818     8.67   0.000      .232567    .3685172
                            2011 2008  |   .5625943   .9451179     0.60   0.552    -1.289803    2.414991
                            2011 2009  |  -.5768192   .0264462   -21.81   0.000    -.6286527   -.5249856
                            2011 2011  |   .3323499   1.417108     0.23   0.815    -2.445131    3.109831
                            2011 2012  |   .2017748   .4727633     0.43   0.670    -.7248242    1.128374
                            2011 2013  |   1.286903     .47316     2.72   0.007     .3595262    2.214279
                            2011 2014  |   1.403255   .4265092     3.29   0.001     .5673124    2.239198
                            2011 2015  |   1.417076   .7099198     2.00   0.046     .0256586    2.808493
                            2011 2016  |   1.933313   .3577181     5.40   0.000     1.232199    2.634428
                            2011 2017  |   1.130771   .8116218     1.39   0.164    -.4599781    2.721521
                            2011 2018  |   1.894661   .3821097     4.96   0.000      1.14574    2.643583
                            2011 2019  |   1.655908   .3596876     4.60   0.000      .950933    2.360883
                            2011 2020  |   1.020535   .6100012     1.67   0.094    -.1750449    2.216116
                            2011 2021  |   1.653747   .7654332     2.16   0.031     .1535251    3.153968
                            2011 2022  |   1.655333    .549738     3.01   0.003     .5778664      2.7328
                            2012 2006  |   .3815458   .2070123     1.84   0.065     -.024191    .7872825
                            2012 2007  |  -.1570383   .3216285    -0.49   0.625    -.7874186     .473342
                            2012 2008  |   .2874035   .4382225     0.66   0.512    -.5714968    1.146304
                            2012 2009  |   .2462228   .2862867     0.86   0.390    -.3148889    .8073345
                            2012 2010  |   .2355795   .3534381     0.67   0.505    -.4571465    .9283055
                            2012 2012  |  -.7665766   .2979287    -2.57   0.010    -1.350506   -.1826471
                            2012 2013  |   .0184554   .1097316     0.17   0.866    -.1966145    .2335254
                            2012 2014  |   .2117681   .2603968     0.81   0.416    -.2986002    .7221365
                            2012 2015  |  -.1798787   .2943681    -0.61   0.541    -.7568294    .3970721
                            2012 2016  |   .2292657    .132845     1.73   0.084    -.0311058    .4896371
                            2012 2017  |  -.2430371   .1585356    -1.53   0.125    -.5537612    .0676869
                            2012 2018  |   .3777533   .2119204     1.78   0.075     -.037603    .7931096
                            2012 2019  |  -.2569022   .2127651    -1.21   0.227    -.6739143    .1601098
                            2012 2020  |   .0521972    .219768     0.24   0.812    -.3785402    .4829346
                            2012 2021  |   -.087787   .1437393    -0.61   0.541    -.3695108    .1939368
                            2012 2022  |   .1144713   .5009149     0.23   0.819     -.867304    1.096247
                            2013 2006  |  -.7081763   .4005991    -1.77   0.077    -1.493336    .0769836
                            2013 2007  |  -.7767465    .177567    -4.37   0.000    -1.124771   -.4287215
                            2013 2008  |  -.9201032   .3274066    -2.81   0.005    -1.561808   -.2783981
                            2013 2009  |  -1.471974   .3264106    -4.51   0.000    -2.111727   -.8322209
                            2013 2010  |  -.6073099    .576497    -1.05   0.292    -1.737223    .5226035
                            2013 2011  |   .1305751   .1143802     1.14   0.254    -.0936059    .3547561
                            2013 2013  |  -.3389182    .240213    -1.41   0.158     -.809727    .1318906
                            2013 2014  |  -.2538174    .140161    -1.81   0.070    -.5285278    .0208931
                            2013 2015  |  -.4811645   .1216254    -3.96   0.000    -.7195458   -.2427831
                            2013 2016  |  -.7533858   .3053157    -2.47   0.014    -1.351794   -.1549781
                            2013 2017  |  -.7292466   .0830997    -8.78   0.000     -.892119   -.5663741
                            2013 2018  |  -.3220287   .1697984    -1.90   0.058    -.6548275      .01077
                            2013 2019  |  -.2575959   .1742992    -1.48   0.139     -.599216    .0840242
                            2013 2020  |   .1256132    .229262     0.55   0.584     -.323732    .5749584
                            2013 2021  |   .5609914   .1755743     3.20   0.001     .2168722    .9051106
                            2013 2022  |   .1413672   .1032552     1.37   0.171    -.0610092    .3437436
                            2014 2006  |  -.2818535   .0448078    -6.29   0.000    -.3696752   -.1940317
                            2014 2007  |   -.115584   .0531181    -2.18   0.030    -.2196937   -.0114744
                            2014 2008  |  -.0128072   .0437898    -0.29   0.770    -.0986337    .0730192
                            2014 2009  |   .1871746   .0615461     3.04   0.002     .0665464    .3078028
                            2014 2010  |    .288583   .0935012     3.09   0.002     .1053239     .471842
                            2014 2011  |   .0536808   .0409936     1.31   0.190    -.0266651    .1340268
                            2014 2012  |   .1188503   .0480738     2.47   0.013     .0246273    .2130733
                            2014 2014  |  -.0659699   .0736766    -0.90   0.371    -.2103735    .0784337
                            2014 2015  |  -.1069575   .0477074    -2.24   0.025    -.2004623   -.0134527
                            2014 2016  |  -.4947606   .0653236    -7.57   0.000    -.6227925   -.3667286
                            2014 2017  |  -.4926003   .0589371    -8.36   0.000    -.6081149   -.3770857
                            2014 2018  |   -.346272   .1028455    -3.37   0.001    -.5478454   -.1446986
                            2014 2019  |  -.2187827    .081529    -2.68   0.007    -.3785766   -.0589888
                            2014 2020  |  -.5593511    .071059    -7.87   0.000    -.6986242   -.4200779
                            2014 2021  |  -.4440873   .1291075    -3.44   0.001    -.6971334   -.1910413
                            2014 2022  |  -.2040891   .0881774    -2.31   0.021    -.3769136   -.0312647
                            2015 2006  |   .0672344   .0506496     1.33   0.184    -.0320371    .1665059
                            2015 2007  |  -.1208806   .0545615    -2.22   0.027    -.2278193    -.013942
                            2015 2008  |  -.0766391   .0473113    -1.62   0.105    -.1693675    .0160893
                            2015 2009  |   .2148893    .037556     5.72   0.000     .1412808    .2884978
                            2015 2010  |    .255731     .03583     7.14   0.000     .1855054    .3259566
                            2015 2011  |   .0352156   .0288748     1.22   0.223     -.021378    .0918091
                            2015 2012  |   .0024987   .0283973     0.09   0.930     -.053159    .0581564
                            2015 2013  |   .1383076   .0302798     4.57   0.000     .0789602    .1976549
                            2015 2015  |   .1183356   .0269265     4.39   0.000     .0655606    .1711105
                            2015 2016  |   .1645719   .0313722     5.25   0.000     .1030836    .2260602
                            2015 2017  |  -.1326161    .034799    -3.81   0.000    -.2008209   -.0644113
                            2015 2018  |   .1274437   .0370114     3.44   0.001     .0549026    .1999848
                            2015 2019  |   .2269026   .0455315     4.98   0.000     .1376625    .3161427
                            2015 2020  |  -.2220177   .0443174    -5.01   0.000    -.3088783   -.1351571
                            2015 2021  |   .0926426   .0475419     1.95   0.051    -.0005379    .1858231
                            2015 2022  |  -.3383247   .0592852    -5.71   0.000    -.4545216   -.2221278
                            2016 2006  |  -.3362333   .1269012    -2.65   0.008     -.584955   -.0875116
                            2016 2007  |  -.4281508   .1466991    -2.92   0.004    -.7156758   -.1406259
                            2016 2008  |   -.309749   .1699084    -1.82   0.068    -.6427633    .0232653
                            2016 2009  |  -.4264374   .1040682    -4.10   0.000    -.6304074   -.2224674
                            2016 2010  |  -.2257717   .1236972    -1.83   0.068    -.4682138    .0166705
                            2016 2011  |  -.2753002   .0873893    -3.15   0.002    -.4465801   -.1040204
                            2016 2012  |  -.3126814   .1366432    -2.29   0.022    -.5804971   -.0448657
                            2016 2013  |   -.144556    .069435    -2.08   0.037    -.2806461   -.0084658
                            2016 2014  |   -.052164   .0472585    -1.10   0.270     -.144789     .040461
                            2016 2016  |  -.0841651   .0561339    -1.50   0.134    -.1941855    .0258553
                            2016 2017  |   .1311845   .0963721     1.36   0.173    -.0577014    .3200703
                            2016 2018  |   .0140415   .1893806     0.07   0.941    -.3571377    .3852207
                            2016 2019  |   .0149045   .2871782     0.05   0.959    -.5479545    .5777635
                            2016 2020  |   .0179943   .2995585     0.06   0.952    -.5691295    .6051181
                            2016 2021  |  -.0163326   .3030386    -0.05   0.957    -.6102772    .5776121
                            2016 2022  |   .0128209    .222483     0.06   0.954    -.4232378    .4488795
                            2017 2006  |  -.5051693   .3011263    -1.68   0.093    -1.095366    .0850273
                            2017 2007  |  -.1365227   .2872968    -0.48   0.635     -.699614    .4265686
                            2017 2008  |  -.1080305   .1899604    -0.57   0.570     -.480346    .2642849
                            2017 2009  |   -.203278   .2615212    -0.78   0.437      -.71585    .3092941
                            2017 2010  |  -.0316035   .2139265    -0.15   0.883    -.4508918    .3876849
                            2017 2011  |  -.0772639   .1440553    -0.54   0.592     -.359607    .2050792
                            2017 2012  |   .2242909   .2102071     1.07   0.286    -.1877074    .6362891
                            2017 2013  |   .0697232   .1014888     0.69   0.492    -.1291911    .2686376
                            2017 2014  |  -.0035453   .1415909    -0.03   0.980    -.2810584    .2739678
                            2017 2015  |   .1722436   .1097651     1.57   0.117     -.042892    .3873792
                            2017 2017  |   .1947634   .1470721     1.32   0.185    -.0934927    .4830194
                            2017 2018  |   .1358859   .2564272     0.53   0.596    -.3667022    .6384741
                            2017 2019  |   .3266094    .188079     1.74   0.082    -.0420187    .6952374
                            2017 2020  |   .1869419   .0863718     2.16   0.030     .0176563    .3562274
                            2017 2021  |   .3489183   .2439827     1.43   0.153     -.129279    .8271156
                            2017 2022  |   .0904292    .223191     0.41   0.685    -.3470171    .5278756
                            2018 2006  |   .1163553   .1270562     0.92   0.360    -.1326703    .3653809
                            2018 2007  |  -.0643318   .1354436    -0.47   0.635    -.3297964    .2011328
                            2018 2008  |   .0455068    .100453     0.45   0.651    -.1513774     .242391
                            2018 2009  |  -.0637273   .0713436    -0.89   0.372    -.2035583    .0761037
                            2018 2010  |  -.0479626   .1142815    -0.42   0.675    -.2719503    .1760251
                            2018 2011  |  -.2388047   .1141059    -2.09   0.036    -.4624482   -.0151613
                            2018 2012  |   -.102751   .0954831    -1.08   0.282    -.2898945    .0843925
                            2018 2013  |   -.290088   .0791204    -3.67   0.000    -.4451611   -.1350148
                            2018 2014  |  -.1052497   .0721934    -1.46   0.145    -.2467462    .0362468
                            2018 2015  |  -.0497562   .0965553    -0.52   0.606    -.2390012    .1394888
                            2018 2016  |   .1651032   .0777572     2.12   0.034     .0127019    .3175046
                            2018 2018  |   .0913591   .0592046     1.54   0.123    -.0246799     .207398
                            2018 2019  |  -.1714943   .0475997    -3.60   0.000    -.2647879   -.0782007
                            2018 2020  |  -.2557437   .1635264    -1.56   0.118    -.5762495     .064762
                            2018 2021  |  -.0857057   .1277322    -0.67   0.502    -.3360562    .1646447
                            2018 2022  |  -.0944819   .1677549    -0.56   0.573    -.4232754    .2343116
                            2019 2006  |  -.3514818   .0725526    -4.84   0.000    -.4936824   -.2092813
                            2019 2007  |  -.3612114   .0831749    -4.34   0.000    -.5242311   -.1981916
                            2019 2008  |  -.1183336    .071667    -1.65   0.099    -.2587984    .0221312
                            2019 2009  |  -.2724549   .0862836    -3.16   0.002    -.4415677   -.1033422
                            2019 2010  |  -.2281165   .0836861    -2.73   0.006    -.3921384   -.0640947
                            2019 2011  |   .1042891   .0810871     1.29   0.198    -.0546387    .2632169
                            2019 2012  |  -.0449781   .0885682    -0.51   0.612    -.2185686    .1286125
                            2019 2013  |  -.0214268   .0623595    -0.34   0.731    -.1436492    .1007956
                            2019 2014  |  -.2643503   .0846595    -3.12   0.002      -.43028   -.0984207
                            2019 2015  |  -.1327468   .0294425    -4.51   0.000    -.1904531   -.0750405
                            2019 2016  |  -.2688318   .0289293    -9.29   0.000    -.3255322   -.2121315
                            2019 2017  |   .0676816   .1423721     0.48   0.635    -.2113625    .3467257
                            2019 2019  |  -.0221692   .0819731    -0.27   0.787    -.1828334     .138495
                            2019 2020  |   .0449648   .0910309     0.49   0.621    -.1334525     .223382
                            2019 2021  |  -.0530795   .0942266    -0.56   0.573    -.2377603    .1316013
                            2019 2022  |  -.0768106   .1045935    -0.73   0.463    -.2818102     .128189
                            2021 2006  |   .5731141   .1275994     4.49   0.000      .323024    .8232043
                            2021 2007  |   .7103948   .1704851     4.17   0.000     .3762501    1.044539
                            2021 2008  |   .6770385   .1220823     5.55   0.000     .4377616    .9163154
                            2021 2009  |   .4782295   .2640188     1.81   0.070    -.0392378    .9956967
                            2021 2010  |   .5606752   .1717463     3.26   0.001     .2240586    .8972918
                            2021 2011  |   .3597831   .1044853     3.44   0.001     .1549956    .5645705
                            2021 2012  |   .3962616   .2473143     1.60   0.109    -.0884654    .8809887
                            2021 2013  |   .3233484   .2189217     1.48   0.140    -.1057302    .7524271
                            2021 2014  |   .3137204    .209476     1.50   0.134     -.096845    .7242857
                            2021 2015  |   .2175405   .0858943     2.53   0.011     .0491907    .3858903
                            2021 2016  |   .5099094    .159295     3.20   0.001     .1976969    .8221218
                            2021 2017  |   .2155958   .2507715     0.86   0.390    -.2759073    .7070988
                            2021 2018  |   .2661324   .2557572     1.04   0.298    -.2351425    .7674073
                            2021 2019  |   .3840515   .1186873     3.24   0.001     .1514287    .6166743
                            2021 2021  |   .1918475   .0997414     1.92   0.054    -.0036419     .387337
                            2021 2022  |  -.0414039   .0978174    -0.42   0.672    -.2331224    .1503146
                            2022 2006  |   14.85811   1.004643    14.79   0.000     12.88905    16.82718
                            2022 2007  |   15.48263   1.004788    15.41   0.000     13.51328    17.45198
                            2022 2008  |   .3751905   .0664214     5.65   0.000     .2450069     .505374
                            2022 2009  |   15.29809   1.003533    15.24   0.000      13.3312    17.26498
                            2022 2010  |     14.489   1.003739    14.44   0.000     12.52171    16.45629
                            2022 2011  |   15.10903   1.003299    15.06   0.000      13.1426    17.07545
                            2022 2012  |   14.97845   1.003463    14.93   0.000      13.0117     16.9452
                            2022 2013  |   .0008811   .0624105     0.01   0.989    -.1214412    .1232034
                            2022 2014  |   14.97595   1.002964    14.93   0.000     13.01018    16.94172
                            2022 2015  |   14.98977   1.002477    14.95   0.000     13.02495    16.95459
                            2022 2016  |   .0719293   .0326599     2.20   0.028     .0079171    .1359415
                            2022 2017  |   .0960685   .0322337     2.98   0.003     .0328916    .1592455
                            2022 2018  |   14.36881    1.00218    14.34   0.000     12.40458    16.33305
                            2022 2019  |    14.3532   1.002326    14.32   0.000     12.38868    16.31772
                            2022 2020  |  -.0141674   .0257764    -0.55   0.583    -.0646882    .0363533
                            2022 2022  |   14.27258   1.002061    14.24   0.000     12.30858    16.23659
                                       |
                                  gvar |
                                 2007  |  -.9036458   .2270913    -3.98   0.000    -1.348737   -.4585549
                                 2008  |  -2.813503    .366221    -7.68   0.000    -3.531283   -2.095723
                                 2009  |  -.8256686   .6723811    -1.23   0.219    -2.143511    .4921741
                                 2010  |   -.670526   .4202458    -1.60   0.111    -1.494193    .1531406
                                 2011  |  -4.282981   .7295316    -5.87   0.000    -5.712837   -2.853125
                                 2012  |  -2.909172   .5178238    -5.62   0.000    -3.924088   -1.894257
                                 2013  |  -2.982588   .5732818    -5.20   0.000      -4.1062   -1.858977
                                 2014  |    -.79886   .6277028    -1.27   0.203    -2.029135    .4314148
                                 2015  |   .2815186   .1695168     1.66   0.097    -.0507281    .6137654
                                 2016  |  -.6560692   .3570693    -1.84   0.066    -1.355912    .0437738
                                 2017  |  -2.054207   .2851338    -7.20   0.000    -2.613059   -1.495355
                                 2018  |  -1.226922   .6882977    -1.78   0.075     -2.57596     .122117
                                 2019  |  -.4714025   .3955197    -1.19   0.233    -1.246607    .3038018
                                 2021  |  -2.030303   .2375551    -8.55   0.000    -2.495903   -1.564704
                                 2022  |  -18.77198   1.016281   -18.47   0.000    -20.76386   -16.78011
                                       |
                                  year |
                                 2007  |   .0685701   .0266665     2.57   0.010     .0163048    .1208354
                                 2008  |   .2119269   .0317513     6.67   0.000     .1496956    .2741583
                                 2009  |   .2531076   .0360605     7.02   0.000     .1824304    .3237849
                                 2010  |   .3691122   .0341007    10.82   0.000      .302276    .4359484
                                 2011  |   .4421713   .0443503     9.97   0.000     .3552464    .5290962
                                 2012  |   .5727464   .0403995    14.18   0.000     .4935648     .651928
                                 2013  |   .5862363   .0392537    14.93   0.000     .5093004    .6631721
                                 2014  |   .5752451   .0506496    11.36   0.000     .4759736    .6745166
                                 2015  |   .5614244   .0609941     9.20   0.000     .4418781    .6809707
                                 2016  |   .5151881   .0641983     8.02   0.000     .3893617    .6410144
                                 2017  |   .4910489    .071186     6.90   0.000     .3515269    .6305708
                                 2018  |   .4893021   .0725441     6.74   0.000     .3471183    .6314859
                                 2019  |    .504914   .0757538     6.67   0.000     .3564393    .6533886
                                 2020  |   .6012848   .0717728     8.38   0.000     .4606128    .7419568
                                 2021  |   .5871174   .0759046     7.73   0.000     .4383471    .7358877
                                 2022  |   .5855308   .0826702     7.08   0.000     .4235001    .7475614
                                       |
                                 _cons |   3.913927   .1864287    20.99   0.000     3.548533    4.279321
                    ------------------------------------------------------------------------------------
                    
                    . estat event, predict(xb) pretrend window(-4 -1)
                    varlist required
                    
                    . 
                    end of do-file
                    
                    . which reghdfe
                    C:\Users\d\ado\plus\r\reghdfe.ado
                    *! version 6.12.3 08aug2023
                    
                    . which jwdid
                    C:\Users\d\ado\plus\j\jwdid.ado
                    *!v2.00 Paper Out

                    Comment


                    • #11
                      Try without window and without pretrend
                      i don’t have that issue on my end so have no idea why it’s happening

                      Comment


                      • #12
                        Dear FernandoRios, I tried your suggestion but as you see below, it did not worked. I found this other Statalist post (Obtaining main results after jwdid - Statalist) talking about the same issue, but there is no solution there. I suppose that after the command, all variables for post estimation must be created, but in my case it only creates 3 (see also below the summary for them plus gvar).

                        Any suggestion?

                        Code:
                        . jwdid y1 , ivar(id) tvar( year ) gvar( gvar ) cluster(id) method(poisson) never
                        
                        Iteration 0:   log pseudolikelihood = -136751.25  
                        Iteration 1:   log pseudolikelihood = -136304.66  
                        Iteration 2:   log pseudolikelihood = -136284.07  
                        Iteration 3:   log pseudolikelihood =  -136282.1  
                        Iteration 4:   log pseudolikelihood = -136281.65  
                        Iteration 5:   log pseudolikelihood = -136281.55  
                        Iteration 6:   log pseudolikelihood = -136281.54  
                        Iteration 7:   log pseudolikelihood = -136281.53  
                        Iteration 8:   log pseudolikelihood = -136281.53  
                        Iteration 9:   log pseudolikelihood = -136281.53  
                        Iteration 10:  log pseudolikelihood = -136281.53  
                        
                        Poisson regression                              Number of obs     =      4,658
                                                                        Wald chi2(105)    =          .
                        Log pseudolikelihood = -136281.53               Prob > chi2       =          .
                        
                                                                 (Std. Err. adjusted for 274 clusters in id)
                        ------------------------------------------------------------------------------------
                                           |               Robust
                                        y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                        -------------------+----------------------------------------------------------------
                        gvar#year#c.__tr__ |
                                2007 2007  |  -.0012211    .041371    -0.03   0.976    -.0823067    .0798644
                                2007 2008  |    .006277   .0558234     0.11   0.910    -.1031348    .1156888
                                2007 2009  |   .0526769   .0637276     0.83   0.408    -.0722268    .1775807
                                2007 2010  |   .0495766   .0644345     0.77   0.442    -.0767127    .1758658
                                2007 2011  |   .1139195   .0698947     1.63   0.103    -.0230717    .2509106
                                2007 2012  |   .0965426   .0692677     1.39   0.163    -.0392195    .2323048
                                2007 2013  |   .1419741   .0763223     1.86   0.063    -.0076149    .2915631
                                2007 2014  |   .1070115   .0753259     1.42   0.155    -.0406245    .2546475
                                2007 2015  |   .1122059   .0855444     1.31   0.190    -.0554581    .2798698
                                2007 2016  |    .180082   .0890051     2.02   0.043     .0056352    .3545289
                                2007 2017  |   .1544662   .0960708     1.61   0.108    -.0338292    .3427616
                                2007 2018  |   .1950995   .0966693     2.02   0.044     .0056311    .3845679
                                2007 2019  |   .2442002   .1073682     2.27   0.023     .0337624    .4546381
                                2007 2020  |   .1383449   .1037845     1.33   0.183     -.065069    .3417588
                                2007 2021  |   .1266329    .115213     1.10   0.272    -.0991804    .3524462
                                2007 2022  |    .124676   .1125068     1.11   0.268    -.0958333    .3451853
                                2008 2006  |   -.184138   .1358563    -1.36   0.175    -.4504114    .0821355
                                2008 2008  |   .0739491   .1612901     0.46   0.647    -.2421736    .3900718
                                2008 2009  |   .2241654   .1462799     1.53   0.125    -.0625378    .5108687
                                2008 2010  |   .6923536   .3117992     2.22   0.026     .0812383    1.303469
                                2008 2011  |   .2748804   .1870845     1.47   0.142    -.0917985    .6415593
                                2008 2012  |   .0201572   .1757316     0.11   0.909    -.3242705    .3645849
                                2008 2013  |   .1409165   .1369033     1.03   0.303    -.1274091     .409242
                                2008 2014  |   .2657737   .1629546     1.63   0.103    -.0536114    .5851588
                                2008 2015  |   .1194478   .1296474     0.92   0.357    -.1346565    .3735521
                                2008 2016  |    .155102   .1549376     1.00   0.317    -.1485702    .4587743
                                2008 2017  |   .2461039   .1866537     1.32   0.187    -.1197307    .6119384
                                2008 2018  |   .3427077   .2165685     1.58   0.114    -.0817587    .7671741
                                2008 2019  |   .4053959   .1969094     2.06   0.040     .0194606    .7913313
                                2008 2020  |  -.0316381   .2404196    -0.13   0.895    -.5028519    .4395757
                                2008 2021  |   .0884778   .2299404     0.38   0.700    -.3621971    .5391526
                                2008 2022  |  -.0158841   .1750587    -0.09   0.928    -.3589928    .3272247
                                2009 2006  |  -.0298274   .0391418    -0.76   0.446    -.1065438    .0468891
                                2009 2007  |   .0430447   .0429254     1.00   0.316    -.0410875     .127177
                                2009 2009  |     .01163   .0461666     0.25   0.801    -.0788548    .1021148
                                2009 2010  |    .187927   .0518201     3.63   0.000     .0863615    .2894924
                                2009 2011  |   .0915567   .0631499     1.45   0.147    -.0322147    .2153282
                                2009 2012  |   .0219762   .0586309     0.37   0.708    -.0929383    .1368907
                                2009 2013  |   .1110322   .0597409     1.86   0.063    -.0060578    .2281222
                                2009 2014  |   .1561474   .0641004     2.44   0.015      .030513    .2817818
                                2009 2015  |   .1291461   .0639351     2.02   0.043     .0038356    .2544566
                                2009 2016  |   .1887338   .0734648     2.57   0.010     .0447453    .3327222
                                2009 2017  |   .1750307   .0713285     2.45   0.014     .0352294    .3148319
                                2009 2018  |   .1767774   .0806936     2.19   0.028     .0186209    .3349339
                                2009 2019  |      .2226   .0845602     2.63   0.008      .056865     .388335
                                2009 2020  |   .1926279   .0844353     2.28   0.023     .0271378     .358118
                                2009 2021  |   .1286701   .0839687     1.53   0.125    -.0359054    .2932457
                                2009 2022  |   .1497252    .081499     1.84   0.066      -.01001    .3094603
                                2010 2006  |   .0310453   .0722825     0.43   0.668    -.1106259    .1727164
                                2010 2007  |  -.0161336   .0784137    -0.21   0.837    -.1698218    .1375545
                                2010 2008  |  -.0352612   .0827158    -0.43   0.670    -.1973812    .1268589
                                2010 2010  |   .1251577   .0854494     1.46   0.143    -.0423201    .2926354
                                2010 2011  |   .1584789   .0633388     2.50   0.012     .0343371    .2826206
                                2010 2012  |  -.1025741    .148699    -0.69   0.490    -.3940188    .1888707
                                2010 2013  |   .0937505   .1206582     0.78   0.437    -.1427351    .3302362
                                2010 2014  |   .1408065   .1340068     1.05   0.293    -.1218419    .4034549
                                2010 2015  |   .1946859    .095983     2.03   0.043     .0065626    .3828091
                                2010 2016  |   .2224277   .1048046     2.12   0.034     .0170145    .4278408
                                2010 2017  |    .139724   .1120615     1.25   0.212    -.0799125    .3593605
                                2010 2018  |    .242966    .079395     3.06   0.002     .0873546    .3985774
                                2010 2019  |   .2327018   .1422825     1.64   0.102    -.0461667    .5115703
                                2010 2020  |   .2520374   .1011204     2.49   0.013      .053845    .4502298
                                2010 2021  |   .3057908    .087399     3.50   0.000     .1344919    .4770896
                                2010 2022  |   .2437519   .0960408     2.54   0.011     .0555153    .4319885
                                2011 2006  |  -.3237115   .0341023    -9.49   0.000    -.3905508   -.2568723
                                2011 2007  |   .3005421   .0346818     8.67   0.000      .232567    .3685172
                                2011 2008  |   .5625943   .9451179     0.60   0.552    -1.289803    2.414991
                                2011 2009  |  -.5768192   .0264462   -21.81   0.000    -.6286527   -.5249856
                                2011 2011  |   .3323499   1.417108     0.23   0.815    -2.445131    3.109831
                                2011 2012  |   .2017748   .4727633     0.43   0.670    -.7248242    1.128374
                                2011 2013  |   1.286903     .47316     2.72   0.007     .3595262    2.214279
                                2011 2014  |   1.403255   .4265092     3.29   0.001     .5673124    2.239198
                                2011 2015  |   1.417076   .7099198     2.00   0.046     .0256586    2.808493
                                2011 2016  |   1.933313   .3577181     5.40   0.000     1.232199    2.634428
                                2011 2017  |   1.130771   .8116218     1.39   0.164    -.4599781    2.721521
                                2011 2018  |   1.894661   .3821097     4.96   0.000      1.14574    2.643583
                                2011 2019  |   1.655908   .3596876     4.60   0.000      .950933    2.360883
                                2011 2020  |   1.020535   .6100012     1.67   0.094    -.1750449    2.216116
                                2011 2021  |   1.653747   .7654332     2.16   0.031     .1535251    3.153968
                                2011 2022  |   1.655333    .549738     3.01   0.003     .5778664      2.7328
                                2012 2006  |   .3815458   .2070123     1.84   0.065     -.024191    .7872825
                                2012 2007  |  -.1570383   .3216285    -0.49   0.625    -.7874186     .473342
                                2012 2008  |   .2874035   .4382225     0.66   0.512    -.5714968    1.146304
                                2012 2009  |   .2462228   .2862867     0.86   0.390    -.3148889    .8073345
                                2012 2010  |   .2355795   .3534381     0.67   0.505    -.4571465    .9283055
                                2012 2012  |  -.7665766   .2979287    -2.57   0.010    -1.350506   -.1826471
                                2012 2013  |   .0184554   .1097316     0.17   0.866    -.1966145    .2335254
                                2012 2014  |   .2117681   .2603968     0.81   0.416    -.2986002    .7221365
                                2012 2015  |  -.1798787   .2943681    -0.61   0.541    -.7568294    .3970721
                                2012 2016  |   .2292657    .132845     1.73   0.084    -.0311058    .4896371
                                2012 2017  |  -.2430371   .1585356    -1.53   0.125    -.5537612    .0676869
                                2012 2018  |   .3777533   .2119204     1.78   0.075     -.037603    .7931096
                                2012 2019  |  -.2569022   .2127651    -1.21   0.227    -.6739143    .1601098
                                2012 2020  |   .0521972    .219768     0.24   0.812    -.3785402    .4829346
                                2012 2021  |   -.087787   .1437393    -0.61   0.541    -.3695108    .1939368
                                2012 2022  |   .1144713   .5009149     0.23   0.819     -.867304    1.096247
                                2013 2006  |  -.7081763   .4005991    -1.77   0.077    -1.493336    .0769836
                                2013 2007  |  -.7767465    .177567    -4.37   0.000    -1.124771   -.4287215
                                2013 2008  |  -.9201032   .3274066    -2.81   0.005    -1.561808   -.2783981
                                2013 2009  |  -1.471974   .3264106    -4.51   0.000    -2.111727   -.8322209
                                2013 2010  |  -.6073099    .576497    -1.05   0.292    -1.737223    .5226035
                                2013 2011  |   .1305751   .1143802     1.14   0.254    -.0936059    .3547561
                                2013 2013  |  -.3389182    .240213    -1.41   0.158     -.809727    .1318906
                                2013 2014  |  -.2538174    .140161    -1.81   0.070    -.5285278    .0208931
                                2013 2015  |  -.4811645   .1216254    -3.96   0.000    -.7195458   -.2427831
                                2013 2016  |  -.7533858   .3053157    -2.47   0.014    -1.351794   -.1549781
                                2013 2017  |  -.7292466   .0830997    -8.78   0.000     -.892119   -.5663741
                                2013 2018  |  -.3220287   .1697984    -1.90   0.058    -.6548275      .01077
                                2013 2019  |  -.2575959   .1742992    -1.48   0.139     -.599216    .0840242
                                2013 2020  |   .1256132    .229262     0.55   0.584     -.323732    .5749584
                                2013 2021  |   .5609914   .1755743     3.20   0.001     .2168722    .9051106
                                2013 2022  |   .1413672   .1032552     1.37   0.171    -.0610092    .3437436
                                2014 2006  |  -.2818535   .0448078    -6.29   0.000    -.3696752   -.1940317
                                2014 2007  |   -.115584   .0531181    -2.18   0.030    -.2196937   -.0114744
                                2014 2008  |  -.0128072   .0437898    -0.29   0.770    -.0986337    .0730192
                                2014 2009  |   .1871746   .0615461     3.04   0.002     .0665464    .3078028
                                2014 2010  |    .288583   .0935012     3.09   0.002     .1053239     .471842
                                2014 2011  |   .0536808   .0409936     1.31   0.190    -.0266651    .1340268
                                2014 2012  |   .1188503   .0480738     2.47   0.013     .0246273    .2130733
                                2014 2014  |  -.0659699   .0736766    -0.90   0.371    -.2103735    .0784337
                                2014 2015  |  -.1069575   .0477074    -2.24   0.025    -.2004623   -.0134527
                                2014 2016  |  -.4947606   .0653236    -7.57   0.000    -.6227925   -.3667286
                                2014 2017  |  -.4926003   .0589371    -8.36   0.000    -.6081149   -.3770857
                                2014 2018  |   -.346272   .1028455    -3.37   0.001    -.5478454   -.1446986
                                2014 2019  |  -.2187827    .081529    -2.68   0.007    -.3785766   -.0589888
                                2014 2020  |  -.5593511    .071059    -7.87   0.000    -.6986242   -.4200779
                                2014 2021  |  -.4440873   .1291075    -3.44   0.001    -.6971334   -.1910413
                                2014 2022  |  -.2040891   .0881774    -2.31   0.021    -.3769136   -.0312647
                                2015 2006  |   .0672344   .0506496     1.33   0.184    -.0320371    .1665059
                                2015 2007  |  -.1208806   .0545615    -2.22   0.027    -.2278193    -.013942
                                2015 2008  |  -.0766391   .0473113    -1.62   0.105    -.1693675    .0160893
                                2015 2009  |   .2148893    .037556     5.72   0.000     .1412808    .2884978
                                2015 2010  |    .255731     .03583     7.14   0.000     .1855054    .3259566
                                2015 2011  |   .0352156   .0288748     1.22   0.223     -.021378    .0918091
                                2015 2012  |   .0024987   .0283973     0.09   0.930     -.053159    .0581564
                                2015 2013  |   .1383076   .0302798     4.57   0.000     .0789602    .1976549
                                2015 2015  |   .1183356   .0269265     4.39   0.000     .0655606    .1711105
                                2015 2016  |   .1645719   .0313722     5.25   0.000     .1030836    .2260602
                                2015 2017  |  -.1326161    .034799    -3.81   0.000    -.2008209   -.0644113
                                2015 2018  |   .1274437   .0370114     3.44   0.001     .0549026    .1999848
                                2015 2019  |   .2269026   .0455315     4.98   0.000     .1376625    .3161427
                                2015 2020  |  -.2220177   .0443174    -5.01   0.000    -.3088783   -.1351571
                                2015 2021  |   .0926426   .0475419     1.95   0.051    -.0005379    .1858231
                                2015 2022  |  -.3383247   .0592852    -5.71   0.000    -.4545216   -.2221278
                                2016 2006  |  -.3362333   .1269012    -2.65   0.008     -.584955   -.0875116
                                2016 2007  |  -.4281508   .1466991    -2.92   0.004    -.7156758   -.1406259
                                2016 2008  |   -.309749   .1699084    -1.82   0.068    -.6427633    .0232653
                                2016 2009  |  -.4264374   .1040682    -4.10   0.000    -.6304074   -.2224674
                                2016 2010  |  -.2257717   .1236972    -1.83   0.068    -.4682138    .0166705
                                2016 2011  |  -.2753002   .0873893    -3.15   0.002    -.4465801   -.1040204
                                2016 2012  |  -.3126814   .1366432    -2.29   0.022    -.5804971   -.0448657
                                2016 2013  |   -.144556    .069435    -2.08   0.037    -.2806461   -.0084658
                                2016 2014  |   -.052164   .0472585    -1.10   0.270     -.144789     .040461
                                2016 2016  |  -.0841651   .0561339    -1.50   0.134    -.1941855    .0258553
                                2016 2017  |   .1311845   .0963721     1.36   0.173    -.0577014    .3200703
                                2016 2018  |   .0140415   .1893806     0.07   0.941    -.3571377    .3852207
                                2016 2019  |   .0149045   .2871782     0.05   0.959    -.5479545    .5777635
                                2016 2020  |   .0179943   .2995585     0.06   0.952    -.5691295    .6051181
                                2016 2021  |  -.0163326   .3030386    -0.05   0.957    -.6102772    .5776121
                                2016 2022  |   .0128209    .222483     0.06   0.954    -.4232378    .4488795
                                2017 2006  |  -.5051693   .3011263    -1.68   0.093    -1.095366    .0850273
                                2017 2007  |  -.1365227   .2872968    -0.48   0.635     -.699614    .4265686
                                2017 2008  |  -.1080305   .1899604    -0.57   0.570     -.480346    .2642849
                                2017 2009  |   -.203278   .2615212    -0.78   0.437      -.71585    .3092941
                                2017 2010  |  -.0316035   .2139265    -0.15   0.883    -.4508918    .3876849
                                2017 2011  |  -.0772639   .1440553    -0.54   0.592     -.359607    .2050792
                                2017 2012  |   .2242909   .2102071     1.07   0.286    -.1877074    .6362891
                                2017 2013  |   .0697232   .1014888     0.69   0.492    -.1291911    .2686376
                                2017 2014  |  -.0035453   .1415909    -0.03   0.980    -.2810584    .2739678
                                2017 2015  |   .1722436   .1097651     1.57   0.117     -.042892    .3873792
                                2017 2017  |   .1947634   .1470721     1.32   0.185    -.0934927    .4830194
                                2017 2018  |   .1358859   .2564272     0.53   0.596    -.3667022    .6384741
                                2017 2019  |   .3266094    .188079     1.74   0.082    -.0420187    .6952374
                                2017 2020  |   .1869419   .0863718     2.16   0.030     .0176563    .3562274
                                2017 2021  |   .3489183   .2439827     1.43   0.153     -.129279    .8271156
                                2017 2022  |   .0904292    .223191     0.41   0.685    -.3470171    .5278756
                                2018 2006  |   .1163553   .1270562     0.92   0.360    -.1326703    .3653809
                                2018 2007  |  -.0643318   .1354436    -0.47   0.635    -.3297964    .2011328
                                2018 2008  |   .0455068    .100453     0.45   0.651    -.1513774     .242391
                                2018 2009  |  -.0637273   .0713436    -0.89   0.372    -.2035583    .0761037
                                2018 2010  |  -.0479626   .1142815    -0.42   0.675    -.2719503    .1760251
                                2018 2011  |  -.2388047   .1141059    -2.09   0.036    -.4624482   -.0151613
                                2018 2012  |   -.102751   .0954831    -1.08   0.282    -.2898945    .0843925
                                2018 2013  |   -.290088   .0791204    -3.67   0.000    -.4451611   -.1350148
                                2018 2014  |  -.1052497   .0721934    -1.46   0.145    -.2467462    .0362468
                                2018 2015  |  -.0497562   .0965553    -0.52   0.606    -.2390012    .1394888
                                2018 2016  |   .1651032   .0777572     2.12   0.034     .0127019    .3175046
                                2018 2018  |   .0913591   .0592046     1.54   0.123    -.0246799     .207398
                                2018 2019  |  -.1714943   .0475997    -3.60   0.000    -.2647879   -.0782007
                                2018 2020  |  -.2557437   .1635264    -1.56   0.118    -.5762495     .064762
                                2018 2021  |  -.0857057   .1277322    -0.67   0.502    -.3360562    .1646447
                                2018 2022  |  -.0944819   .1677549    -0.56   0.573    -.4232754    .2343116
                                2019 2006  |  -.3514818   .0725526    -4.84   0.000    -.4936824   -.2092813
                                2019 2007  |  -.3612114   .0831749    -4.34   0.000    -.5242311   -.1981916
                                2019 2008  |  -.1183336    .071667    -1.65   0.099    -.2587984    .0221312
                                2019 2009  |  -.2724549   .0862836    -3.16   0.002    -.4415677   -.1033422
                                2019 2010  |  -.2281165   .0836861    -2.73   0.006    -.3921384   -.0640947
                                2019 2011  |   .1042891   .0810871     1.29   0.198    -.0546387    .2632169
                                2019 2012  |  -.0449781   .0885682    -0.51   0.612    -.2185686    .1286125
                                2019 2013  |  -.0214268   .0623595    -0.34   0.731    -.1436492    .1007956
                                2019 2014  |  -.2643503   .0846595    -3.12   0.002      -.43028   -.0984207
                                2019 2015  |  -.1327468   .0294425    -4.51   0.000    -.1904531   -.0750405
                                2019 2016  |  -.2688318   .0289293    -9.29   0.000    -.3255322   -.2121315
                                2019 2017  |   .0676816   .1423721     0.48   0.635    -.2113625    .3467257
                                2019 2019  |  -.0221692   .0819731    -0.27   0.787    -.1828334     .138495
                                2019 2020  |   .0449648   .0910309     0.49   0.621    -.1334525     .223382
                                2019 2021  |  -.0530795   .0942266    -0.56   0.573    -.2377603    .1316013
                                2019 2022  |  -.0768106   .1045935    -0.73   0.463    -.2818102     .128189
                                2021 2006  |   .5731141   .1275994     4.49   0.000      .323024    .8232043
                                2021 2007  |   .7103948   .1704851     4.17   0.000     .3762501    1.044539
                                2021 2008  |   .6770385   .1220823     5.55   0.000     .4377616    .9163154
                                2021 2009  |   .4782295   .2640188     1.81   0.070    -.0392378    .9956967
                                2021 2010  |   .5606752   .1717463     3.26   0.001     .2240586    .8972918
                                2021 2011  |   .3597831   .1044853     3.44   0.001     .1549956    .5645705
                                2021 2012  |   .3962616   .2473143     1.60   0.109    -.0884654    .8809887
                                2021 2013  |   .3233484   .2189217     1.48   0.140    -.1057302    .7524271
                                2021 2014  |   .3137204    .209476     1.50   0.134     -.096845    .7242857
                                2021 2015  |   .2175405   .0858943     2.53   0.011     .0491907    .3858903
                                2021 2016  |   .5099094    .159295     3.20   0.001     .1976969    .8221218
                                2021 2017  |   .2155958   .2507715     0.86   0.390    -.2759073    .7070988
                                2021 2018  |   .2661324   .2557572     1.04   0.298    -.2351425    .7674073
                                2021 2019  |   .3840515   .1186873     3.24   0.001     .1514287    .6166743
                                2021 2021  |   .1918475   .0997414     1.92   0.054    -.0036419     .387337
                                2021 2022  |  -.0414039   .0978174    -0.42   0.672    -.2331224    .1503146
                                2022 2006  |   14.85811   1.004643    14.79   0.000     12.88905    16.82718
                                2022 2007  |   15.48263   1.004788    15.41   0.000     13.51328    17.45198
                                2022 2008  |   .3751905   .0664214     5.65   0.000     .2450069     .505374
                                2022 2009  |   15.29809   1.003533    15.24   0.000      13.3312    17.26498
                                2022 2010  |     14.489   1.003739    14.44   0.000     12.52171    16.45629
                                2022 2011  |   15.10903   1.003299    15.06   0.000      13.1426    17.07545
                                2022 2012  |   14.97845   1.003463    14.93   0.000      13.0117     16.9452
                                2022 2013  |   .0008811   .0624105     0.01   0.989    -.1214412    .1232034
                                2022 2014  |   14.97595   1.002964    14.93   0.000     13.01018    16.94172
                                2022 2015  |   14.98977   1.002477    14.95   0.000     13.02495    16.95459
                                2022 2016  |   .0719293   .0326599     2.20   0.028     .0079171    .1359415
                                2022 2017  |   .0960685   .0322337     2.98   0.003     .0328916    .1592455
                                2022 2018  |   14.36881    1.00218    14.34   0.000     12.40458    16.33305
                                2022 2019  |    14.3532   1.002326    14.32   0.000     12.38868    16.31772
                                2022 2020  |  -.0141674   .0257764    -0.55   0.583    -.0646882    .0363533
                                2022 2022  |   14.27258   1.002061    14.24   0.000     12.30858    16.23659
                                           |
                                      gvar |
                                     2007  |  -.9036458   .2270913    -3.98   0.000    -1.348737   -.4585549
                                     2008  |  -2.813503    .366221    -7.68   0.000    -3.531283   -2.095723
                                     2009  |  -.8256686   .6723811    -1.23   0.219    -2.143511    .4921741
                                     2010  |   -.670526   .4202458    -1.60   0.111    -1.494193    .1531406
                                     2011  |  -4.282981   .7295316    -5.87   0.000    -5.712837   -2.853125
                                     2012  |  -2.909172   .5178238    -5.62   0.000    -3.924088   -1.894257
                                     2013  |  -2.982588   .5732818    -5.20   0.000      -4.1062   -1.858977
                                     2014  |    -.79886   .6277028    -1.27   0.203    -2.029135    .4314148
                                     2015  |   .2815186   .1695168     1.66   0.097    -.0507281    .6137654
                                     2016  |  -.6560692   .3570693    -1.84   0.066    -1.355912    .0437738
                                     2017  |  -2.054207   .2851338    -7.20   0.000    -2.613059   -1.495355
                                     2018  |  -1.226922   .6882977    -1.78   0.075     -2.57596     .122117
                                     2019  |  -.4714025   .3955197    -1.19   0.233    -1.246607    .3038018
                                     2021  |  -2.030303   .2375551    -8.55   0.000    -2.495903   -1.564704
                                     2022  |  -18.77198   1.016281   -18.47   0.000    -20.76386   -16.78011
                                           |
                                      year |
                                     2007  |   .0685701   .0266665     2.57   0.010     .0163048    .1208354
                                     2008  |   .2119269   .0317513     6.67   0.000     .1496956    .2741583
                                     2009  |   .2531076   .0360605     7.02   0.000     .1824304    .3237849
                                     2010  |   .3691122   .0341007    10.82   0.000      .302276    .4359484
                                     2011  |   .4421713   .0443503     9.97   0.000     .3552464    .5290962
                                     2012  |   .5727464   .0403995    14.18   0.000     .4935648     .651928
                                     2013  |   .5862363   .0392537    14.93   0.000     .5093004    .6631721
                                     2014  |   .5752451   .0506496    11.36   0.000     .4759736    .6745166
                                     2015  |   .5614244   .0609941     9.20   0.000     .4418781    .6809707
                                     2016  |   .5151881   .0641983     8.02   0.000     .3893617    .6410144
                                     2017  |   .4910489    .071186     6.90   0.000     .3515269    .6305708
                                     2018  |   .4893021   .0725441     6.74   0.000     .3471183    .6314859
                                     2019  |    .504914   .0757538     6.67   0.000     .3564393    .6533886
                                     2020  |   .6012848   .0717728     8.38   0.000     .4606128    .7419568
                                     2021  |   .5871174   .0759046     7.73   0.000     .4383471    .7358877
                                     2022  |   .5855308   .0826702     7.08   0.000     .4235001    .7475614
                                           |
                                     _cons |   3.913927   .1864287    20.99   0.000     3.548533    4.279321
                        ------------------------------------------------------------------------------------
                        
                        . estat event, predict(xb) 
                        varlist required
                        
                        . 
                        end of do-file
                        
                        . sum __tr__ __etr__ __event__ gvar
                        
                            Variable |        Obs        Mean    Std. Dev.       Min        Max
                        -------------+---------------------------------------------------------
                              __tr__ |      4,658           1           0          1          1
                             __etr__ |      4,658    .6300988    .4828295          0          1
                           __event__ |      3,587    21.90995    6.096178          1         32
                                gvar |      4,658    1547.146    845.4931          0       2022

                        Comment


                        • #13
                          Could you do the following
                          set trace on
                          estat event
                          set trace off
                          and send me via email the logfile of that

                          Comment


                          • #14
                            Dear FernandoRios, I send the log file by mail. Thanks a lot for the help!!!

                            Comment

                            Working...
                            X