Announcement

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

  • Parallel Trends Assumption violated in STATA

    Hello everyone. I am running a difference in difference analysis on my unbalanced dataset . one of the results is coming significant . but parallel trend assumption is violated. how do I deal with this? please suggest.
    #
    Code:
     xtreg ROA Tr_Pt LEV logage2 DOI  Size HHI GDPpercapita DTTA i.Year, fe
    note: 2020.Year omitted because of collinearity
    
    Fixed-effects (within) regression               Number of obs     =      2,687
    Group variable: Companynum                      Number of groups  =        175
    
    R-sq:                                           Obs per group:
         within  = 0.9736                                         min =          4
         between = 0.8569                                         avg =       15.4
         overall = 0.9650                                         max =         16
    
                                                    F(22,2490)        =    4178.09
    corr(u_i, Xb)  = -0.0809                        Prob > F          =     0.0000
    
    ------------------------------------------------------------------------------
             ROA |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           Tr_Pt |   126.5271   38.20145     3.31   0.001     51.61718     201.437
             LEV |  -7.089689   .0245476  -288.81   0.000    -7.137825   -7.041553
         logage2 |   34.34533   18.54851     1.85   0.064    -2.026766    70.71742
             DOI |    .011284   .1288791     0.09   0.930    -.2414372    .2640053
            Size |  -88.53136   6.614628   -13.38   0.000    -101.5021   -75.56062
             HHI |  -.1316519   .3457496    -0.38   0.703    -.8096381    .5463344
    GDPpercapita |   .0983993   .0545792     1.80   0.072     -.008626    .2054246
            DTTA |  -114.8724   4.026177   -28.53   0.000    -122.7674   -106.9774
                 |
            Year |
           2006  |   112.6911   49.99093     2.25   0.024     14.66305    210.7192
           2007  |   12.79326   46.52855     0.27   0.783    -78.44538    104.0319
           2008  |  -28.52644     46.076    -0.62   0.536    -118.8776    61.82477
           2009  |  -49.61706   44.79542    -1.11   0.268    -137.4572    38.22304
           2010  |  -51.95688    45.6293    -1.14   0.255    -141.4322     37.5184
           2011  |  -35.69471   44.41452    -0.80   0.422    -122.7879    51.39849
           2012  |   1.027802   43.88352     0.02   0.981    -85.02415    87.07975
           2013  |   19.75093   43.82539     0.45   0.652    -66.18703    105.6889
           2014  |   67.29679   44.92807     1.50   0.134    -20.80343     155.397
           2015  |   29.96072   45.27704     0.66   0.508     -58.8238    118.7452
           2016  |  -25.00087   44.91622    -0.56   0.578    -113.0778    63.07611
           2017  |  -32.39633   49.66165    -0.65   0.514    -129.7787    64.98605
           2018  |  -58.38436   49.80795    -1.17   0.241    -156.0536     39.2849
           2019  |   3.375246    52.4202     0.06   0.949    -99.41641    106.1669
           2020  |          0  (omitted)
                 |
           _cons |   726.2341   104.6929     6.94   0.000     520.9401    931.5281
    -------------+----------------------------------------------------------------
         sigma_u |  284.42941
         sigma_e |   449.0823
             rho |  .28629599   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(174, 2490) = 3.34                   Prob > F = 0.0000
    HERE Tr_Pt is the interaction term between the treatment variable and time period. time period is as follows
    Code:
    gen Pt = 0
    
    . replace Pt = 1 if 2006<=Year<=2015
    (2,688 real changes made)
    
    . replace Pt = 2 if Year>2015
    (874 real changes made)
    But the graph is violating parallel trends. please helpstata.gph

  • #2
    stata.gph

    this is the graph

    Comment


    • #3
      sorry the graph is not visible. reposting it here again.
      Click image for larger version

Name:	roaa.JPG
Views:	1
Size:	46.1 KB
ID:	1669440

      Comment


      • #4
        I don't really get your post variable. In what year did the treatment occur? Presumably, the treatment was not exogenous and there is nonrandom selection into treamtent, right?

        You could try matching, as in Arkhangelsky et al. (2021), through the community contributed SDID command

        However please be aware that nothing can solve an endogenous treatment; if treatment is not exogenous, there's not much you can do about it at the end of the day..

        Comment


        • #5
          Like Max, I'm not understanding the problem.
          Code:
          u "http://econ.korea.ac.kr/~chirokhan/panelbook/data/basque-clean.dta", clear
          
          loc int_time = 1975
          
          g treated = cond(regionno==17 & year >= `int_time',1,0)
          
          labvars year gdpcap "Year" "ln(GDP per 100,000)"
          
          replace regionname = trim(regexr(regionname,"\(.+\) *",""))
          
          egen id = group(regionname), label(regionname) // makes a unique ID
          
          
          g post = cond(year >= `int_time',1,0)
          
          order id, b(year)
          
          *keep if year >= 1960
          drop if inlist(id,18) //12
          
          as id != 18
          
          drop regionno
          xtset id year, y
          
          
          cls
          
          xtdidregress (gdpcap) (treated), group(id) time(year)
          
          xtreg gdp treated i.year, fe
          These return the same results. You don't need to interact anything (in this instance), all you need do is simply make a treated vs. untreated variable.

          Max also makes a good suggestion on Synthetic Difference-in-Differences. It is one of the 1000 recent synthetic controls/difference-in-differences commands. But while the syntax is simple, the econometrics of the estimator are pretty complicated. You'd need to really understand before using it in writing. You can download it as
          Code:
          ssc inst sdid, replace


          Of course, all this is said without knowing anything about the really important details, like, how many units were ever treated, when they were treated, and so on and so forth.

          Comment


          • #6
            Thanks Maxence Morlet Jared Greathouse

            Comment

            Working...
            X