Announcement

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

  • Interaction term omitted due to collinearity

    Hi Stata family,

    I'm currently working on my economics dissertation, trying to investigate the Belt and Road Initiative's impact on quality of economic growth (represented by total factor productivity [TFP]) on participating countries.

    I am employing the empirical model designed in Ma (2022), replacing the independent variable lnpdgp with TFP in my research. Here I attach a screenshot of their methodology.


    Click image for larger version

Name:	Screenshot 2024-07-07 at 13.41.50.png
Views:	1
Size:	174.5 KB
ID:	1758020

    As described, Treat signals whether a country is a BRI country and Post shows when this country has become a member of BRI. Now, I run this regression in my Stata with various commands, they all end up eating up my interaction term because of collinearity. The only one time that it doesn't, is when I didn't control for country and time fixed effects. I would really appreciate some insights from you brilliant minds! I attach my various attempts and their failed results. I also tried adding both of the dummies individually as controls, but that ate up my Treat variable due to collinearity instead of my interaction term.

    Thanks so much for your help!! Any thoughts would be a life saver to me!
    Click image for larger version

Name:	Screenshot 2024-07-07 at 13.49.52.png
Views:	3
Size:	488.2 KB
ID:	1758023
    Click image for larger version

Name:	Screenshot 2024-07-07 at 13.49.52.png
Views:	3
Size:	488.2 KB
ID:	1758024
    Click image for larger version

