Announcement

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

  • Fixed effects dropped in reghdfe with balanced panel

    Hi everyone,

    I'm a PhD student working on a paper and desperately hoping someone can help me clarify something that's puzzling me.

    I’m working with a fully balanced panel dataset in which each product (identified by ASIN) is observed in both the US and Canada markets for every month in the sample (16 months total). That means I have 32 observations per product—16 in the US (treatment group), and 16 in Canada (control group). So for every product-month combination, I have exactly two rows: one treated, one control.

    I’m trying to estimate a DID model using reghdfe and absorbing product fixed effects (asin). My regression looks like this:

    reghdfe log_review_count i.post i.treat i.post##i.treat, absorb(asin) vce(cluster asin)

    The issue is that all product fixed effects are dropped (the output says Num. Coefs = 0 for asin), and so the coefficients are identical to when I run the model without any fixed effects at all.
    I’m confident there’s no data issue and each product has full variation in both treatment and post status.
    I have also tried using xtreg but get the same results. However when I include "i.asin" in this model, the coefficients for each product is estimated but still the interaction term's coefficient is the same.

    Is this expected behavior? And more importantly how can I explain this to journal reviewers in a rigorous way? Any references or technical explanations would be a huge help.

    Thank you so much in advance.
    Parto

    1) Screenshot of the dataset
    Click image for larger version

Name:	Screenshot 2025-05-14 at 4.06.10 PM.png
Views:	1
Size:	65.5 KB
ID:	1777444


    1) Output
    Click image for larger version

Name:	Screenshot 2025-05-14 at 4.10.43 PM.png
Views:	1
Size:	175.2 KB
ID:	1777445

  • #2
    Parto:
    the community-contributed module -reghdfe- (as the FAQ recommend to mention it) footnote explains the issue.
    In addition, why using -reghdfe- with one -fe- only?
    That said, if you want to run a panel dataset DID, why not using -xtdidregress-?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Parto:
      the community-contributed module -reghdfe- (as the FAQ recommend to mention it) footnote explains the issue.
      In addition, why using -reghdfe- with one -fe- only?
      That said, if you want to run a panel dataset DID, why not using -xtdidregress-?
      Thank you so much for your reply and suggestions, Carlo.

      However, the issue I'm facing still remains. Even when I switch from reghdfe to xtreg, I get identical coefficients for my main variables (e.g., treat, post, treat × post) regardless of whether I include product fixed effects, month fixed effects, or both.

      Do you happen to know why the fixed effects (of any kind) would have no impact on the main coefficients? I've seen a similar question on the forum here.

      Thanks again!

      - Without FE:

      xtreg log_review_count i.post i.treat i.treatxpost

      Output:


      ------------------------------------------------------------------------------
      log_review~t | Coefficient Std. err. z P>|z| [95% conf. interval]
      -------------+----------------------------------------------------------------
      1.post | .2126049 .0154347 13.77 0.000 .1823535 .2428563
      1.treat | .6682248 .0149738 44.63 0.000 .6388767 .697573
      1.treatxpost | .428306 .0218279 19.62 0.000 .3855241 .4710879
      _cons | 1.4506 .0236398 61.36 0.000 1.404267 1.496933
      -------------+----------------------------------------------------------------

      - With FE:
      xtreg log_review_count i.post i.treat i.treatxpost,fe

      Output:

      ------------------------------------------------------------------------------
      log_review~t | Coefficient Std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      1.post | .2126049 .0154347 13.77 0.000 .1823514 .2428584
      1.treat | .6682248 .0149738 44.63 0.000 .6388746 .697575
      1.treatxpost | .428306 .0218279 19.62 0.000 .3855211 .471091
      _cons | 1.4506 .0105881 137.00 0.000 1.429847 1.471354
      -------------+----------------------------------------------------------------

      Comment


      • #4
        This is the expected behavior in a DID analysis when all treated units begin treatment at the same time.

        The treat variable, in any DID analysis, will be a time-invariant attribute of the units. So if you add a fixed effect at that level, the treat variable becomes colinear with that fixed effect. Typically that colinearity is resolved by the removal of the treat variable, but no information has been lost because that information is now carried in the unit-level fixed effects. So this has no effect on the estimates of the interaction.

        Now think about the post variable. In the condition where all treated units begin treatment simultaneously, the post variable becomes a unit-invariant attribute of the time periods. So, similarly, when you introduce time fixed effects, the post variable is colinear with them, and the time effects carry its information. So, again, there will be no effect of this on the estimates of the interaction.

        Comment

        Working...
        X