Announcement

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

  • Hausman test not working

    I am running a regression inluding the following variables: lnwage, age, age squared, experience, experiencesquared
    as well as others.


    When I conduct the Hausman test for fixed effects, I get a message saying: the rank of the differenced variance matrix doesn't equal the number of coefficients tested.

    Furthermore, the test results in a negative value, and it says that the model fitted on these data failed to meet to asymptotic assumptions of the Hausman test.


    When I take out experience squared, the second problem disappears, so I suspect it is related to that. However, I need to include experience squared in my model.

    I am aware this question has been asked many times but I still haven't quite found how to fix my problem and have limited time left to do so.

    Hence I would really appreciate it if anyone knows a command or something I could do to keep experience squared in my model and conduct the Hausman test so I know whether a fixed effects model is appropriate.

    Many thanks,

    Ella
    Last edited by Ella Ki; 11 Apr 2017, 18:14.

  • #2
    Ella:
    you may want to add -sigmamore- option to -hausman- or try -suest-.
    As an aside: have you created squared terms via -fvvarlist- or by hand?
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Ella:
      you may want to add -sigmamore- option to -hausman- or try -suest-.
      As an aside: have you created squared terms via -fvvarlist- or by hand?
      Thanks a lot for your response Carlo.

      I did add sigmamore and did get the result that I had to use fixed effects.

      But, I was wondering, what are the implications of using sigmamore? If I write about in my project, would I say I used sigmamore and would I need to justify why, or would I just say that the Hausman test showed I needed to use fixed effects so I did?

      Also, after using fixed effects, some variables become almost completely insignificant. Is this just by chance they are insignificant in the fixed effects model, or does it have something to do with the Hausman test not working?

      I didn't try suest as I saw online this isn't for panel data. Is that wrong?




      I'm sorry I'm not too familiar with all the terminology as this is the first time I am doing my own regressions so I'm not sure what you mean. I created the experience squared variable by typing the commands gen experiencesquared=experience^2.

      I noticed online that squared variables could be centred to avoid multicollinearity but also found a lot of argument against this.

      So not sure which is best to do.

      Many thanks for your help, I really appreciate it!

      Ella

      Comment


      • #4
        Hello Ella,

        Sigmamore is related to the production of a positive-definite matrix.

        The Stata Manual displays this information about sigmamore and its counterpart, sigmaless:

        sigmamore and sigmaless specify that the two covariance matrices used in the test be based on a common estimate of disturbance variance (σ 2 ). sigmamore specifies that the covariance matrices be based on the estimated disturbance variance from the efficient estimator. This option provides a proper estimate of the contrast variance for so-called tests of exogeneity and overidentification in instrumental-variables regression. sigmaless specifies that the covariance matrices be based on the estimated disturbance variance from the consistent estimator. These options can be specified only when both estimators store e(sigma) or e(rmse), or with the xtreg command. e(sigma e) is stored after the xtreg command with the fe or mle option. e(rmse) is stored after the xtreg command with the re option. sigmamore or sigmaless are recommended when comparing fixed-effects and random-effects linear regression because they are much less likely to produce a non–positive-definite-differenced covariance matrix (although the tests are asymptotically equivalent whether or not one of the options is specified).
        Best regards,

        Marcos

        Comment


        • #5
          Ella:
          Marcos ponted you out to what -sigmmore- and -sigmaless- options are invoked for.
          The fact that your coefficients are not statistically significant is not necessarily related to -xtreg, fe-, (whereas the omission of time-invariant predictors is).
          Eventually, you should better use -fvvarlist- for creating interaction and categorical variables as well. That way, you can benefit of -margins- and -marginsplot- after -xtreg-.
          In your case, the codes for -age- and -experience- (assumed expressed in years) become, respectively:
          Code:
          c.age##c.age
          and
          Code:
          c.experience##c.experience
          .

          You're correct (my mistake): -suest- does not support -xtreg-.
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #6
            Originally posted by Marcos Almeida View Post
            Hello Ella,

            Sigmamore is related to the production of a positive-definite matrix.

            The Stata Manual displays this information about sigmamore and its counterpart, sigmaless:
            Thanks for the response Marco! Please excuse my lack of knowledge but to clarify, does this mean it can only be used for instrumental variables regression? I am not using this type of regression. But maybe this means I should be doing IV?

            Edit: just saw the last line, " sigmamore or sigmaless are recommended when comparing fixed-effects and random-effects linear regression because they are much less likely to produce a non–positive-definite-differenced covariance matrix" - so it can be used even for linear regression?

            Do you think I would write about this in my project or is it more of a "behind the scenes" Stata technicality?

            Comment


            • #7
              Originally posted by Carlo Lazzaro View Post
              Ella:
              Marcos ponted you out to what -sigmmore- and -sigmaless- options are invoked for.
              The fact that your coefficients are not statistically significant is not necessarily related to -xtreg, fe-, (whereas the omission of time-invariant predictors is).
              Eventually, you should better use -fvvarlist- for creating interaction and categorical variables as well. That way, you can benefit of -margins- and -marginsplot- after -xtreg-.
              In your case, the codes for -age- and -experience- (assumed expressed in years) become, respectively:
              Code:
              c.age##c.age
              and
              Code:
              c.experience##c.experience
              .

              You're correct (my mistake): -suest- does not support -xtreg-.
              Thanks for the suggestion. Do you mean age and experience squared? I will definitely try it.

              And so do you mean I should include year effects in my fixed effects model? But that is done after testing for it, right?

              Comment


              • #8
                Hello Ella,

                I gather there is no problem in always using the sigmamore option, for due reasons, well stated in the excerpt from the Stata Manual: it is "recommended" because it is "less prone" to produce a non-positive-definite matrix and, anyway, because the results won't differ much, under an asymptotic assumption.

                Hope that helps.
                Best regards,

                Marcos

                Comment


                • #9
                  Ella:
                  yes, I meant age and experience squared (as per your original post).
                  I did not mention that point, but you may want to include -i-year- among the predictors of your regression equation and test it via -parmtest-.
                  Kind regards,
                  Carlo
                  (Stata 18.0 SE)

                  Comment


                  • #10
                    Hello, Everyone!

                    I'm facing some problems with Hausman's Test. The coefficients of Random Model is the same of Fixed Model and there is a message saying:

                    "Note: the rank of the differenced variance matrix (0) does not equal the number of coefficients being tested (9); be sure this is what you expect, or there may be
                    problems computing the test. Examine the output of your estimators for anything unexpected and possibly consider scaling your variables so that the
                    coefficients are on a similar scale."

                    Find below my codes:

                    xtreg Captacaot Return_first_quartil Return_second_quartil Return_third_quartil Return_fourth_quartil Desvio_Padraot1 Taxa_Admt1 LN_PLt Alpha_Jensent1 CobraTaxadePerformance

                    xtreg Captacaot Return_first_quartil Return_second_quartil Return_third_quartil Return_fourth_quartil Desvio_Padraot1 Taxa_Admt1 LN_PLt Alpha_Jensent1 CobraTaxadePerformance, fe

                    xtreg Captacaot Return_first_quartil Return_second_quartil Return_third_quartil Return_fourth_quartil Desvio_Padraot1 Taxa_Admt1 LN_PLt Alpha_Jensent1 CobraTaxadePerformance, re

                    xttest0

                    estimates store fe

                    estimates store re

                    hausman fe re, sigmamore


                    Coefficients ----
                    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
                    | fe re Difference S.E.
                    -------------+----------------------------------------------------------------
                    Return_fir~l | -430.5618 -430.5618 0 0
                    Return_sec~l | 635.4907 635.4907 0 0
                    Return_thi~l | 304.3886 304.3886 0 0
                    Return_fou~l | 438.6034 438.6034 0 0
                    Desvio_Pad~1 | -.0883649 -.0883649 0 0
                    Taxa_Admt1 | 6283.756 6283.756 0 0
                    LN_PLt | 76577.61 76577.61 0 0
                    Alpha_Jens~1 | -35.25916 -35.25916 0 0
                    CobraTaxad~e | -11400.56 -11400.56 0 0
                    ------------------------------------------------------------------------------
                    b = consistent under Ho and Ha; obtained from xtreg
                    B = inconsistent under Ha, efficient under Ho; obtained from xtreg

                    Test: Ho: difference in coefficients not systematic

                    chi2(0) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                    = 0.00
                    Prob>chi2 = .
                    (V_b-V_B is not positive definite)

                    Thanks for your help!


                    Comment


                    • #11
                      The problem arises because of the order of your commands which should be:
                      Code:
                      xtreg Captacaot Return_first_quartil Return_second_quartil Return_third_quartil Return_fourth_quartil Desvio_Padraot1 Taxa_Admt1 LN_PLt Alpha_Jensent1 CobraTaxadePerformance, fe
                      estimates store fe
                      xtreg Captacaot Return_first_quartil Return_second_quartil Return_third_quartil Return_fourth_quartil Desvio_Padraot1 Taxa_Admt1 LN_PLt Alpha_Jensent1 CobraTaxadePerformance, re
                      estimates store re
                      hausman fe re, sigmamore
                      What you are doing now is storing the same estimates of the last estomated model (the RE model) under fe and re.

                      Comment


                      • #12
                        Thanks, Eric!

                        Comment


                        • #13
                          Thanks for your help, Eric !

                          Comment

                          Working...
                          X