Announcement

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

  • DiD: Treatment variable omitted due to multicollinearity

    Hello All,

    I am currently working on a Difference in Differences estimation in Stata trying to evaluate the effects of whether a company has introduced an ESG compensation policy on its ESG scores. My pre-Period is 2014 whereas my post-Period is 2017.

    However, when allocating my variables to the xtdidreg command in Stata, my treatment variable is dropped due to multicollinearity. Since I am evaluating firms within the same regulatory environment (EU) it is my understanding that I must group by CompanyCode. In addition, using solely the policy variable does not take into account the effect of the switch from no ESG policy to ESG policy. Could you please advise me on what to do differently to achieve the correct results? Please find a streamlined dataset below.
    • Treatment indicates whether the company switched from having no ESG compensation policy in place in 2014 to having one in place in 2017 (since I want to evaluate the effect of ESG compensation policy)
    • PolicyExecComp indicates whether the company had an ESG Policy in place in the respective year
    • lagESGCombScore is a the lagged ESG Score of the company with a three year lag
    This is the command I used: xtdidreg (lagESGCombScore) (Treatment), group (CompanyCode) time (Year) which results in the treatment variable being omitted due to multicollinearity.

    The same error occurs when dropping all years except 2014 & 2017 and repeating this step.

    How can I go about this? Do I have to define the command differently?

    Thank You!

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte Treatment int Year byte PolicyExecComp double ESGCombScore long(IndustryCode CountryCode CompanyCode) float ESGCombScore_3
    1 2011 0 62.4069688830333 11 11  1         .
    1 2012 0 62.4624719587995 11 11  1         .
    1 2013 0 58.8133079593121 11 11  1         .
    1 2014 0 61.0820738919903 11 11  1  62.40697
    1 2015 0 59.4591000375171 11 11  1  62.46247
    1 2016 1 64.5068378496325 11 11  1  58.81331
    1 2017 1 49.3056392381697 11 11  1  61.08207
    1 2018 1 66.6140940568271 11 11  1   59.4591
    1 2019 1 81.1935801160082 11 11  1 64.506836
    1 2020 1 81.0892750841588 11 11  1  49.30564
    1 2021 1 73.4989516532658 11 11  1   66.6141
    0 2011 0 70.1402465343189  7 16  2         .
    0 2012 0 62.8208085276402  7 16  2         .
    0 2013 0 57.6855912093235  7 16  2         .
    0 2014 0 59.2745283973688  7 16  2  70.14024
    0 2015 0 63.3290756280179  7 16  2  62.82081
    0 2016 0 61.7310754497407  7 16  2  57.68559
    0 2017 0 64.2386700510711  7 16  2  59.27453
    0 2018 0 65.2676083610478  7 16  2  63.32907
    0 2019 0 54.1960015752981  7 16  2  61.73108
    0 2020 0 72.5699467669375  7 16  2  64.23867
    0 2021 0 40.8971010886951  7 16  2  65.26761
    1 2011 0 46.3010097021913  7  4  3         .
    1 2012 0 59.8150445415166  7  4  3         .
    1 2013 0 57.0835308975815  7  4  3         .
    1 2014 0 51.9532918031357  7  4  3  46.30101
    1 2015 1 61.1024724485255  7  4  3  59.81504
    1 2016 1 42.5611589123796  7  4  3  57.08353
    1 2017 1 52.3030340597252  7  4  3  51.95329
    1 2018 1 61.8586213790156  7  4  3  61.10247
    1 2019 1 65.4734576674699  7  4  3  42.56116
    1 2020 1 62.5186516326226  7  4  3  52.30304
    1 2021 1 40.9724077254589  7  4  3  61.85862
    1 2011 .                .  2 18  4         .
    1 2012 .                .  2 18  4         .
    1 2013 .                .  2 18  4         .
    1 2014 0 41.6011043070205  2 18  4         .
    1 2015 0 41.8361246710851  2 18  4         .
    1 2016 1 62.6825742371833  2 18  4         .
    1 2017 1  59.790808972616  2 18  4   41.6011
    1 2018 1 65.6169217356717  2 18  4  41.83612
    1 2019 1 58.5403600766528  2 18  4  62.68258
    1 2020 1 58.1144139223606  2 18  4  59.79081
    1 2021 1 58.5433217311863  2 18  4  65.61692
    1 2011 0 7.45967610225398  7 13  5         .
    1 2012 0 11.2140028642259  7 13  5         .
    1 2013 0 11.7925981497021  7 13  5         .
    1 2014 0 12.3565613544798  7 13  5  7.459676
    1 2015 1 17.9640026372714  7 13  5 11.214003
    1 2016 1 25.6089058025622  7 13  5 11.792598
    1 2017 1 54.1041825601216  7 13  5 12.356562
    1 2018 1 57.7621538427733  7 13  5 17.964003
    1 2019 1 61.1655869373887  7 13  5 25.608906
    1 2020 1 64.0732918961297  7 13  5  54.10418
    1 2021 1 65.5291287575527  7 13  5  57.76215
    0 2011 0 65.6099150134999  7 16  6         .
    0 2012 0 66.4399442931081  7 16  6         .
    0 2013 0 63.2276797880626  7 16  6         .
    0 2014 0 67.7732057853802  7 16  6  65.60992
    0 2015 0 70.8926962288317  7 16  6  66.43994
    0 2016 0 72.6582504622014  7 16  6  63.22768
    0 2017 0 43.8106361047462  7 16  6  67.77321
    0 2018 0 43.4283965923999  7 16  6  70.89269
    0 2019 0 73.2896868159528  7 16  6  72.65825
    0 2020 0 62.4351071424651  7 16  6  43.81063
    0 2021 0 40.0375784760175  7 16  6   43.4284
    1 2011 0 85.0268621850775 11 16  7         .
    1 2012 0 78.9426888141935 11 16  7         .
    1 2013 0 77.4236926863074 11 16  7         .
    1 2014 0 78.6814914246383 11 16  7  85.02686
    1 2015 0 77.9375918659868 11 16  7  78.94269
    1 2016 0 82.9990343544691 11 16  7  77.42369
    1 2017 1 84.0683317621177 11 16  7  78.68149
    1 2018 1 90.2028291012146 11 16  7  77.93759
    1 2019 1 88.5571342074301 11 16  7  82.99903
    1 2020 1 88.8228645605731 11 16  7  84.06833
    1 2021 1 71.7245148231948 11 16  7  90.20283
    0 2011 0 32.7415847765759  9 16  8         .
    0 2012 0 44.2532698323536  9 16  8         .
    0 2013 0 50.8319347542704  9 16  8         .
    0 2014 0 43.8587779103804  9 16  8 32.741585
    0 2015 0    37.5646581668  9 16  8  44.25327
    0 2016 0 39.5202520977194  9 16  8  50.83194
    0 2017 0  52.011131622474  9 16  8  43.85878
    0 2018 0 55.3660961328048  9 16  8  37.56466
    0 2019 0 64.3802455808724  9 16  8  39.52025
    0 2020 0 64.8205654415014  9 16  8  52.01113
    0 2021 0 72.8088852828311  9 16  8   55.3661
    0 2011 0 17.3903271947076  7  2  9         .
    0 2012 0 21.1788501610354  7  2  9         .
    0 2013 0  15.603551345345  7  2  9         .
    0 2014 0 27.4208538785646  7  2  9 17.390327
    0 2015 0 30.9917279103325  7  2  9  21.17885
    0 2016 0  38.225405750625  7  2  9  15.60355
    0 2017 0 40.4168935663484  7  2  9 27.420855
    0 2018 0 38.3637274393934  7  2  9  30.99173
    0 2019 0 43.5223852622498  7  2  9  38.22541
    0 2020 0 37.2227158988141  7  2  9  40.41689
    0 2021 1 38.9589151189798  7  2  9  38.36373
    0 2011 0 47.2978240148119  5 18 10         .
    end
    label values IndustryCode IndustryCode
    label def IndustryCode 2 "Consumer Discretionary", modify
    label def IndustryCode 5 "Financials", modify
    label def IndustryCode 7 "Industrials", modify
    label def IndustryCode 9 "Materials", modify
    label def IndustryCode 11 "Utilities", modify
    label values CountryCode CountryCode
    label def CountryCode 2 "Belgium", modify
    label def CountryCode 4 "Denmark", modify
    label def CountryCode 11 "Italy", modify
    label def CountryCode 13 "Netherlands", modify
    label def CountryCode 16 "Spain", modify
    label def CountryCode 18 "United Kingdom", modify
    label values CompanyCode CompanyCode
    label def CompanyCode 1 "A2A SpA", modify
    label def CompanyCode 2 "ACS Actividades de Construccion y Servicios SA", modify
    label def CompanyCode 3 "AP Moeller - Maersk A/S", modify
    label def CompanyCode 4 "ASOS PLC", modify
    label def CompanyCode 5 "Aalberts NV", modify
    label def CompanyCode 6 "Abengoa SA", modify
    label def CompanyCode 7 "Acciona SA", modify
    label def CompanyCode 8 "Acerinox SA", modify
    label def CompanyCode 9 "Ackermans & Van Haaren NV", modify
    label def CompanyCode 10 "Admiral Group PLC", modify
    Last edited by Annika Katharina; 16 Sep 2022, 03:28.

  • #2
    This is normal and expected. In your data the Treatment variable is constant within CompanyCode, so it is colinear with the fixed effects in the fixed-effects regression being carried out. Remember that the Treatment variable in such a model does not represent the treatment effect. In fact, its coefficient, were you able to get it, would be meaningless anyway. The interaction between treatment and time is what matters, and that is not affected by this colinearity. So, everything is fine.

    Added: Sorry, that's wrong. That would be correct if you were doing the analysis directly in -xtreg, fe-. But -xtdidreg- has a different way of using the variables. For -xtdidreg-, you need to change your Treatment variable to be 1 only during the years after the policy was actually adopted. In other words, the variable Treatment should actually represent the treatment#post_implementation interaction.
    Last edited by Clyde Schechter; 16 Sep 2022, 09:06.

    Comment


    • #3
      Thank you, got it!

      I have one further question regarding this approach.
      I currently aim to include multiple years in my analysis. However, treatment assignment times vary on a company level, as a company-specific policy can be introduced in any of the years ranging from 2015-2020.

      Assuming that my Treatment group is constituted of companies which adapt a policy in any of these years, treatment assignment time now obviously varies. My control group however, are still companies which never assign the treatment.
      How would I now go about estimating the treatment effect? From reading threads in the forum it is my understanding, that I need to conduct a generalized DiD with fixed effects, since I am using panel data.
      What is unclear to me is how I would code my periods.
      - Treatment: 0 pre- and 1 post-policy introduction?
      - Control: irrelevant since interaction term would be zero anyways?
      - How would I then be able to include differing treatment assignment times? Is it a problem that I arrive at varying amounts of firm-period observations by including e.g. a variable for treatment time (e.g. t-2, t-1, t-0, t-1, t-2). How would I include these "leveled" years in my analysis?


      I appreciate your input!

      Thank You!

      Comment


      • #4
        To do the generalized DID analysis you use neither a pre-post variable, nor a treatment vs control group. Instead, you create a variable, call it in_treatment, which takes on the value 1 in any observation where the firm has adopted a policy (i.e. it is currently treated) and 0 in any other observation (meaning either that the firm has not yet adopted a policy, or is a "control" firm that never does adopt a policy.) Then you do a regression with in_treatment as the main predictor variable, and you include fixed effects for both year and firm. The coefficient of in_treatment is then the generalized DID estimator of the treatment effect.

        Comment


        • #5
          Thank you for your insights!
          If I grasp it correctly, a variable indicating whether a company has adopted the policy or not in the respective year could then be used as in_treatment, which would yield the same results as including an interaction term of i.prepost##treatment, correct?

          So a regression command would simply look like
          xtreg DepVar Policy $Covariates i.Company i.Year

          From your experience, would you suggest that this approach is more feasible than conducting a standard DID and assigning Treatment & Control groups a pre-post variable depending on their individual time of treatment (Treatment group) or a firm-invariant specific year (Control group)?

          Comment


          • #6
            ...which would yield the same results as including an interaction term of i.prepost##treatment
            Well, if you had a situation where all firms began treatment at the same time, in_treatment would, indeed, equal i.prepost##i.treatment. And conceptually they denote the same thing: in this observation we are looking at a firm that has undergone the treatment. But because different firms started treatment at different times, it is not possible to define anything that works just like the prepost variable in a standard DID analysis. So it in_treatment is a substitute for that interaction term.

            So a regression command would simply look like
            xtreg DepVar Policy $Covariates i.Company i.Year
            Not quite.
            Code:
            xtset Company Year
            xtreg DepVar Policy $Covariates i.Year, fe
            You may want to also specify clustered standard errors at the Company level. (Note that the use of Company and Year fixed effects is mandatory for the generalized DID, whereas for standard DID the use of time fixed effects is optional (or, I should say, is determined by other considerations), and standard DID can also be used with serial cross-sectional data (hence no panel/company level fixed effects). Generalized DID is not possible with serial cross-sectional data, and if the time fixed effect is omitted, the results will be wrong.

            From your experience, would you suggest that this approach is more feasible than conducting a standard DID and assigning Treatment & Control groups a pre-post variable depending on their individual time of treatment (Treatment group) or a firm-invariant specific year (Control group)?
            The generalized DID approach is quite superior. The stipulation of a firm-invariant specific year to define pre-post for the control group is just arbitrary, can be manipulated to artificially produce preferred results, and in no case does it validly represent what is going on in the data generating process. An alternative approach that I used to recommend that is somewhat along those lines is to pair each treated firm with a control firm, matching on the most key covariates, and then imputing the start year of the treated firm to the matched control firm as well. But matching in panel data is pretty complicated, and the correct analysis requires using random effects because a third level has been introduced--and that is frowned upon in financial and economic work. I really think the generalized DID approach is your best bet.

            Comment


            • #7
              Thank you for the clarification. In that case, I will try to continue with generalized DiD. Thus, my code would look something like this:
              Code:
              xtreg DepVar Policy $Covariates i.Year, fe vce(cluster Company)
              In previous steps I have tried to match my control groups to treatment groups based on psmatch2 using the _nn indication to perform matching based on pre-introduction levels of covariates. How would I alternatively include random effects here? And would I then continue standard DiD deploying code such as:
              Code:
              xtreg DepVar i.PrePost##Treatment i.Year $Covariates, fe
              For the generalized DiD approach, is there anything else to consider such as parallel trends assumption? What kind of robustness checks could be performed after the analysis, e.g. anticipation effects etc.?

              Comment


              • #8
                In previous steps I have tried to match my control groups to treatment groups based on psmatch2 using the _nn indication to perform matching based on pre-introduction levels of covariates. How would I alternatively include random effects here?
                If you take that approach, you have a three level model. You have repeated observations nested in companies, and companies are nested in pairs. So you need an additional variable, call it pair_num, that identifies the matched pairs and then you have to do a 3-level random effects model:
                Code:
                mixed DepVar i.PrePost##Treatment i.Year $Covariates || pair_num: || Company:
                Again, I no longer encourage this approach, and I'm just showing you this because you asked about how it is done.

                For the generalized DiD approach, is there anything else to consider such as parallel trends assumption? What kind of robustness checks could be performed after the analysis, e.g. anticipation effects etc.?
                Yes, just as with regular DID. The parallel trends analysis is carried out using the pre-treatment observations among those who got treated and, at least potentially, all observations in the group that never gets treated. I say "potentially" here because, for example, if all of the treated group began treatment no later than, say 2016, but data is available all the way up to, say, 2021, then the never-treated group's data after 2016 is not needed for the parallel trends. And yes, you should do robustness checks where you move every treatment start date forward one or more years, and another where you move every treatment start date backward one or more years. If your data are plentiful enough to support it, you should also consider analyses in which you model delayed onset of treatment effect followed by peak and then decay if that seems mechanistically reasonable.

                Basically, any robustness analysis you would do with ordinary DID can be done, perhaps with slight modification, following generalized DID.

                Comment


                • #9
                  Thank you!

                  If your data are plentiful enough to support it, you should also consider analyses in which you model delayed onset of treatment effect followed by peak and then decay if that seems mechanistically reasonable.
                  Could you please elaborate on that?

                  One additional question. If I wanted to include Industry-Year fixed effects in my generalized DiD, could I do so by following the below code?

                  Code:
                  areg DepVar $Covariates i.IndustryCode#i.Year, a(CompanyCode)
                  xtset CompanyCode
                  xtreg DepVar Policy $Covariates i.IndustryCode#i.Year, fe vce(cluster Company)

                  Comment


                  • #10
                    One additional question. If I wanted to include Industry-Year fixed effects in my generalized DiD, could I do so by following the below code?
                    No, because the code you show does not include the in_treatment variable. But if you put that in, then, yes. However, is your data set large enough to support an analysis with that many variables? Remember, if you have I industries and Y years, then you have (I-1)*(Y-1) variables to cover the industry#year fixed effects. Do you have enough observations to handle that many predictors?

                    Could you please elaborate on that?
                    A little bit. The generalized DID model we have been talking about up to now (and the regular DID model, too) stipulate that the intervention effect is seen immediately in the outcome as soon as the intervention starts and is sustained at the same level forever after that. Few real world things are like that. So it sometimes makes sense to have a polytomous in_treatment variable. You code it 0 before treatment, 1 in the first year of treatment, 2 in the second, etc. This allows for the treatment effect to vary independently from year to year following inception. Each year's effect is estimated in the coefficient of the corresponding level of in_treatment. That is, the treatment effect in year 4 is given by the coefficient of 4.in_treatment. What is typically observed is that the treatment effect increases for a while, reaches a peak some number of years out, and then declines again. Whether it rises sharply or gradually, and decays sharply or gradually depends on the particular treatment and the environment in which it is operating. But, you are now introducing a lot more variables, and if you are to get usefully precise estimates of their coefficients, you need an ample number of observations in each level of in_treatment (including the 0 level). There is no hard and fast rule about how many observations constitute an ample number, a good rule of thumb is that you need 50 observations for each level, and would prefer to have 100 or more.
                    Last edited by Clyde Schechter; 28 Nov 2022, 17:11.

                    Comment


                    • #11
                      Thank you!

                      For clarification, Policy is my in_treatment variable. Do you mean that I should integrate that variable into "areg" as well, thus arriving at a code similar to the code below?

                      Code:
                      areg DepVar Policy $Covariates i.Industry#i.Year, a(Company)
                      xtset Company
                      xtreg DepVar Policy $Covariates i.Industry#i.Year, fe vce(cluster Company)

                      Comment


                      • #12
                        Yes.

                        Comment


                        • #13
                          Thank You!
                          One more question regarding PTA/Robustness. If I am to move the treatment start date forward/backward by one year, what is the outcome satisfying my PTA assumption. With canonical 2x2 DiD I am looking for insignificant coefficients for deleting the introduction year/introducing a "dummy" introduction year, however, if I only move treatment start dates, what would the ideal outcome to confirm PTA?

                          Comment


                          • #14
                            I would still use the same outcome variable as the original (generalized) DID for the robustness/sensitivity analysis. The idea is to show that the findings when using the correct start years evaporate if we try the same model using different start years. I wouldn't bother doing a parallel trends analysis for the robustness analysis: you've already looked at parallel trends for the original model. That's sufficient.

                            Comment


                            • #15
                              Thank you for your clarification. I was referring more to the overall PTA in the original model. How would I go about testing PTA here?

                              Comment

                              Working...
                              X