Announcement

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

  • Why does -reghdfe- nest fixed effects within clusters?

    Hi all,
    I'm using Stata 12 and estimating a triple diff-in-diff estimator using reghdfe from SSC -- a user-written generalization of areg for multiple level fixed effects regressions. You can read more on reghdfe here if it interests you: http://www.statalist.org/forums/foru...ailable-on-ssc.

    Some context:

    I have three dimensions to my data: groups, countries and time. In other words I have a panel (unbalanced) that varies by groups and countries. I am exploiting exogenous variation within groups across time so I require group-time fixed effects for my estimates. I was particularly drawn to this package because it allows for high dimension fixed effects and two-way clustered standard errors.

    I do not care about retrieving actual estimates for the fixed effects, only that they be implemented so I ensure I am estimating my coefficient of interest off of exogenous variation.

    So my code looks something like this:

    Code:
    reghdfe outcome main_var [pw = weight], absorb(year#group country#group year#country) vce(cluster group country)

    My problem:

    I have used reghdfe for some time now but never checked SSC for any updates. Today I checked and noticed some had been done so I updated the package.

    After updating, when I run a regression with the above combination of fixed effects and two-way clustering, I get a note that says the following:

    fixed effect nested within cluster; treated as redundant for DoF computation
    I'm confused about 2 things that I hoped someone could clarify:
    1. why are my fixed effects redundant and yet they weren't treated as such with the old version?
    2. why are my standard errors much smaller now?
    I'm confused by the first question and worried about the second because in the latter case so many regressions that were previous insignificant are now significant, which makes me question all my results.

    I have tried to be as comprehensive as possible with this question, but please ask me if you require further information. Thank you.

  • #2
    Hi Andrew,

    That message is not a problem at all. If your fixed effects are the same variable as your cluster unit, then reghdfe tries to avoid penalizing twice for the number of fixed effects (which is not the number of clusters i.e. the number of "effective observations"!). This is the same that xtreg or other packages do.

    This can be generalized further so we check not just if the fixed effects are the same as the clusters but if they are nested inside the cluster units. If that is the case, we don't penalize degrees-of-freedom for that.

    Since we don't penalize DoF, your standard errors will be larger.

    If you want to compare this with your previous results, the dof() option has a number of suboptions that allow you to switch this on or off.

    Best,
    Sergio

    Comment


    • #3
      Hi Sergio,

      Thank you for your response. I now see the none option for dof(), which is giving me similar standard errors to what I estimated with the older version of the reghdfe package. I'm am grateful for your clarification. reghdfe is a great package!

      Best,
      Andrew

      Comment


      • #4
        Hey everybody,

        it seems that I have almost the same problem.

        This is my old regression and everything is fine:

        Code:
        xi: xtreg alphacar llogmtna llogage lexp_ratio lturn_ratio  DummyMIC DummyMID i.quarter, fe cluster(mgmt_cd) nonest

        But now I have to add a second cluster and my prof advised me to use "reghdfe":

        In my opinion that code is what I need:
        Code:
        reghdfe alphacar llogmtna llogage lexp_ratio lturn_ratio  DummyMIC DummyMID, absorb (quarter wficn) vce(cluster quarter mgmt_cd)
        But I get an error message:
        Code:
        Empty sample, check for missing values or an always-false if statement
        r(2000);
        I think the problem is that my panels are not nested in the clusters. That's why I added "nonest" in my first formula.


        So my question is how to handle that problem with the reghdfe regression?



        Thank u in advance


        Bene

        Comment

        Working...
        X