Name:	Screenshot 2024-07-07 at 13.50.40.png
Views:	1
Size:	487.9 KB
ID:	1758025

    Attached Files

  • #2
    Look at the first 22 lines. All treated units need to have treat be equal to 1, and all of those need post to be 1 only in the post period.

    But you have staggered adoption (unless all countries were treated at once). So in the first place, you need to use a DD design that may account for this fact. In the xtreg code, you just need treatment variable, an outcome, and time and unit dummies.

    As usual, I'll plug here that DID's parallel trends assumption is typically unfeasible. You're better off using the synthetic control method, which can account for staggered adoption and has a more defensible parallel trends assumption.

    Comment


    • #3
      Hi Jared,

      Thanks for replying. Are you saying that for xtreg code, I should drop the interaction term and just leave it as xtreg followed by independent variable, control variables, year dummy and country dummy?

      Thanks so much again!

      Comment


      • #4
        If all are treated at the same time, then:

        Code:
        ssc install reghdfe
        reghdfe ctfp c.treat#c.post nr hc to gs , absorb(id year) cluster(id)
        As Jared notes, if staggered treatment, then start looking for another estimation method. csdid, jwdid, and so forth.

        Comment


        • #5
          As the OP knows, the FAQ recommend given and family name and using CODE delimiters instead of screenshots to share what you typed and what Stata gave you back.
          That said:
          1) with such a large sample size, you should use cluster-robust standard errors;
          2) it's rare that the main conditional terms of the interaction are excluded form the regression equation. That is:
          Code:
          i.Treat##i.Post
          instead of
          Code:
          i.Treat#i.Pos
          3) unlike Jared, I'm not clear whether you have a DID design or not.
          Last edited by Carlo Lazzaro; 07 Jul 2024, 09:17.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Lots of this hinges on how you've codes things, but yes. If you're going to use the interaction term, you now don't need xtreg because your treatment variable will be collinear with the unit dummies. If you're going to use xtreg, fe, you now don't need the interaction term. The code that I've linked to shows show we can get the DID result in 3 different ways.

            However, all this is predicated on the design matrix (that is, the treatment assignment matrix/patterns of adoption). If everyone is treated at once, then this isn't an issue, but if you have staggered adoption, then you'll need to use (presumably) DID methods to account for the imbalance betwixt calendar time and event time, as George says above.

            Comment


            • #7
              Hey, thanks to all those have responded here. I used csdid as suggested by George, and here's what I got. I have two followup questions I was hoping you could shed some light on!

              1)I'm not quite sure about how to interpret these results as I'm new to this command.
              For example for g2014, t_2004_2005: For countries treated in 2014, during the period of 2004 - 2005, what does the coefficient mean? I'm guessing the coefficient after 2014 means that by becoming a treated country, its impact on TFP (the outcome) is the coefficient?

              2)For g2016, it reports 0. I was wondering if it was because there was only one country that was first treated in 2016? How do I deal with this if I still want this country to be in my analysis?

              3)Is the dripw method appropriate here?

              Thanks so much again!

              Code:
              csdid ctfp nr hc to gs, ivar(country1) time(year) gvar(first_treat) method(dripw)
              ..............................xxxxxxxxxxxxxxx.....
              ........................................
              Difference-in-difference with Multiple Time Periods
              
                                                                       Number of obs = 1,664
              Outcome model  : least squares
              Treatment model: inverse probability
              ------------------------------------------------------------------------------
                           | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
              -------------+----------------------------------------------------------------
              g2014        |
               t_2004_2005 |   .0504505   .0290229     1.74   0.082    -.0064332    .1073343
               t_2005_2006 |   .0403121   .0256689     1.57   0.116    -.0099979    .0906222
               t_2006_2007 |   .0056178   .0087562     0.64   0.521     -.011544    .0227796
               t_2007_2008 |   .0040182   .0184561     0.22   0.828    -.0321551    .0401916
               t_2008_2009 |   .0293339   .0171807     1.71   0.088    -.0043397    .0630076
               t_2009_2010 |   .0128291   .0201001     0.64   0.523    -.0265663    .0522245
               t_2010_2011 |  -.0199018   .0209418    -0.95   0.342     -.060947    .0211434
               t_2011_2012 |   .0222844   .0176387     1.26   0.206    -.0122868    .0568556
               t_2012_2013 |  -.0288066   .0205475    -1.40   0.161     -.069079    .0114657
               t_2013_2014 |   .0287991   .0197688     1.46   0.145    -.0099471    .0675452
               t_2013_2015 |   .0415189   .0280086     1.48   0.138     -.013377    .0964148
               t_2013_2016 |   .0358113   .0254291     1.41   0.159    -.0140287    .0856513
               t_2013_2017 |   .0499735   .0322432     1.55   0.121     -.013222     .113169
               t_2013_2018 |   .0264026   .0273154     0.97   0.334    -.0271346    .0799399
               t_2013_2019 |   .0244901   .0279648     0.88   0.381      -.03032    .0793002
              -------------+----------------------------------------------------------------
              g2015        |
               t_2004_2005 |   -.017603    .015821    -1.11   0.266    -.0486116    .0134056
               t_2005_2006 |   .0122149   .0087959     1.39   0.165    -.0050247    .0294545
               t_2006_2007 |   .0239608   .0096683     2.48   0.013     .0050114    .0429102
               t_2007_2008 |   .0155265   .0114678     1.35   0.176      -.00695     .038003
               t_2008_2009 |   .0290129   .0155632     1.86   0.062    -.0014904    .0595162
               t_2009_2010 |   .0160727   .0067362     2.39   0.017       .00287    .0292754
               t_2010_2011 |  -.0112538   .0085556    -1.32   0.188    -.0280224    .0055149
               t_2011_2012 |   .0266964   .0167777     1.59   0.112    -.0061873      .05958
               t_2012_2013 |  -.0068258     .00932    -0.73   0.464    -.0250925     .011441
               t_2013_2014 |   .0017936   .0119588     0.15   0.881    -.0216452    .0252325
               t_2014_2015 |   .0249513   .0139717     1.79   0.074    -.0024326    .0523352
               t_2014_2016 |   .0255272   .0232344     1.10   0.272    -.0200113    .0710658
               t_2014_2017 |    .024894   .0203566     1.22   0.221    -.0150041    .0647921
               t_2014_2018 |   .0275576   .0211908     1.30   0.193    -.0139757    .0690909
               t_2014_2019 |   .0363884    .026353     1.38   0.167    -.0152625    .0880393
              -------------+----------------------------------------------------------------
              g2016        |
               t_2004_2005 |          0  (omitted)
               t_2005_2006 |          0  (omitted)
               t_2006_2007 |          0  (omitted)
               t_2007_2008 |          0  (omitted)
               t_2008_2009 |          0  (omitted)
               t_2009_2010 |          0  (omitted)
               t_2010_2011 |          0  (omitted)
               t_2011_2012 |          0  (omitted)
               t_2012_2013 |          0  (omitted)
               t_2013_2014 |          0  (omitted)
               t_2014_2015 |          0  (omitted)
               t_2015_2016 |          0  (omitted)
               t_2015_2017 |          0  (omitted)
               t_2015_2018 |          0  (omitted)
               t_2015_2019 |          0  (omitted)
              -------------+----------------------------------------------------------------
              g2017        |
               t_2004_2005 |   .0196046   .0156094     1.26   0.209    -.0109893    .0501985
               t_2005_2006 |   .0206271   .0108905     1.89   0.058    -.0007179    .0419721
               t_2006_2007 |  -.0112965   .0159946    -0.71   0.480    -.0426454    .0200524
               t_2007_2008 |    .004605   .0144306     0.32   0.750    -.0236785    .0328884
               t_2008_2009 |   .0203597     .00897     2.27   0.023     .0027788    .0379405
               t_2009_2010 |   .0079834   .0096212     0.83   0.407    -.0108737    .0268406
               t_2010_2011 |   .0100946   .0090517     1.12   0.265    -.0076463    .0278356
               t_2011_2012 |   .0025357   .0063935     0.40   0.692    -.0099952    .0150667
               t_2012_2013 |   .0004337   .0068595     0.06   0.950    -.0130107    .0138782
               t_2013_2014 |   .0171931   .0121724     1.41   0.158    -.0066643    .0410505
               t_2014_2015 |    .002551    .009357     0.27   0.785    -.0157884    .0208905
               t_2015_2016 |   .0124468   .0107363     1.16   0.246    -.0085959    .0334895
               t_2016_2017 |   .0070965   .0089141     0.80   0.426    -.0103748    .0245678
               t_2016_2018 |  -.0014823   .0091266    -0.16   0.871    -.0193701    .0164055
               t_2016_2019 |   .0058799   .0136177     0.43   0.666    -.0208104    .0325702
              -------------+----------------------------------------------------------------
              g2018        |
               t_2004_2005 |   -.014536    .014135    -1.03   0.304    -.0422402    .0131682
               t_2005_2006 |  -.0000303   .0136591    -0.00   0.998    -.0268016     .026741
               t_2006_2007 |   .0079842   .0095577     0.84   0.404    -.0107485    .0267169
               t_2007_2008 |   .0246921    .018511     1.33   0.182    -.0115887     .060973
               t_2008_2009 |   .0026169   .0223382     0.12   0.907    -.0411651    .0463988
               t_2009_2010 |  -.0031189   .0097287    -0.32   0.749    -.0221867    .0159489
               t_2010_2011 |  -.0021227   .0126943    -0.17   0.867    -.0270031    .0227576
               t_2011_2012 |   .0084221   .0139449     0.60   0.546    -.0189094    .0357536
               t_2012_2013 |    .007696   .0156822     0.49   0.624    -.0230406    .0384326
               t_2013_2014 |  -.0005222   .0103437    -0.05   0.960    -.0207954    .0197511
               t_2014_2015 |   -.004211   .0155618    -0.27   0.787    -.0347115    .0262895
               t_2015_2016 |   .0006698   .0072197     0.09   0.926    -.0134806    .0148201
               t_2016_2017 |  -.0004864   .0070893    -0.07   0.945    -.0143811    .0134084
               t_2017_2018 |   .0095937   .0085937     1.12   0.264    -.0072497     .026437
               t_2017_2019 |   .0112908   .0093734     1.20   0.228    -.0070806    .0296623
              -------------+----------------------------------------------------------------
              g2019        |
               t_2004_2005 |   .0161121    .025227     0.64   0.523    -.0333319    .0655561
               t_2005_2006 |   -.005463   .0082664    -0.66   0.509    -.0216649    .0107389
               t_2006_2007 |    .012597   .0076811     1.64   0.101    -.0024577    .0276518
               t_2007_2008 |   .0108278   .0089048     1.22   0.224    -.0066252    .0282809
               t_2008_2009 |   .0203616   .0100357     2.03   0.042     .0006919    .0400313
               t_2009_2010 |   .0133562   .0110309     1.21   0.226     -.008264    .0349764
               t_2010_2011 |  -.0249448   .0106154    -2.35   0.019    -.0457506    -.004139
               t_2011_2012 |   .0064593   .0093068     0.69   0.488    -.0117817    .0247003
               t_2012_2013 |  -.0017971    .011375    -0.16   0.874    -.0240917    .0204974
               t_2013_2014 |   .0257529   .0206383     1.25   0.212    -.0146974    .0662033
               t_2014_2015 |   .0050151   .0104847     0.48   0.632    -.0155345    .0255647
               t_2015_2016 |   .0068308   .0081059     0.84   0.399    -.0090564     .022718
               t_2016_2017 |    .008926   .0118103     0.76   0.450    -.0142219    .0320738
               t_2017_2018 |  -.0093238   .0120356    -0.77   0.439     -.032913    .0142655
               t_2018_2019 |   .0076348   .0048919     1.56   0.119    -.0019531    .0172227
              ------------------------------------------------------------------------------
              Control: Never Treated
              
              See Callaway and Sant'Anna (2021) for details
              Last edited by Cami Zhang; 07 Jul 2024, 11:26.

              Comment

              Working...
              X