Announcement

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

  • Use of binary explanatory (control) variables in Difference-in-Difference Estimation

    Hi all,

    I am conducting a Diff-in-Diff with the following data, which is copied in here by using the dataex command. The normal DD regression works just fine. However, I would strongly like to include control variables. All the ones that are expressed in percentages (GDP-growth, inflation, remmitances..) work fine too. The binary (dummy) ones, like membership in some supranational bodies, for instance the EU, do absolutely not. Stata always states that they're omitted because of collinearity and I do not get way this is the case, to be honest. The same variables work fine with FE and Random Effects and also in bigger samples than the one displayed below.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int year str7 countryname str12 countryyear double new_avwgi byte(EU_candidate EU_member Intrastate_conflict) double(new_exports new_FDI new_GDP new_inflation new_remittances) byte(time BRI_state) float(did did_EUaccess)
    2010 "Estonia" "Estonia.2010"    1.0663436849912007 0 1 0 75.07823021170658  13.302610404251492   2.259075893831181  2.97204512015696 1.8324759753382773 0 0 0 0
    2011 "Estonia" "Estonia.2011"    1.0747986833254497 0 1 0 86.53972527282187   4.827558144959612   7.597300209245603   4.9819013145361 1.8919482862267252 0 0 0 0
    2012 "Estonia" "Estonia.2012"    1.0621930360794067 0 1 0 85.98943858726155  7.7592920176217595   4.307258987653256  3.93339987296979 1.9998493379228786 0 0 0 0
    2013 "Estonia" "Estonia.2013"     1.112437019745509 0 1 0 84.30308150402843   4.370606686465119  1.9365434443487857  2.78056658954996 2.2581279426120306 0 0 0 0
    2014 "Estonia" "Estonia.2014"     1.220025469859441 0 1 0   81.802388001185   6.691461144936392  2.8885638447165007 -.106175146521716 2.0430252776096847 1 0 0 0
    2015 "Estonia" "Estonia.2015"    1.1950828234354656 0 1 0 77.34500432713354 -3.1189166996698736  1.9002865897060275 -.492326006547338 1.9957658562540663 1 0 0 0
    2016 "Estonia" "Estonia.2016"    1.1961500843365986 0 1 0 77.59978592650414   3.916098151538917  3.4890971114797082  .148684907627356  2.027937379229015 1 0 0 0
    2017 "Estonia" "Estonia.2017"    1.1927852034568787 0 1 0 76.54409627801454   5.844004555823057   4.856686856443943  3.41723549488057  1.899560156901767 1 0 0 0
    2010 "Serbia"  "Serbia.2010"     -.1452512772132953 0 0 0 32.25560609728482   4.049632331111981   .7310464430853898  6.14255360247246  9.847691855465044 0 1 0 0
    2011 "Serbia"  "Serbia.2011"    -.10529540820668142 0 0 0 33.00182218001296  10.002289323791814  2.0362757259362922  11.1373976342129  8.036210678703773 0 1 0 0
    2012 "Serbia"  "Serbia.2012"     -.1449378045896689 0 0 0 35.84480697786771   2.946768361558177  -.6815421330412903  7.33038589596636   8.19178067430819 0 1 0 0
    2013 "Serbia"  "Serbia.2013"    -.09417816003163655 0 0 0 39.85150587567927  4.2555897728095555   2.892634162141732  7.69426362896666  8.317079992436222 0 1 0 0
    2014 "Serbia"  "Serbia.2014"     .04181295136610667 1 0 0 42.07752997177007  4.2476586388978035 -1.5895061837666447  2.08244793880151  7.851232973416203 1 1 1 1
    2015 "Serbia"  "Serbia.2015"    .058732101072867714 1 0 0 45.27361076131518   5.910584879417411  1.7763209728228588  1.39235822000187    8.5018044003722 1 1 1 1
    2016 "Serbia"  "Serbia.2016"  .00017994269728660583 1 0 0 48.61545929836844  5.7955002005828735  3.3403290685937606  1.12231397417765  7.887580830680063 1 1 1 1
    2017 "Serbia"  "Serbia.2017"    -.02473145102461179 1 0 0 50.54079107542444   6.556310285630537  2.0493105252801627  3.13106248590119  8.130079194227449 1 1 1 1
    end
    Can anyone help? Your help would be very much appreciated.

    Best,
    Hannes

  • #2
    The dummies likely have no variation over time for any country, and so they drop out in the fixed effect estimation. This is as it should be. There’s a way to bring them back in and still do fixed effects on the other variables.

    Comment


    • #3
      Hi Jeff,

      thank you for your quick reply! Do you know the way to bring them back by any chance? This would help me quite a lot!
      I can check if there are variations by using a correlation matrix, if I am not mistaken?

      Best,
      Hannes

      Comment


      • #4
        You need to use the Mundlak device by including the time averages (probably created using -egen-) of all time-varying variables (except for year dummies). This will reproduce the fixed effects estimates on the the other variables and give you coefficients on the time-constant variables. I probably can turn up an example.

        Comment


        • #5
          Hi Jeff, that would be great if you can! Thanks for the help and your advise so far!

          Comment


          • #6
            This is an exercise I give in a course I teach at UCL in London every May ....
            Attached Files

            Comment


            • #7
              Thank you Jeff! I will have a look at it

              Comment

              Working...
              X