Announcement

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

  • Test for time effects in a random effects (RE) model?

    Dear Sirs,

    To see if time fixed effects are needed when running a FE model, I use the command testparm. Do I have to test for time fixed effects when running a RE model?

    And when I run the Hausman test to test for RE versus FE, do I include time dummies in my regression (given that time fixed effects are needed)?

    Thank you.

    Kind regards,
    Amira

  • #2
    Amira:
    I assume that you refer to -i.year-. You can simply see if their inclusion makes sense giving it a try, as in the following toy-example:

    Code:
    use "http://www.stata-press.com/data/r14/nlswork.dta", clear
    xtreg ln_wage race grade i.year, fe
    xtreg ln_wage race grade i.year, re
    As far as -hausman- is concerned, beware of not reversing the order of estimates storing (that is, -fe- specification should come before -re- specification):
    Code:
    use "http://www.stata-press.com/data/r14/nlswork.dta", clear
    quietly xtreg ln_wage race grade i.year, fe
    estimates store fe
    quietly xtreg ln_wage race grade i.year, re
    estimates store re
    hausman fe re
    Evenyually, robust SEs are not supported by -hausman-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Please have a look at the adivce by Jeff Wooldridge in the following Statalist topic:
      Hausman test with year dummies, V_b-V-B is not positive definite
      https://www.kripfganz.de/stata/

      Comment


      • #4
        Hi Carlo,

        Thank you for your reply.

        I am asking this question because I have noticed that researchers test for time fixed effects while running FE models only. So, I thought that maybe it is irrelevant to do this test while running a RE model.

        One more question: if I found that I should include time dummies in my FE model only, shall I also include time dummies in the FE model when doing the Hausman test (as in Option 1 below)? Or shall I omit time dummies from both models when doing the Hausman test (Option 2)?

        *Option 1 xtreg ln_wage race grade i.year, fe estimates store fe xtreg ln_wage race grade, re estimates store re hausman fe re
        *Option 2 ​xtreg ln_wage race grade, fe estimates store fe xtreg ln_wage race grade, re estimates store re hausman fe re
        Kind regards,
        Amira

        Comment


        • #5
          Hi Sebastian,

          Thank you very much for referring me to Wooldridge's post. I read it and concluded that I shall test for time effects in both FE and RE models. However, I cannot include time dummies in the Hausman test. I can instead use Mundlak's approach to test for RE versus FE.

          I will follow Wooldridge's instructions and come back to you if I need further help.

          Kind regards,
          Amira

          Comment


          • #6
            Hi Sebastian,

            If I find that time fixed effects are needed when running the RE model, shall I include time dummies while running the Mundlak test for RE versus FE?

            Suppose I have two time-varying covariates (x2 and x3), one time-invariant covariate (x1) and a set of year dummies that I have to include, are the commands below right (for the Mundlak test)?

            bysort id: egen mean_x2 = mean(x2)
            bysort id: egen mean_x3 = mean(x3)
            xtreg y x1 x2 x3 mean_x2 mean_x3 i.t, vce(cluster id)
            estimates store mundlak
            test mean_x2 mean_x3
            Thank you.

            Kind regards,
            Amira

            Comment


            • #7
              Yes, you should include the time dummies. Your sequence of commands looks good to me.
              https://www.kripfganz.de/stata/

              Comment

              Working...
              X