Announcement

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

  • Diff-in-Diff Coefficient Sign Flip with Time Fixed-Effects?

    I have a panel data set which records entity-level transactions on a given date.

    One can think of hospitals purchasing medical equipment (e.g. MRI machine).

    The panel data looks something like:



    I am interested in running a difference-in-difference regression based on a policy change that impacted only a certain group of hospitals on their equipment purchase price.

    In Stata, I perform one with hospital-level FE and one with hospital- and year-level FE models using the command -xtreg, fe-.

    Code:
     reghdfe y i.policy, absorb(id) vce(cluster id)
    reghdfe y i.policy, absorb(id county) vce(cluster id)
    reghdfe y i.policy, absorbe(date id) vce(cluster id)
    reghdfe y i.policy i.date, absorb(id) vce(cluster id)
    reghdfe y i.policy, absorb(date id county) vce(cluster id)
    The coefficients for the (1) and (2) are positive.
    But, for the rest where I include the time fixed-effects, the coefficients are negative.

    My questions:

    (i) Is it possible that inclusion of the time fixed-effects can flip the sign, and if so, why? If it doesn't, why?

    (ii) In my case, how can I detect the cause of the flip of the sign?

    (iii) How is (1) and (2) different each other?

    (iv) How are (3), (4), and (5) different from each other?

  • #2
    Stephen:
    1) it is possible, if -i.year- is responsible for most of the within-panel variation, other things being equal.
    2) If adding -i.year- creates that change in results, probably -i.year- is the cause (please note that -timevar- should be included by default in the right-hand side of the -fe- regression);
    3) the second code included the fixed efefct of county, too (that is probably time-invariant);
    4) the differ for the fixed effects that you want to estimate;
    5) last but not least, you're nit using -xtreg,fe- as far as I can see, but the community-contributed command (as FAQ kindly request you to mention) -reghdfe-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      Thanks for the comments.

      It would be strange to think that the within panel variation is coming from time, but I would have to check.

      -xtreg, fe- produce similar results.

      Originally posted by Carlo Lazzaro View Post
      Stephen:
      1) it is possible, if -i.year- is responsible for most of the within-panel variation, other things being equal.
      2) If adding -i.year- creates that change in results, probably -i.year- is the cause (please note that -timevar- should be included by default in the right-hand side of the -fe- regression);
      3) the second code included the fixed efefct of county, too (that is probably time-invariant);
      4) the differ for the fixed effects that you want to estimate;
      5) last but not least, you're nit using -xtreg,fe- as far as I can see, but the community-contributed command (as FAQ kindly request you to mention) -reghdfe-.

      Comment


      • #4
        Stephen:
        When you have eliminated the impossible, whatever remains, however improbable, must be the truth. - philosiblog
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X