Announcement

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

  • There is the continued collinearity in the event study for checking the pre-parallel trend.

    Hello Stata community,




    I am trying to estimate the new law enacted in South Korea impact on the industrial accidents, which are the death rate and the injury rate.

    In order to check the pre-parallel trend for the death rate and the injury rate, I used “eventdd.”, which is made by Stata users in Stata 18.




    However, the results I tried failed with the collinearity.

    Please refer to my codes and the results I mentioned before.

    Code:
    eventdd death_rate post i.year [pweight= mean_worker], timevar(timetotreat) ci(rcap) method(fe, cluster(id))
    
    
    
    
    (sum of wgt is 18,021,670.016541)
    
    (sum of wgt is 18,021,670.016541)
    
    (sum of wgt is 18,021,670.016541)
    
    note: 2019.year omitted because of collinearity
    
    note: 2022.year omitted because of collinearity
    
    note: lead4 omitted because of collinearity
    
    note: lead3 omitted because of collinearity
    
    note: lead2 omitted because of collinearity
    
    note: lag0 omitted because of collinearity
    
    
    
    
    Fixed-effects (within) regression               Number of obs     =        278
    
    Group variable: id                              Number of groups  =         99
    
    
    
    
    R-squared:                                      Obs per group:
    
         Within  = 0.0001                                         min =          1
    
         Between = 0.0000                                         avg =        2.8
    
         Overall = 0.0006                                         max =          6
    
    
    
    
                                                    F(5, 98)          =       1.41
    
    corr(u_i, Xb) = -0.0042                         Prob > F          =     0.2284
    
    
    
    
                                        (Std. err. adjusted for 99 clusters in id)
    
    ------------------------------------------------------------------------------
    
                 |               Robust
    
      death_rate | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    
    -------------+----------------------------------------------------------------
    
            post |   .1113053   .0731395     1.52   0.131    -.0338377    .2564482
    
                 |
    
            year |
    
           2018  |  -.0156951   .1819686    -0.09   0.931    -.3768059    .3454157
    
           2019  |          0  (omitted)
    
           2020  |  -.0115101   .1112224    -0.10   0.918    -.2322273    .2092072
    
           2021  |   .0795687   .0817585     0.97   0.333    -.0826785    .2418158
    
           2022  |          0  (omitted)
    
                 |
    
           lead5 |  -.2303968   .1721523    -1.34   0.184    -.5720276    .1112339
    
           lead4 |          0  (omitted)
    
           lead3 |          0  (omitted)
    
           lead2 |          0  (omitted)
    
            lag0 |          0  (omitted)
    
           _cons |   .7130373   .0682963    10.44   0.000     .5775056     .848569
    
    -------------+----------------------------------------------------------------
    
         sigma_u |  612.41442
    
         sigma_e |   12.90711
    
             rho |  .99955601   (fraction of variance due to u_i)
    
    ------------------------------------------------------------------------------



    Click image for larger version

Name:	Graph.png
Views:	1
Size:	119.9 KB
ID:	1768001


    I should include “i.year.” to estimate the causality of my research topic, which is the time effect.

    But, whenever I put “i.year.”, the collinearity occurs with the messages in the command window.
    Notice that the problem for checking the pre-parallel trend would be the continued collinearity.


    How can I do this situation in Stata?

    How can I test the pre-parallel trend to use Difference-in-Difference using the “eventdd.”?




    I would appreciate it if you could help me estimate the pre-parallel trend for checking the Difference-in-Difference.




    Thank you for your help in advance.

    Jun

  • #2
    Jun:
    why not using -xtdidregress- and test the parallel tren assumption via -estat trendplots-?
    In addition, your within Rsq is dramatically low: I would recommend youi to double-check your model specification.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Jun:
      why not using -xtdidregress- and test the parallel tren assumption via -estat trendplots-?
      In addition, your within Rsq is dramatically low: I would recommend youi to double-check your model specification.
      Dear Carlo,

      Thank you very much for your advice!

      I drew the parallel trend using the method you mentioned, which are "xtdidregress" and "estat"
      Please refer to the following:

      Click image for larger version

Name:	2024-11-22 오후 7.34.14.png
Views:	1
Size:	357.4 KB
ID:	1768173 Click image for larger version

