Announcement

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

  • Reporting Treatment and Time Dummies in DiD Models despite Fixed Effects

    Dear Stata users,
    I have a practical issue concerning the use of dummy variables in a difference-in-difference model with fixed effects. Usually, all dummies that a collinear with the fixed effects will be omitted and their coefficient and significance cannot be interpreted in the regression output. But I regularly view papers which the treatment dummy in DiD models with fixed effects that to my understanding ought to get omitted. See this paper (https://www.sciencedirect.com/scienc...72308914000485) where the treatment dummy "affected bank" in table 3 on p. 274 is reported despite the use of individual fixed effects.

    Regarding my regressions, I observe some inconsistencies with the time dummy for periods after the treatment applies. I estimate the following difference-in-difference model using individual and time fixed effects (abbreviated code below) and as robustness country and time fixed effects:
    Code:
    xtreg depvar indepvar i.post15 i.treated i.post15##i.treated controls i.year, fe vce(cluster idno)
    I receive the following output where only the treated-dummy is omitted but not the time dummy:
    Code:
    -----------------------------------------------------------------------------------
                       |               Robust
       depvar |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
              1.post15 |   .5214625   .0472556    11.03   0.000     .4286728    .6142523
         1.treated |          0  (omitted)
                       |
    post15#treated |
                  1 1  |   .6011524   .1515873     3.97   0.000     .3035001    .8988048
                       |
                   yr2 |
                 2011  |   .0337759   .0125834     2.68   0.007     .0090674    .0584844
                 2012  |   .0820242   .0163258     5.02   0.000     .0499674     .114081
                 2013  |   .1399963   .0164042     8.53   0.000     .1077855     .172207
                 2015  |  -.0378953   .0176233    -2.15   0.032    -.0724999   -.0032907
                 2016  |  -.0232412    .016611    -1.40   0.162     -.055858    .0093756
                 2017  |   .0219256   .0145132     1.51   0.131    -.0065721    .0504232
                 2018  |          0  (omitted)
                       |
                 _cons |    3.72202   .0229494   162.18   0.000     3.676957    3.767082
    -------------------+----------------------------------------------------------------
               sigma_u |  1.1245096
               sigma_e |  .60822459
                   rho |  .77366385   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------------
    When I change the order of the code for the regressions like this...
    Code:
     xtreg depvar indepvar i.year i.post15 i.treated i.post15##i.treated controls, fe vce(cluster id)
    ...I receive results where the time dummy (post15) for periods after 2015 is omitted:
    Code:
    -----------------------------------------------------------------------------------
                       |               Robust
       depvar |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
                   yr2 |
                 2011  |   .0337759   .0125834     2.68   0.007     .0090674    .0584844
                 2012  |   .0820242   .0163258     5.02   0.000     .0499674     .114081
                 2013  |   .1399963   .0164042     8.53   0.000     .1077855     .172207
                 2015  |   .4835672   .0454511    10.64   0.000     .3943209    .5728136
                 2016  |   .4982213   .0461855    10.79   0.000     .4075328    .5889099
                 2017  |   .5433881   .0452527    12.01   0.000     .4545313    .6322449
                 2018  |   .5214625   .0472556    11.03   0.000     .4286728    .6142523
                       |
              1.post15 |          0  (omitted)
         1.treated |          0  (omitted)
                       |
    post15#govsupp2_50 |
                  1 1  |   .6011524   .1515873     3.97   0.000     .3035001    .8988048
                       |
                 _cons |    3.72202   .0229494   162.18   0.000     3.676957    3.767082
    -------------------+----------------------------------------------------------------
               sigma_u |  1.1245096
               sigma_e |  .60822459
                   rho |  .77366385   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------------
    Q1: Why does the order of the dummies in the code matter for collinearity?

    When I consider the cited paper above where a treated dummy is reported in a model with individual fixed effects, I wonder how the authors performed the regressions. I can think of the following code for multiple levels of fixed effects:
    Code:
     reghdfe depvar indepvar i.year i.post15 i.treated i.post15##i.treated controls, absorb(id year) vce(cluster id)
    To report the treated dummy, one would to my understanding need to re-estimate the model with only time fixed effects. The results would then stem from two different models and would need to be combined afterward.

    Q2: How to estimate a treatment dummy (for individuals who receive treatment =1, otherwise =0) with individual fixed effects.


    I would appreciate your help.
    Regards,
    Julian
    Last edited by Julian Scholz; 12 Mar 2020, 05:19.

  • #2
    Q1. In the most important sense, the order of the variables does not affect anything at all. If you run -predict- after both versions of the model, you will get exactly the same results. The two models are just algebraic re-parameterizations of the same unidentified model. Stata has its own internal method for choosing which one out of a set of colinear variables to omitThe way Stata makes that choice is, in fact, dependent on the order in which the variables appear in the estimation command. And it really makes no substantive difference which one is selected. That said, if you wish to have control over which is omitted, use the ib. version of factor-variable notation to designate the one you want omitted. (-help fvvarlist-)

    Q2. It can't be done. The examples you see in the papers either are not truly fixed effects models, or the authors and reviewers did not notice that what was being reported are the meaningless artifacts of the arbitrary constraints imposed to identify a model with colinear variables.

    Comment


    • #3
      Thank you, Clyde! What confuses me is that the habit to report some dummies in DiD regression is quite common in finance. I guess estimating "not truly fixed effects models" means to estimate a random effects model and to insert dummies manually, correct?

      Comment


      • #4
        Dear Stata Users,

        I apologize first in advance if this is not where I had to write, but it is the first time I am using the post command.

        I have a Master thesis to write and I've been asked to use Stata software. So I have a panel data with data on the roads that I named "StreetID" and goes from 1 to 20, corresponding to the roads that I currently have.

        I would like to see the impact of a change in public transport fares policy in Switzerland, occured in 2014, on the road congestion. I really need your help!

        Then I have my time variable, called "Year", which goes from 1995 to 2018.

        After doing some basic regressions, I realized that my estimate of the variable I'm interested in, dum2014 (corresponding to 1 if >=2014 and 0 otherwise) is biased. I had used this, my goal being to use fixed effects:

        First, I used the xtset Street ID Year function to form a data panel. And then:

        xtreg ln_Dailyaverage_Cars Number_GE dum2014 Year, fe


        However, I wanted to use a time trend specific to each axis, since in my panel we observe rather a street-specific time trend. Do you know how I can do that on Stata?

        I think we can use, in my case, i.StreetID##c.Year, but I'm not sure. Since I tried it with the xtreg function and it erased a lot of variables due to multicollinearity. When I used:

        xtreg ln_DailyAverage_CarsNumber_GE dum2014 i.StreetID##c.Year,fe - all my StreetID variables (from 2 to 20) were omitted.


        To sum up, I would like to use in my regression a street-specific and time-specific trends to each street/year, since when I used summary statistics, I rather observed a specific-time and street-specific fixed effect on my city of interest.

        I thank you in advance for your advices and wish you a very nice day.

        Best,

        Michael Duarte

        Comment


        • #5
          I think we can use, in my case,
          i.StreetID##c.Year
          , but I'm not sure. Since I tried it with the xtreg function and it erased a lot of variables due to multicollinearity. When I used:

          xtreg ln_DailyAverage_CarsNumber_GE dum2014 i.StreetID##c.Year,fe
          - all my StreetID variables (from 2 to 20) were omitted.
          Yes, you can use that and the code you gave for it is correct. The variables i.StreetID are omitted because they are correlated with the fixed effects that -xtreg, fe- automatically includes in the model. In other words, they are already there and Stata will not include them twice. Stata also does not show you the results for its automatic fixed effects because those parameters are not identifiable in a fixed effects model and any coefficients you would see would just be artifacts of the particular way in which -xtreg, fe- constrains the model to identify it. The street specific time trends that you are looking for are given by the coefficients of the i.StreetID#c.year variables in the output. These coefficients are properly identifiable parameters of the model and the numbers you see there are meaningful estimates of what you are looking for.

          Comment


          • #6
            Hello Professor Clyde,

            Thank you so much for your help. Your explanations seem to me very clear.

            I wish you a wonderful day.

            Best,

            Michael Duarte Gonçalves

            Comment

            Working...
            X