Announcement

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

  • #31
    Clyde Schechter Thanks for your reply. For me, this assistance is life-saving as I am an independent learner without formal training.

    I do have concerns about the design, however.
    My design was ideally to classify the group into terciles, and use the top tercile (lowest ownership) as control group and bottom tercile (highest ownership) as treatment group
    Hence my codes were
    Code:
    egen owner_year=xtile(owner) if year>2012 & year<2017, n(3) by(year) // to classify variable into 3 categories based on pre-reg period
    since post regulation is from 2017 onwards, I thought taking period < 2017 will help to circumvent the issue you raised, "
    are you certain that year-on-year ownership is not affected by the intervention you are trying to study",.
    Now I really dont know the "command" to extend this further for classifying into treated and control group. I actually want to create a control group (low ownership % till year 2016) and treatment group but I couldnt find a logic to build any command in Stata. Hence, I tried a long ineffective way

    Code:
    egen mean_owner=mean(owner_year),by(id) // to get mean by id
    gen owner_group=.
    replace owner_group=1 if mean_owner>3 &  mean_owner!= . high owner group
    replace owner_group=0 if mean_owner<1 & mean_owner!= . // low owner group
    With only three years of pre-intervention data, it's a little hard to really draw a firm conclusion. But it looks fair. I would call it plausible, maybe even persuasive, but not convincing. (But almost nothing would be convincing based on just three years
    Actually I have year from 2001 onwards. But in papers I have seen 3 years before the regulation/treatment and 3 years post regulation. Some articles also rationalized that a tighter window is good. In my case would it be alright if I take year from 2001 to 2016 to form treatment and control group based ownership.
    If someone could help me, what is the most effective Stata code to classify sample into treat versus control based on my narration?

    As always, looking forward to get some guidance

    Comment


    • #32
      Well, there is no law that says that you must verify the parallel trends assumption in the same short window you want to use for analysis. I can understand that due to long-term changes in other conditions, it might make sense to use a relatively short window before and after the start of intervention for the DID analysis. But you can still check the parallel trends assumption in a longer pre-intervention window. The farther back in time the parallel trend holds up, the more persuasive it is that the two groups can be compared in this way.

      In my last response I did not understand that you used the median split of ownership looking only at pre-intervention years. That at least overcomes my concern about the intervention affecting ownership. So we're OK on that score. I still do not like making discrete categories out of continuous variables. Terciles are perhaps a bit better than a median split in some ways: at least you remove the second tercile cases that are most vulnerable to misclassification in a median split. But you also reduce your sample size by 33%. Maybe you have enough firms in your data that you can afford to do that?

      Comment


      • #33
        Maybe you have enough firms in your data that you can afford to do that?
        Code:
         egen owner_year=xtile(owner) if year>2012 & year<2017, n(3) by(year)
        (21,761 missing values generated)
        
        . egen mean_owner=mean(owner_year),by(id)  
        (2,041 missing values generated)
        
        . gen owner_group=.
        (28,782 missing values generated)
        
        . 
        . replace owner_group=1 if mean_owner>=3 &  mean_owner!= .
        (7,416 real changes made)
        
        . replace owner_group=0 if mean_owner<=1 & mean_owner!= . 
        (7,525 real changes made)
        
        . univar owner,by(owner_group)
        
        -> owner_group=0 
                                                -------------- Quantiles --------------
        Variable       n     Mean     S.D.      Min      .25      Mdn      .75      Max
        -------------------------------------------------------------------------------
           owner    7252    31.71    14.44     0.00    22.29    32.92    41.49    93.21
        -------------------------------------------------------------------------------
        
        -> owner_group=1 
                                                -------------- Quantiles --------------
        Variable       n     Mean     S.D.      Min      .25      Mdn      .75      Max
        -------------------------------------------------------------------------------
           owner    7258    68.29    10.87     0.00    65.39    70.86    74.51    99.95
        -------------------------------------------------------------------------------

        7252 numbers for low owner_group and 7258 for high_owner, that is fine for DID, right?

        Also can I assume all that I have done (except design as you pointed) makes some sense (wrt to commands, classification etc) ?

        Clyde Schechter , no words to express my gratitude

        Comment


        • #34
          Yes, this looks good.

          Comment


          • #35
            Dear Clyde Schechter
            I tried two models. In model 1, similar to a sub-sample analysis, I run separate regressions,- in both the treatment group and control group with the variable of interest (ibc3) as the time dummy (regressor).

            Code:
             xtreg nfa_ta_w ///
            > i.ibc3 ///
            > size_w  sales_grow_w roa_w pb cfo_ta_w rdcc_ta_w div_ta_w nw_ta_w ///
            > i.year if treat==1, fe vce(robust)
            note: 2019.year omitted because of collinearity
            
            Fixed-effects (within) regression               Number of obs     =        862
            Group variable: co_code                         Number of groups  =        116
            
            R-sq:                                           Obs per group:
                 within  = 0.1736                                         min =          1
                 between = 0.0198                                         avg =        7.4
                 overall = 0.0246                                         max =         17
            
                                                            F(25,115)         =       7.65
            corr(u_i, Xb)  = -0.2765                        Prob > F          =     0.0000
            
                                          (Std. Err. adjusted for 116 clusters in co_code)
            ------------------------------------------------------------------------------
                         |               Robust
                nfa_ta_w |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                  1.ibc3 |  -.2347367   .0369613    -6.35   0.000    -.3079498   -.1615235
                  size_w |   .0303165   .0133015     2.28   0.025     .0039688    .0566642
            sales_grow_w |  -.0028618   .0121419    -0.24   0.814    -.0269126    .0211891
                   roa_w |  -.0834192   .1306226    -0.64   0.524    -.3421573     .175319
                      pb |  -.0079889   .0025704    -3.11   0.002    -.0130804   -.0028975
                cfo_ta_w |   .1838933   .0706777     2.60   0.010     .0438943    .3238922
               rdcc_ta_w |   .6657785   .5071382     1.31   0.192    -.3387646    1.670322
                div_ta_w |  -.0226804   .0148029    -1.53   0.128    -.0520021    .0066414
                 nw_ta_w |  -.1941278   .0704567    -2.76   0.007     -.333689   -.0545666
                         |
                    year |
                   2003  |  -.1426871   .0428625    -3.33   0.001    -.2275895   -.0577847
                   2004  |  -.1260206   .0395867    -3.18   0.002    -.2044342    -.047607
                   2005  |  -.1490157   .0381866    -3.90   0.000     -.224656   -.0733754
                   2006  |  -.1503983   .0377283    -3.99   0.000    -.2251308   -.0756658
                   2007  |   -.163231   .0335592    -4.86   0.000    -.2297053   -.0967568
                   2008  |  -.1718106   .0320398    -5.36   0.000    -.2352752    -.108346
                   2009  |  -.1733861   .0279404    -6.21   0.000    -.2287307   -.1180415
                   2010  |  -.1794934   .0315955    -5.68   0.000    -.2420779   -.1169089
                   2011  |  -.1799162   .0301554    -5.97   0.000    -.2396482   -.1201843
                   2012  |  -.1911836    .030166    -6.34   0.000    -.2509367   -.1314306
                   2013  |  -.1818318   .0314437    -5.78   0.000    -.2441157   -.1195479
                   2014  |  -.1975893   .0326184    -6.06   0.000       -.2622   -.1329786
                   2015  |  -.1971987   .0347608    -5.67   0.000    -.2660532   -.1283442
                   2016  |  -.2124169   .0363527    -5.84   0.000    -.2844245   -.1404093
                   2017  |   .0295022   .0155664     1.90   0.061    -.0013318    .0603361
                   2018  |    .021242   .0115124     1.85   0.068    -.0015618    .0440458
                   2019  |          0  (omitted)
                         |
                   _cons |   .3714592    .126951     2.93   0.004     .1199936    .6229247
            -------------+----------------------------------------------------------------
                 sigma_u |  .14513577
                 sigma_e |  .07370312
                     rho |  .79498646   (fraction of variance due to u_i)
            ------------------------------------------------------------------------------
            
            
            . xtreg nfa_ta_w ///
            > i.ibc3 ///
            > size_w  sales_grow_w roa_w pb cfo_ta_w rdcc_ta_w div_ta_w nw_ta_w ///
            > i.year if treat==0, fe vce(robust)
            note: 2019.year omitted because of collinearity
            
            Fixed-effects (within) regression               Number of obs     =      1,053
            Group variable: co_code                         Number of groups  =        143
            
            R-sq:                                           Obs per group:
                 within  = 0.0968                                         min =          1
                 between = 0.1069                                         avg =        7.4
                 overall = 0.1007                                         max =         17
            
                                                            F(24,142)         =       2.25
            corr(u_i, Xb)  = 0.1292                         Prob > F          =     0.0018
            
                                          (Std. Err. adjusted for 143 clusters in co_code)
            ------------------------------------------------------------------------------
                         |               Robust
                nfa_ta_w |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                  1.ibc3 |  -.0910033   .0488467    -1.86   0.065    -.1875641    .0055575
                  size_w |   .0085853   .0229792     0.37   0.709    -.0368402    .0540108
            sales_grow_w |   .0255645   .0133821     1.91   0.058    -.0008893    .0520184
                   roa_w |  -.3234431    .093554    -3.46   0.001    -.5083816   -.1385045
                      pb |  -.0002104   .0031089    -0.07   0.946     -.006356    .0059353
                cfo_ta_w |   .1951936   .0573974     3.40   0.001     .0817298    .3086574
               rdcc_ta_w |   .4637081   .5523439     0.84   0.403    -.6281714    1.555588
                div_ta_w |  -.0094391   .0185276    -0.51   0.611    -.0460645    .0271864
                 nw_ta_w |   .0044239   .0587613     0.08   0.940    -.1117362    .1205839
                         |
                    year |
                   2004  |  -.0213267   .0087486    -2.44   0.016    -.0386211   -.0040324
                   2005  |   -.025039   .0142844    -1.75   0.082    -.0532765    .0031984
                   2006  |  -.0554352   .0225353    -2.46   0.015    -.0999833   -.0108871
                   2007  |  -.0656608    .024322    -2.70   0.008    -.1137409   -.0175808
                   2008  |  -.0889506   .0284369    -3.13   0.002    -.1451649   -.0327362
                   2009  |   -.072713   .0284432    -2.56   0.012    -.1289399   -.0164862
                   2010  |  -.0446313   .0317542    -1.41   0.162    -.1074033    .0181407
                   2011  |  -.0624312   .0328914    -1.90   0.060    -.1274513    .0025889
                   2012  |  -.0691607   .0376416    -1.84   0.068     -.143571    .0052496
                   2013  |   -.067354   .0394538    -1.71   0.090    -.1453468    .0106388
                   2014  |  -.0619436   .0397117    -1.56   0.121     -.140446    .0165589
                   2015  |  -.0673227    .042484    -1.58   0.115    -.1513055    .0166602
                   2016  |  -.0751172   .0438617    -1.71   0.089    -.1618235     .011589
                   2017  |   .0211862   .0122378     1.73   0.086    -.0030057    .0453781
                   2018  |  -.0011198   .0090837    -0.12   0.902    -.0190765    .0168369
                   2019  |          0  (omitted)
                         |
                   _cons |    .330835   .2063011     1.60   0.111    -.0769833    .7386533
            -------------+----------------------------------------------------------------
                 sigma_u |  .15033296
                 sigma_e |  .08218268
                     rho |  .76991228   (fraction of variance due to u_i)
            ------------------------------------------------------------------------------
            In the above, i.ibc3 is a dummy in which 0 is given for years >2000 but less than 2017 (2001-2016). This is the pre-treatment period. 1 is given for years >2016 but less than 2020 (2017,2018,2019). This the post treatment period

            Code:
            gen ibc3=.
            replace ibc3=0 if year>2000 & year<2017 //( 2001-2016)
            replace ibc3=1 if year>2016 & year<2020 //(2017,2018,2019)
            treat is a dummy variable which takes 1 for firms that belongs to a treatment group & 0 for the control group. I created the variable treat by considering years till 2016 only (prior to the treatment period).

            Since I couldn't find a method to test the equality of coefficients in two groups in panel set-up (https://www.statalist.org/forums/for...ith-panel-data, I will see this later), I just compared the coefficients as it is.

            Model 2 is similar to Classical DID set up which I did as follows
            Code:
            xtreg nfa_ta_w ///
            > i.ibc3##i.treat ///
            > size_w  sales_grow_w roa_w pb cfo_ta_w rdcc_ta_w div_ta_w nw_ta_w ///
            > i.year, fe vce(robust)
            note: 1.treat omitted because of collinearity
            note: 2019.year omitted because of collinearity
            
            Fixed-effects (within) regression               Number of obs     =      1,915
            Group variable: co_code                         Number of groups  =        259
            
            R-sq:                                           Obs per group:
                 within  = 0.1011                                         min =          1
                 between = 0.0491                                         avg =        7.4
                 overall = 0.0699                                         max =         17
            
                                                            F(26,258)         =       4.41
            corr(u_i, Xb)  = -0.0237                        Prob > F          =     0.0000
            
                                          (Std. Err. adjusted for 259 clusters in co_code)
            ------------------------------------------------------------------------------
                         |               Robust
                nfa_ta_w |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                  1.ibc3 |  -.2289587   .0461312    -4.96   0.000    -.3198003    -.138117
                 1.treat |          0  (omitted)
                         |
              ibc3#treat |
                    1 1  |  -.0150792   .0174322    -0.87   0.388    -.0494067    .0192483
                         |
                  size_w |   .0170185   .0154218     1.10   0.271    -.0133501    .0473871
            sales_grow_w |   .0145685   .0096244     1.51   0.131    -.0043839    .0335208
                   roa_w |  -.2231064   .0783586    -2.85   0.005    -.3774103   -.0688025
                      pb |  -.0036057   .0020288    -1.78   0.077    -.0076008    .0003894
                cfo_ta_w |   .1877285    .042889     4.38   0.000     .1032714    .2721856
               rdcc_ta_w |   .5805764    .376336     1.54   0.124     -.160505    1.321658
                div_ta_w |  -.0160409   .0120286    -1.33   0.184    -.0397277    .0076459
                 nw_ta_w |   -.082849   .0477245    -1.74   0.084    -.1768282    .0111301
                         |
                    year |
                   2003  |  -.1461136   .0442935    -3.30   0.001    -.2333363   -.0588908
                   2004  |  -.1489225   .0430074    -3.46   0.001    -.2336128   -.0642323
                   2005  |  -.1606109    .042303    -3.80   0.000     -.243914   -.0773077
                   2006  |  -.1797454   .0425735    -4.22   0.000    -.2635813   -.0959096
                   2007  |  -.1908708   .0409007    -4.67   0.000    -.2714124   -.1103291
                   2008  |  -.2058659   .0403743    -5.10   0.000    -.2853711   -.1263607
                   2009  |  -.1981615   .0384565    -5.15   0.000      -.27389    -.122433
                   2010  |  -.1853406   .0395181    -4.69   0.000    -.2631596   -.1075216
                   2011  |  -.1947907   .0397367    -4.90   0.000    -.2730403    -.116541
                   2012  |  -.2025568   .0405861    -4.99   0.000     -.282479   -.1226346
                   2013  |  -.1989812   .0413818    -4.81   0.000    -.2804704    -.117492
                   2014  |  -.2042867   .0415338    -4.92   0.000    -.2860752   -.1224982
                   2015  |  -.2077556   .0431014    -4.82   0.000     -.292631   -.1228802
                   2016  |  -.2177749   .0438139    -4.97   0.000    -.3040533   -.1314965
                   2017  |   .0233545   .0094257     2.48   0.014     .0047934    .0419156
                   2018  |   .0090829   .0071886     1.26   0.208     -.005073    .0232387
                   2019  |          0  (omitted)
                         |
                   _cons |   .4394565   .1471031     2.99   0.003     .1497808    .7291321
            -------------+----------------------------------------------------------------
                 sigma_u |  .14629892
                 sigma_e |  .07916839
                     rho |  .77349455   (fraction of variance due to u_i)
            ----------------------------------------------------------------------------
            Since DID is referred to as a better way for making causal claims, can I say that the treatment was not effective based on model 2. I did similar regressions with the same models but using alternative measures of the dependent variable as a robustness check, and in DID, I can't find any significance for the interaction between time and group. Here are my doubts

            1. Which model is more correct or intuitive? Is it the same difference between sub-sample analysis (model 1) and interaction (model 2)
            2. Following question1, can I say based on model 2 that there is no significant association between ibc3 and dependent variables considering both groups
            3. More generally, can I propose an absence of significance based on my sample?

            Comment


            • #36
              1. The second model provides you with a DID estimate of the causal effect of your treatment, along with estimates of it uncertainty. The first approach does not, so it is not useful.
              2. Since you addressed your question specifically to me (generally not a good idea, by the way, to address your question to anyone in particular), I will assume that you are familiar with my posts here and therefore are prepared to be reminded that I do not think much of statistical significance, and, in particular, that I do not think it should be used in this context. I am an ardent proponent of the American Statistical Association's recommendation that the concept of statistical significance be abandoned. See https://www.tandfonline.com/doi/full...5.2019.1583913 for the "executive summary" and https://www.tandfonline.com/toc/utas20/73/sup1 for all 43 supporting articles. Or https://www.nature.com/articles/d41586-019-00857-9 for the tl;dr.

              That said, you cannot directly from the regression output say much about the association of ibc3 and the dependent variable in the treat = 1 group, as that does not appear in the regression output. You can calculate it by following the regression with -lincom 1.ibc3 + 1.ibc3#treat-. As for the treat = 0 group, in that group, Model 2 tells you that the arrival of year 2017 was associated with a 0.229 (rounded to 3 decimal places) decrease in your outcome variable, with a 95% CI of 0.138 to 0.320 decrease. So it seems that in the untreated group there was a change that is bounded away from zero. Whether it is also large enough to matter is for you to judge based on your knowledge of what the outcome in question is and how it works in real life.

              If you are interested in what happened separately in each group at the turn of year 2017, you can also get that post-regression with
              Code:
              margins treat, dydx(ibc3)
              That is more convenient that messing around with -lincom-, and also less error prone.

              3. As already noted, I have no opinion about presence or absence of significance here as I do not think the concept is useful or meaningful. Your DID estimate of the treatment effect is -0.015 with a 95% CI of -0.049 to +0.019. These results are compatible with both negative and positive effects, and with no effect at all. What you should think about is: what direction and magnitude of effect would be meaningful in the real world? Where does that fall with respect to this confidence interval? Is it completely outside the confidence interval--in which case you can say that your data do not support the existence of a meaningful effect, or is it within the confidnece interval? If within, then you can say that your data are consistent with such an effect, but also consistent with an effect in the opposite direction--hence an inconclusive study.

              Comment


              • #37
                Dear Clyde
                Thanks for the detailed response. I am sorry for personally addressing you. I thought of tagging you by using @ "name" so that I may seek your attention (as my questions are in continuation of your earlier responses).

                1. The second model provides you with a DID estimate of the causal effect of your treatment, along with estimates of it uncertainty. The first approach does not, so it is not useful
                What does uncertainty imply? It may be applicable to all DID models right?


                I tried
                Code:
                . margins, dydx(ibc3)
                
                Average marginal effects                        Number of obs     =      1,915
                Model VCE: Robust
                
                Expression   : Linear prediction, predict()
                dy/dx w.r.t. : 1.ibc3
                
                ------------------------------------------------------------------------------
                             |            Delta-method
                             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                      1.ibc3 |          .  (not estimable)
                ------------------------------------------------------------------------------
                Note: dy/dx for factor levels is the discrete change from the base leve
                l.
                I also tried


                Code:
                . margins, dydx(ibc3) atmeans
                
                Conditional marginal effects                    Number of obs     =      1,915
                Model VCE    : Robust
                
                Expression   : Linear prediction, predict()
                dy/dx w.r.t. : 1.ibc3
                at           : 0.ibc3          =    .8010444 (mean)
                               1.ibc3          =    .1989556 (mean)
                               0.treat         =    .5498695 (mean)
                               1.treat         =    .4501305 (mean)
                               size_w          =     9.38691 (mean)
                               sales_grow_w    =    .1527104 (mean)
                               roa_w           =    .0815926 (mean)
                               pb              =    2.650084 (mean)
                               cfo_ta_w        =    .0777817 (mean)
                               rdcc_ta_w       =    .0117014 (mean)
                               div_ta_w        =    .8172324 (mean)
                               nw_ta_w         =    .4414911 (mean)
                               2002.year       =    .0010444 (mean)
                               2003.year       =     .032376 (mean)
                               2004.year       =    .0391645 (mean)
                               2005.year       =    .0407311 (mean)
                               2006.year       =    .0386423 (mean)
                               2007.year       =    .0490862 (mean)
                               2008.year       =    .0543081 (mean)
                               2009.year       =    .0663185 (mean)
                               2010.year       =    .0642298 (mean)
                               2011.year       =    .0637076 (mean)
                               2012.year       =    .0704961 (mean)
                               2013.year       =    .0741514 (mean)
                               2014.year       =     .073107 (mean)
                               2015.year       =    .0652742 (mean)
                               2016.year       =    .0684073 (mean)
                               2017.year       =    .0684073 (mean)
                               2018.year       =    .0663185 (mean)
                               2019.year       =    .0642298 (mean)

                But what atmeans imply or whether it makes sense in my context is not known to me


                Is it completely outside the confidence interval--in which case you can say that your data do not support the existence of a meaningful effect, or is it within the confidence interval? If within, then you can say that your data are consistent with such an effect, but also consistent with an effect in the opposite direction--hence an inconclusive study.

                This part, requires careful investigation as I am unable to figure out from data or theory. I have taken the complete available data and even my classification into treatment group- and control is based on the longer window and parallel trend assumption is also reasonably met. Since I have not read many studies that publish inconclusive results, I am a little puzzled!
                Last edited by lal mohan kumar; 26 Mar 2021, 23:46.

                Comment


                • #38
                  Uncertainty is an attribute of all statistical analyses, not just DID models. Your analysis comes from a sample of data. Your sample does not represent the universe of possibilities: it represents some subset that is partly the result of your decisions about what to include, and partly beyond your control in terms of what was available. In addition, nearly all data sets contain measurement errors. Had you drawn a different sample, the results would have been different to some extent. Moreover, your model may not be correctly specified, as we usually do not know the true data generating process.

                  But if there really is some underlying process that affects the data, the difference would be to some extent constrained. In any case, the results of a single analysis of a single data set do not represent the definitive resolution of any question, but are only an estimate that is not fully reproducible. To the extent that different data sets would produce a range of different estimates, that is uncertainty. One aspect of uncertainty, the part that is due to variation from one sample to the next, is displayed in the confidence interval. The confidence interval gives bounds on the uncertainty of the estimate, or at least on that part of the uncertainty that is attributable to sampling variation.

                  The command -margins, dydx(ibc3)- is not appropriate here. Even if it didn't lead to a "not estimable" result, the result would not have corresponded to anything useful or meaningful in the context of your model. The command I recommended you run is -margins treat, dydx(ibc3)- I do not think you will get a "not estimable" result for that. Similarly, -margins, dydx(ibc3) atmeans- is not meaningful. Any estimate of "the marginal effect of ibc3" that does not distinguish the values in the treated and untreated groups is simply not useful, even if it could be estimated.

                  Since I have not read many studies that publish inconclusive results
                  This phenomenon is known as "publication bias." Studies that lead to inconclusive results are often not submitted for publication, or are rejected by journals. So you don't see them often. But remember that just because you have a question and some data that may be relevant, there is no guarantee that the data will contain sufficient information to answer that question. Sometimes, the answer after a study is still "we don't know," and further research will be needed to get a clearer picture.

                  Comment


                  • #39
                    Dear Clyde Schechter First, congrats on the wonderful achievement. Your guidance benefitted many including me. I learned a lot from your posts (more to learn). No words to express my thanks and wishes.

                    The command I recommended you run is -margins treat, dydx(ibc3)- I do not think you will get a "not estimable" result for that.

                    Code:
                    . xtreg lever_w ///
                    > i.ibc3##i.treat ///
                    > size_w nfa_ta_w  cash_ta_w sales_grow_w roa_w fpb cfo_ta_w rdcc_ta_w div_ta_w nw_ta_w ///
                    > i.year , fe vce(robust) 
                    note: 1.treat omitted because of collinearity
                    note: 2019.year omitted because of collinearity
                    
                    Fixed-effects (within) regression               Number of obs     =      1,649
                    Group variable: co_code                         Number of groups  =        235
                    
                    R-sq:                                           Obs per group:
                         within  = 0.6959                                         min =          1
                         between = 0.5674                                         avg =        7.0
                         overall = 0.5466                                         max =         17
                    
                                                                    F(28,234)         =      50.54
                    corr(u_i, Xb)  = 0.0347                         Prob > F          =     0.0000
                    
                                                  (Std. Err. adjusted for 235 clusters in co_code)
                    ------------------------------------------------------------------------------
                                 |               Robust
                         lever_w |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                    -------------+----------------------------------------------------------------
                          1.ibc3 |  -.0910969   .0457453    -1.99   0.048    -.1812222   -.0009716
                         1.treat |          0  (omitted)
                                 |
                      ibc3#treat |
                            1 1  |  -.0270277   .0141967    -1.90   0.058    -.0549974    .0009419
                                 |
                          size_w |   .0102549   .0100466     1.02   0.308    -.0095384    .0300481
                        nfa_ta_w |   .0465568   .0346195     1.34   0.180     -.021649    .1147627
                       cash_ta_w |   .0067007   .0525765     0.13   0.899    -.0968832    .1102846
                    sales_grow_w |  -.0052176    .004663    -1.12   0.264    -.0144045    .0039693
                           roa_w |  -.1249258   .0536343    -2.33   0.021    -.2305935    -.019258
                             fpb |  -.0043834   .0017807    -2.46   0.015    -.0078915   -.0008752
                        cfo_ta_w |  -.2161242   .0343168    -6.30   0.000    -.2837336   -.1485148
                       rdcc_ta_w |   .2099891   .2205351     0.95   0.342    -.2244989    .6444771
                        div_ta_w |   .0098246   .0071253     1.38   0.169    -.0042133    .0238624
                         nw_ta_w |  -.6818984   .0333382   -20.45   0.000    -.7475797    -.616217
                                 |
                            year |
                           2003  |  -.0534339    .038486    -1.39   0.166    -.1292572    .0223894
                           2004  |  -.0651719   .0396493    -1.64   0.102    -.1432871    .0129433
                           2005  |  -.0753102   .0392411    -1.92   0.056    -.1526212    .0020007
                           2006  |  -.0657769   .0393634    -1.67   0.096    -.1433289     .011775
                           2007  |  -.0660147   .0395743    -1.67   0.097     -.143982    .0119527
                           2008  |  -.0748379   .0396706    -1.89   0.060    -.1529952    .0033193
                           2009  |  -.0781707   .0398323    -1.96   0.051    -.1566464     .000305
                           2010  |  -.0780633   .0407398    -1.92   0.057    -.1583271    .0022004
                           2011  |  -.0754365   .0419785    -1.80   0.074    -.1581405    .0072676
                           2012  |  -.0824575   .0420855    -1.96   0.051    -.1653724    .0004573
                           2013  |  -.0826808   .0421627    -1.96   0.051    -.1657478    .0003862
                           2014  |   -.086547   .0423648    -2.04   0.042    -.1700121    -.003082
                           2015  |  -.0787213   .0423388    -1.86   0.064    -.1621351    .0046926
                           2016  |   -.084082   .0425245    -1.98   0.049    -.1678618   -.0003022
                           2017  |   .0178829   .0057306     3.12   0.002     .0065928    .0291729
                           2018  |   .0053348   .0044576     1.20   0.233    -.0034473    .0141169
                           2019  |          0  (omitted)
                                 |
                           _cons |   .5784169   .0919729     6.29   0.000     .3972161    .7596177
                    -------------+----------------------------------------------------------------
                         sigma_u |  .12236802
                         sigma_e |  .05069225
                             rho |  .85352499   (fraction of variance due to u_i)
                    ------------------------------------------------------------------------------
                    
                    .
                    . margins treat, dydx(ibc3)
                    
                    Average marginal effects                        Number of obs     =      1,649
                    Model VCE    : Robust
                    
                    Expression   : Linear prediction, predict()
                    dy/dx w.r.t. : 1.ibc3
                    
                    ------------------------------------------------------------------------------
                                 |            Delta-method
                                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
                    -------------+----------------------------------------------------------------
                    0.ibc3       |  (base outcome)
                    -------------+----------------------------------------------------------------
                    1.ibc3       |
                           treat |
                              0  |          .  (not estimable)
                              1  |          .  (not estimable)
                    ------------------------------------------------------------------------------
                    Note: dy/dx for factor levels is the discrete change from the base level.


                    Is there anything wrong in my analysis. I understand that, as you said, "any estimate of "the marginal effect of ibc3" that does not distinguish the values in the treated and untreated groups is simply not useful, even if it could be estimated". However, I am not sure why such a display

                    Sometimes, the answer after a study is still "we don't know," and further research will be needed to get a clearer picture.
                    . I tried with multiple samples and results are similar and I thought, probably there may not be any evidence on casualty. But before wrapping up the project, I thought to get some advice on it

                    Comment


                    • #40
                      I am not sure why you are getting "not estimable" here. But I have seen this before with -margins- after a fixed effects regression. What you can do in this case is -margins treat, dydx(ibc3) noestimcheck-.

                      Now, you should not indiscriminately use the -noestimcheck- option whenever -margins- tells you something is not estimable. Most of the time -margins- is right about that and you should be deterred. But these particular marginal effects are estimable in your model, so go ahead with it.

                      Comment


                      • #41
                        For DID analysis, I tried the following code:

                        xtreg zipf i.indgroup##i.time exportpc fdipc2 meannilight, fe vce(cluster newid)
                        margins indgroup#time, noestmcheck
                        margins indgroup, dydx(time) noestmcheck

                        . xtreg zipf i.indgroup##i.time exportpc fdipc2 meannilight, fe vce(cluster newid)
                        note: 1.indgroup omitted because of collinearity
                        note: 2.indgroup omitted because of collinearity

                        Fixed-effects (within) regression Number of obs = 9,006
                        Group variable: newid Number of groups = 1,140

                        R-sq: Obs per group:
                        within = 0.0076 min = 5
                        between = 0.0000 avg = 7.9
                        overall = 0.0001 max = 8

                        F(6,1139) = 621.62
                        corr(u_i, Xb) = -0.5613 Prob > F = 0.0000

                        (Std. Err. adjusted for 1,140 clusters in newid)

                        Robust
                        zipf Coef. Std. Err. t P>t [95% Conf. Interval]

                        indgroup
                        1 0 (omitted)
                        2 0 (omitted)

                        1.time .0089287 .0086327 1.03 0.301 -.008009 .0258664

                        indgroup#time
                        1 1 .1171667 .0082233 14.25 0.000 .1010322 .1333012
                        2 1 -.0821667 .0082233 -9.99 0.000 -.0983012 -.0660322

                        exportpc -7.75e-06 .0000219 -0.35 0.724 -.0000507 .0000352
                        fdipc2 5.27e-07 .0000199 0.03 0.979 -.0000384 .0000395
                        meannilight .0120512 .0089838 1.34 0.180 -.0055754 .0296778
                        _cons .9166127 .0698574 13.12 0.000 .7795491 1.053676

                        sigma_u .26780104
                        sigma_e .21087569
                        rho .61726393 (fraction of variance due to u_i)


                        . margins indgroup#time, noestmcheck
                        option noestmcheck not allowed
                        r(198);

                        end of do-file

                        r(198);

                        . do "/var/folders/h8/rkck_l9549327p28z_85fd640000gn/T//SD01306.000000"

                        . margins indgroup, dydx(time) noestmcheck
                        option noestmcheck not allowed
                        r(198);

                        end of do-file

                        r(198);

                        Comment


                        • #42
                          Sorry, don't know when I paste it did not show nicely as #39 as I did this on Mac Pro with control/commond + paste.

                          Comment


                          • #43
                            -noestmcheck- is a typo. It should be -noestimcheck-.

                            That said, you shouldn't do this at all. Due to the colinearity of the intervention variable with the fixed effects, these results are in fact truly not estimable; they are artifacts of the way in which that colinearity is broken. Changing the base value of indgroup would give you different results. The -margins, dydx()- results would be OK with -estimcheck-, but the straight -margins- results are not.

                            Always be very cautious about using -noestimcheck-. When Stata tells you things are not estimable, it is nearly always right. You need to carefully think through your situation to see if it is one of those rare cases where Stata gets this wrong.

                            Comment


                            • #44
                              Many thanks!

                              My design and my question are the following:

                              I want to look at how the market concentration level change after a policy treatment in year 2002 affect the economic growth in 30 provinces. Does this contest fit for a DIDID analysis? If yes, how I should do this including checking parallel trend pre-treatment?

                              Comment


                              • #45
                                typo: contest -- context

                                Comment

                                Working...
                                X