Announcement

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

  • Country and time fixed effects

    Hello everyone!

    I am pretty much new to Stata and wanted ask pretty simple questions that confuse me. I am working with panel data consisting of 9 countries over the period of 2000-2017. I want to do regressions including time fixed effects, country fixed effects and both country and time fixed effects. My panel setting is "xtset country_id year". I have read here that command for country fixed effects is just "xtreg y x, fe".

    Is command "xtreg y x i.year, fe" controls for both country and time fixed effects? And what is the command for just time fixed effects?

    Thank you for your help, Sergey Medvedev

  • #2
    The -xt- commands, when specified with the -fe- option, will automatically include panel fixed effects. Time fixed effects are not included in this way. So -xtreg y x, fe- will have country fixed effects only.

    To have both country and time fixed effects you must explicitly include the time variable in your command: -xtreg y x i.year, fe-.

    If you want time fixed effects only, then do not use -xtreg-. Instead use -regress y x i.year- for that.

    Comment


    • #3
      Thank you very much for your answer, Clyde!

      Comment


      • #4
        Hey, I had the same doubt. But my model also has dummies in it. So while I got the result for the time fixed-effect model but when I run FE model, all the dummies get omitted because of collinearity. What am I doing wrong?

        Comment


        • #5
          Most probably you re doing nothing wrong, simply your dummies are not time varying, and then when you include the fixed effect everything that is no time varying is swept out.

          Originally posted by Shelly Gupta View Post
          Hey, I had the same doubt. But my model also has dummies in it. So while I got the result for the time fixed-effect model but when I run FE model, all the dummies get omitted because of collinearity. What am I doing wrong?

          Comment


          • #6
            Thankyou Kolev!

            Comment


            • #7
              Sergey:
              as an aside to Clyde's helpful advice, if you want to investigate/retrieve more than one fixed effect in your -xtreg,fe- regression, you may want to take a look at the community-contributed module -reghdfe-.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Dear Joro Kolev ,
                I am having a doubt regarding the usage of year dummies as the discussion above.is it always required to use year dummies while using fixed effects model (xtreg fe models)

                Comment

                Working...
                X