Name:	2024-11-22 오후 7.44.09.png
Views:	2
Size:	383.7 KB
ID:	1768175


      Are the parallel trends I drew for the injury rate and the death rate clear to check the pre-parallel trend?

      As we know about checking the pre-parallel trends rigorously, the economists slightly prefer to use the event study method compared to the linear-trends model using "xtdidregress" and "estat trend plots"

      Thank you for your help again,
      Jun






      Attached Files

      Comment


      • #4
        Jun:
        what does -estat trendplots- statististic give you back?
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Jun:
          my bad: I meant -estat ptrends- statistic.
          Sorry for the confusion.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post
            Jun:
            my bad: I meant -estat ptrends- statistic.
            Sorry for the confusion.
            Carlo:
            Thank you for your reply.

            Here are the codes I used, which is an estat ptrends - statistics

            Code:
            . xtdidregress (injury_rate) (SAPA) [pweight = mean_worker], group(id) time(year) vce(cluster id) 
            
            Treatment and time information
            
            Time variable: year
            Control:       SAPA = 0
            Treatment:     SAPA = 1
            -----------------------------------
                         |   Control  Treatment
            -------------+---------------------
            Group        |
                      id |        74        109
            -------------+---------------------
            Time         |
                 Minimum |      2017       2022
                 Maximum |      2019       2022
            -----------------------------------
            
            Difference-in-differences regression                     Number of obs = 1,068
            Data type: Longitudinal
            
                                               (Std. err. adjusted for 183 clusters in id)
            ------------------------------------------------------------------------------
                         |               Robust
             injury_rate | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
            -------------+----------------------------------------------------------------
            ATET         |
                    SAPA |
               (1 vs 0)  |  -.0089522   .0581604    -0.15   0.878    -.1237075    .1058032
            ------------------------------------------------------------------------------
            Note: ATET estimate adjusted for panel effects and time effects.
            Note: Treatment occurs at different times.
            
            . estat ptrends
            
            Parallel-trends test (pretreatment time period)
            H0: Linear trends are parallel
            
            F(1, 182) =   5.18
             Prob > F = 0.0240
            
            . estat trendplots
            As you can see here, F-statistics is 5.18, which means that this value is statistically significant, it means that it is not a pre-parallel trend.
            Is it right?

            Thank you for your assistance again,
            Jun




            Comment


            • #7
              Jun:
              yes, you're correct.
              The null was rejected, but this is not your main problem.
              The ATET is really negligible: are you sure that you have included all the relevant predictors in the right-hand side of your regression equation?
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Jun:
                yes, you're correct.
                The null was rejected, but this is not your main problem.
                The ATET is really negligible: are you sure that you have included all the relevant predictors in the right-hand side of your regression equation?
                Carlo:


                Code:
                . xtdidregress (injury_rate) (SAPA industry) [pweight = mean_worker], group(id) time(year) vce(cluster id)  
                for the treatment specification:
                too many variables specified
                As I add the other explanatory variables in the xtdidregress equation, there was an estimation error for the equation.
                This is because "too many variables specified," which means that I could not put anymore all the relevant predictors in the right-hand side.

                I think that it is my best result for the estimation using the "xtdidregress" you aforementioned instead of the "event study method".

                My last question is that Does it not have the option or the method to estimate the trend for me, right?

                Thank you for your help again,
                Jun


                Comment


                • #9
                  Jun:
                  what is your treatment variable?
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    Originally posted by Carlo Lazzaro View Post
                    Jun:
                    what is your treatment variable?
                    Carlo:

                    My treatment variable is "SAPA," which is the serious accidents punishment act in South Korea in the above regression equation.

                    SAPA is 1 if year == 2022 and the establishment size >= 50 employees at work

                    Best wishes,
                    Jun


                    Comment


                    • #11
                      JUn:
                      what if you try:
                      Code:
                       xtdidregress (injury_rate i.industry) (SAPA) [pweight = mean_worker], group(id) time(year) vce(cluster id)
                      Kind regards,
                      Carlo
                      (StataNow 18.5)

                      Comment


                      • #12
                        ..

                        Comment


                        • #13
                          Originally posted by Carlo Lazzaro View Post
                          JUn:
                          what if you try:
                          Code:
                          xtdidregress (injury_rate i.industry) (SAPA) [pweight = mean_worker], group(id) time(year) vce(cluster id)
                          Carlo,

                          The codes you taught are successful:

                          Code:
                          . xtdidregress (death_rate i.industry i.year i.year##i.industry) (SAPA) [pweight = mean_worker], group(id) time(year) vce (cluster id)
                          
                          Treatment and time information
                          
                          Time variable: year
                          Control:       SAPA = 0
                          Treatment:     SAPA = 1
                          -----------------------------------
                                       |   Control  Treatment
                          -------------+---------------------
                          Group        |
                                    id |        74        109
                          -------------+---------------------
                          Time         |
                               Minimum |      2017       2022
                               Maximum |      2019       2022
                          -----------------------------------
                          
                          Difference-in-differences regression                     Number of obs = 1,068
                          Data type: Longitudinal
                          
                                                                                     (Std. err. adjusted for 183 clusters in id)
                          ------------------------------------------------------------------------------------------------------
                                                               |               Robust
                                                    death_rate | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
                          -------------------------------------+----------------------------------------------------------------
                          ATET                                 |
                                                          SAPA |
                                                     (1 vs 0)  |   .0315618    .162786     0.19   0.846    -.2896287    .3527522
                          ------------------------------------------------------------------------------------------------------
                          Note: ATET estimate adjusted for covariates, panel effects, and time effects.
                          Note: Treatment occurs at different times.
                          
                          estat ptrends
                          
                          Parallel-trends test (pretreatment time period)
                          H0: Linear trends are parallel
                          
                          F(1, 182) =   1.18
                           Prob > F = 0.2793



                          Click image for larger version

Name:	injury rate trend.png
Views:	2
Size:	254.5 KB
ID:	1768423


                          Thank you very very much for your great help !
                          Jun
                          Attached Files

                          Comment


                          • #14
                            Jun:
                            go -estat granger- now.
                            Kind regards,
                            Carlo
                            (StataNow 18.5)

                            Comment

                            Working...
                            X