Announcement

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

  • Hausman test significant so xtreg fe but time-invariant variable

    Hausman test is significant so I must use xtreg fe but I have a time-invariant variable (gender) that I want to test (comparing the constant terms).
    What should I do? Hausman-Taylor regression is a bit more complicated and maybe useful but it contains lots of risk based on the Internet.

  • #2
    Could you please be more precise about the "risk" to give us an understanding of your problem, also providing links or references.

    What do you mean by "comparing the constant terms"?
    https://www.kripfganz.de/stata/

    Comment


    • #3
      At the moment, I cannot find those sources again.
      R-Rf = beta X + alpha (constant term in an regression)

      Update: I use the Hausman test with i.year and interaction terms (but no interaction term with i.year).
      The testresult is significant so I should use xtreg fe even though my only 'normal' variable gender is time-invariant ('normal' variable =not an interaction variable/term, no control variable and not the i.year)

      I expected that the time-invariant variable gender would be dropped because xtreg fe normally drops time-invariant variables.
      However, gender isn't dropped when I use
      Code:
      xtreg stockreturn gender controlvariable gender_controlvariable i.year, fe.
      It's even highly significant!

      So could someone tell me what is going on here?

      Last edited by DavidHarmsen; 14 Aug 2014, 17:16. Reason: I forgot to add the dependent variable, luckily Richard notified me.

      Comment


      • #4
        Why is gender the dependent variable? What is the other gender variable? Is it time invariant?
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 18.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Just in case you didn't notice my edit, I corrected the above code od my regression

          Comment


          • #6
            Thanks for the correction. But you still have two gender variables in there. What is the difference between them, and are they both time invariant? It would probably help to actually list the exact command and output that you got. If gender really is significant, I am guessing that it is not really time invariant for some reason.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 18.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              stockreturn = beta x marketriskpremium + alpha

              Therefore I use
              xtreg stockreturn gender controlvariable gender_marketriskpremium i.year, fe robust So maybe I shouldn't call marketriskpremium a control variable.
              Gender really is significant and not omitted like what normally happens to time-invariant variables when people use fe

              I would really like to have a significant result but not when the model is bad.

              Comment


              • #8
                Again it would be far easier to advise you if we saw the actual code and output. Especially since you keep on changing the variable names and haven't explained what gender_marketriskpremium is (and was not in your previous messages).
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                StataNow Version: 18.5 MP (2 processor)

                EMAIL: [email protected]
                WWW: https://www3.nd.edu/~rwilliam

                Comment


                • #9
                  gender_marketriskpremium is just an interaction term. Interaction terms should always be included in a regression if I remember correctly how to use interaction terms.

                  output: http://i.imgur.com/iLxUszR.png

                  Comment


                  • #10
                    Have you verified that gender is, in fact, time-invariant?
                    You haven't described your data so I'm guessing on the exact code that would be used to confirm that. Something like this might shed some light on the issue, though.

                    Code:
                    bysort panel_id: assert gender[1]==gender[_N]

                    Comment


                    • #11
                      Originally posted by Sarah Edgington View Post
                      Have you verified that gender is, in fact, time-invariant?
                      You haven't described your data so I'm guessing on the exact code that would be used to confirm that. Something like this might shed some light on the issue, though.

                      Code:
                      bysort panel_id: assert gender[1]==gender[_N]
                      Very useful code Sarah!

                      4 contradictions in 699 observations

                      So now I have to find a way to find those contracdictions and then correct them.

                      After the correction the variable gender probably will be omitted if I then use xtreg fe again

                      Comment


                      • #12
                        See this thread that conveniently has a very similar problem:

                        http://www.statalist.org/forums/foru...-in-panel-data

                        The code can be something like

                        Code:
                        bysort panel_id (gender): gen check = gender[1] != gender[_N] | gender[_N] >= .
                        list if check, sepby(panel_id)
                        This will ID cases where gender is not consistent across years and/or has missing data.
                        Last edited by Richard Williams; 14 Aug 2014, 20:10. Reason: Code was appearing as one line rather than two.
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        StataNow Version: 18.5 MP (2 processor)

                        EMAIL: [email protected]
                        WWW: https://www3.nd.edu/~rwilliam

                        Comment


                        • #13
                          Lucky coincidence but your code didn't work for me because of this error: invalid 'list' r(198);

                          I'll try the code of Roberto now

                          Comment


                          • #14
                            It looks like my two lines of code got combined on one line. At least it looks that way on my iPad. Just start list on a new line.
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            StataNow Version: 18.5 MP (2 processor)

                            EMAIL: [email protected]
                            WWW: https://www3.nd.edu/~rwilliam

                            Comment


                            • #15
                              Now your code and Roberto's code worked but I'm not sure because I haven't indicated the problem yet. I only know that they didn't change their gender over the years, except that 1 person is called Julia (woman) and the other John (man) and they have the same idcode. So somehow the problem is cause but I don't see the exact cause yet, so I don't know yet how to correct it.

                              Comment

                              Working...
                              X