Announcement

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

  • reghdfe: saving fixed effect + its standard error

    Hi everyone,


    I am estimating a triple Difference-in-Differences model in STATA to analyse the effects of a policy that was implemented in a staggered way in a country’s provinces over multiple years. The the differences are:
    • time: pre/post
    • regions: different regions a re treated at different points in time
    • subgroup of population: say I want to estimate the effect of the policy on the population with a characteristic C vs. the rest of the population.
    Using year and municipality fixed effects (the regional variation is at “higher” level, i.e. each region in which the policy is implemented contains multiple municipalities), I run the following specification :


    Click image for larger version

Name:	3DDeq.png
Views:	1
Size:	8.6 KB
ID:	1529131



    Where C_i is whether individual I has the characteristic C, \phi_j is a set of municipality fixed effects, and \phi_t are year fixed effects. Since Treated\_mun_{jt} is a time-varying dummy for whether municipality j is treated in t, the first line is the triple interaction. The second line are the simple interactions and the third line contain the main effects.


    The coefficients that I am really interested in are \beta (triple interaction) and \delta (main effect of characteristic C), since I want to see by how much the gap (\delta) closes with the implementation of the policy (\beta).


    The problem: Since I have data in the millions and a large amount of fixed effects it takes a relatively long time to estimate this via the usual reg command in STATA. So I turned to reghdfe which seems to be well suited for this estimation. However, whatever way of specifying the command I cannot get it to show me the \delta coefficient. I have tried the following:



    1) Leaving the C main effect outside of the absorb() option:

    Code:
     reghdfe y 1.C#1.Treated_mun 1.C , absorb(i.year##i.municipality i.year#i.C i.municipality#i.C) vce(cl municipality)
    The issue with this specification is that the coefficient on C is dropped due to collinearity, which makes sense since it is included in the absorbed FEs. I’ld just want reghdfe to drop the C main effect that is included in the absorb() option instead and show the one that is outside the absorb() option. (Side question: reghdfe seems to be insensitive to # or ## when specifying interactions, i.e. even if I specify an interaction between two variables with # it would still include both main effects, whereas this is not the case with the regular reg command.Is that correct? Any way of specifiying only the interaction w/o main effects in reghdfe?)


    2) Including the C main effect in the absorb() option and using the save FE feature:

    Code:
     reghdfe y 1.C#1.Treated_mun, absorb( C_FE=1.C i.year##i.municipality i.year#i.C i.municipality#i.C) vce(cl municipality)

    Here the issue is that I don’t quite understand how the FE is saved. As it is a binary variable I am expecting a single value for the individuals with characteristic C. Instead what reghdfe saves are two values one for individuals with characteristic C and one for individuals without characteristic C. They don’t add up or similar to the FE I am getting when using the reg command on the same data. How do I interpret the saved FE?


    Does anybody how I can solve this issue? Doesn’t matter whether it’s via fixing the first or the second reghdfe specification or any other way of speeding up the estimation procedure significantly.


    Thanks a lot!

    Best,

    Laurenz

  • #2
    Revisiting if anyone knows an answer to this

    Comment


    • #3
      Hi Fahad
      When comparing reghdfe and reg i. you need to keep in mind that using dummies always drops at least 1 dummy to avoid the dummy variable trap.
      However, when using reghdfe, one implicitly estimates values for ALL dummies (not dropping any), but imposes the assumption that in average, all dummies add up to zero.
      That is the connection between Saved fixed effects, and using the dummy variable approach.
      F

      Comment

      Working...
      X