Announcement

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

  • hausman test problem

    Dear all,


    I am working with panel data and when I use the command: hausman fe re, force, I get the following:

    chi2(55) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = -0.10 chi2<0 ==> model fitted on these
    data fails to meet the asymptotic
    assumptions of the Hausman test;

    Does anyone know how can I overcome this issue? I can not find a clear answer.


    Kind Regards,
    Katerina
    Stata/SE 16.0

  • #2
    Katerina:
    first of all, it would be interesting to know why you invoked the -force- option.
    Moreover, posting what you typed and what Stata gave you back (-xtreg- outcome included) can be helpful as well. Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear Carlo,

      Thank you for your answer.
      I used the -force- option as my lecturer told us that we can make the Hausman test even if the errors are to i.i.d.

      So, firstly I used radom effects:
      -xtreg lngdp tariff i.year , re-

      Random-effects GLS regression Number of obs = 1,329
      Group variable: ifscode Number of groups = 31

      R-sq: Obs per group:
      within = 0.8453 min = 17
      between = 0.0150 avg = 42.9
      overall = 0.0154 max = 55

      Wald chi2(55) = 6766.27
      corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

      ------------------------------------------------------------------------------
      lngdp | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      tariff | -.0125087 .0012426 -10.07 0.000 -.0149441 -.0100732
      |
      year |
      1961 | .026699 .0762905 0.35 0.726 -.1228276 .1762256
      1962 | .0708194 .0763158 0.93 0.353 -.0787568 .2203957
      1963 | .1144887 .0763657 1.50 0.134 -.0351854 .2641627
      1964 | .1610663 .0764168 2.11 0.035 .0112921 .3108405
      1965 | .2328587 .0763895 3.05 0.002 .083138 .3825795
      1966 | .261042 .0764885 3.41 0.001 .1111272 .4109567
      1967 | .3022939 .0764975 3.95 0.000 .1523615 .4522264
      1968 | .3536802 .0765396 4.62 0.000 .2036652 .5036951
      1969 | .405809 .0766636 5.29 0.000 .2555511 .556067
      1970 | .4459074 .0767829 5.81 0.000 .2954156 .5963992
      1971 | .4437928 .0747907 5.93 0.000 .2972058 .5903799
      1972 | .4981689 .0748659 6.65 0.000 .3514345 .6449033
      1973 | .568613 .0730017 7.79 0.000 .4255323 .7116937
      1974 | .5558807 .0734446 7.57 0.000 .411932 .6998295
      1975 | .5684537 .0732552 7.76 0.000 .4248761 .7120313
      1976 | .6287387 .0723528 8.69 0.000 .4869299 .7705475
      1977 | .6710075 .0723259 9.28 0.000 .5292514 .8127636
      1978 | .702198 .0725407 9.68 0.000 .5600209 .8443752
      1979 | .7361777 .0727328 10.12 0.000 .593624 .8787314
      1980 | .7471979 .0722716 10.34 0.000 .6055481 .8888477
      1981 | .7682243 .0716538 10.72 0.000 .6277854 .9086632
      1982 | .7628949 .0710682 10.73 0.000 .6236038 .9021861
      1983 | .7871872 .0710709 11.08 0.000 .6478907 .9264837
      1984 | .829961 .0711025 11.67 0.000 .6906027 .9693194
      1985 | .8540969 .071263 11.99 0.000 .7144241 .9937698
      1986 | .8968359 .0711146 12.61 0.000 .7574539 1.036218
      1987 | .946881 .0710071 13.34 0.000 .8077096 1.086052
      1988 | .9905651 .0691019 14.33 0.000 .8551279 1.126002
      1989 | 1.033133 .0691596 14.94 0.000 .8975823 1.168683
      1990 | 1.079995 .068651 15.73 0.000 .9454414 1.214548
      1991 | 1.08948 .0687198 15.85 0.000 .9547917 1.224168
      1992 | 1.093563 .068849 15.88 0.000 .9586214 1.228505
      1993 | 1.103799 .0686188 16.09 0.000 .9693085 1.238289
      1994 | 1.145987 .0689356 16.62 0.000 1.010876 1.281099
      1995 | 1.19948 .0681752 17.59 0.000 1.06586 1.333101
      1996 | 1.219149 .0689609 17.68 0.000 1.083988 1.354309
      1997 | 1.254211 .0688081 18.23 0.000 1.11935 1.389073
      1998 | 1.280777 .0692634 18.49 0.000 1.145023 1.41653
      1999 | 1.316333 .0690413 19.07 0.000 1.181014 1.451651
      2000 | 1.356574 .069327 19.57 0.000 1.220696 1.492452
      2001 | 1.381626 .0691108 19.99 0.000 1.246172 1.517081
      2002 | 1.399682 .0693257 20.19 0.000 1.263806 1.535558
      2003 | 1.422018 .0693543 20.50 0.000 1.286087 1.55795
      2004 | 1.460387 .0693923 21.05 0.000 1.324381 1.596393
      2005 | 1.494466 .0694784 21.51 0.000 1.358291 1.630641
      2006 | 1.534812 .0695049 22.08 0.000 1.398585 1.671039
      2007 | 1.575561 .0695249 22.66 0.000 1.439294 1.711827
      2008 | 1.580597 .069568 22.72 0.000 1.444246 1.716948
      2009 | 1.540062 .0695636 22.14 0.000 1.40372 1.676405
      2010 | 1.554083 .0700146 22.20 0.000 1.416857 1.691309
      2011 | 1.585788 .0696227 22.78 0.000 1.44933 1.722246
      2012 | 1.581363 .0700512 22.57 0.000 1.444065 1.718661
      2013 | 1.597558 .0696625 22.93 0.000 1.461022 1.734094
      2014 | 1.673935 .0770426 21.73 0.000 1.522934 1.824935
      |
      _cons | 5.119632 .4407029 11.62 0.000 4.255871 5.983394
      -------------+----------------------------------------------------------------
      sigma_u | 2.4264259
      sigma_e | .20837702
      rho | .99267893 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      And then I used fixed effects:
      -xtreg lngdp tariff i.year , fe-


      Fixed-effects (within) regression Number of obs = 1,329
      Group variable: ifscode Number of groups = 31

      R-sq: Obs per group:
      within = 0.8453 min = 17
      between = 0.0150 avg = 42.9
      overall = 0.0154 max = 55

      F(55,1243) = 123.54
      corr(u_i, Xb) = -0.0809 Prob > F = 0.0000

      ------------------------------------------------------------------------------
      lngdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      tariff | -.0125316 .0012402 -10.10 0.000 -.0149646 -.0100985
      |
      year |
      1961 | .0266486 .0761374 0.35 0.726 -.1227235 .1760207
      1962 | .0707574 .0761627 0.93 0.353 -.0786643 .220179
      1963 | .1144084 .0762125 1.50 0.134 -.035111 .2639278
      1964 | .1609709 .0762635 2.11 0.035 .0113514 .3105904
      1965 | .2327711 .0762363 3.05 0.002 .083205 .3823371
      1966 | .2609287 .0763351 3.42 0.001 .1111688 .4106885
      1967 | .3021786 .0763441 3.96 0.000 .1524011 .4519562
      1968 | .3535557 .0763861 4.63 0.000 .2036957 .5034157
      1969 | .4056609 .0765099 5.30 0.000 .2555581 .5557637
      1970 | .4457395 .076629 5.82 0.000 .2954031 .596076
      1971 | .4436117 .0746407 5.94 0.000 .2971759 .5900474
      1972 | .4979783 .0747158 6.66 0.000 .3513953 .6445613
      1973 | .5684489 .0728554 7.80 0.000 .4255158 .711382
      1974 | .5556669 .0732974 7.58 0.000 .4118666 .6994672
      1975 | .5682598 .0731084 7.77 0.000 .4248304 .7116893
      1976 | .6285612 .0722077 8.70 0.000 .4868986 .7702237
      1977 | .6708332 .0721809 9.29 0.000 .5292233 .812443
      1978 | .7019997 .0723953 9.70 0.000 .5599691 .8440302
      1979 | .7359597 .0725871 10.14 0.000 .593553 .8783664
      1980 | .7470129 .0721268 10.36 0.000 .6055091 .8885167
      1981 | .7680319 .0715103 10.74 0.000 .6277377 .9083261
      1982 | .7626764 .0709259 10.75 0.000 .6235288 .9018241
      1983 | .7869685 .0709286 11.10 0.000 .6478155 .9261215
      1984 | .8297395 .0709601 11.69 0.000 .6905247 .9689544
      1985 | .8538618 .0711202 12.01 0.000 .7143328 .9933908
      1986 | .8966133 .0709721 12.63 0.000 .7573749 1.035852
      1987 | .9466679 .0708649 13.36 0.000 .8076399 1.085696
      1988 | .9903284 .0689636 14.36 0.000 .8550305 1.125626
      1989 | 1.032892 .0690212 14.96 0.000 .8974808 1.168303
      1990 | 1.079751 .0685136 15.76 0.000 .9453357 1.214166
      1991 | 1.089231 .0685823 15.88 0.000 .9546812 1.223781
      1992 | 1.093305 .0687113 15.91 0.000 .9585021 1.228108
      1993 | 1.103565 .0684816 16.11 0.000 .9692127 1.237917
      1994 | 1.145724 .0687977 16.65 0.000 1.010751 1.280696
      1995 | 1.199278 .0680387 17.63 0.000 1.065794 1.332761
      1996 | 1.218883 .0688229 17.71 0.000 1.083861 1.353905
      1997 | 1.253964 .0686705 18.26 0.000 1.119242 1.388687
      1998 | 1.280491 .0691249 18.52 0.000 1.144877 1.416105
      1999 | 1.316071 .0689032 19.10 0.000 1.180892 1.45125
      2000 | 1.356295 .0691883 19.60 0.000 1.220556 1.492034
      2001 | 1.38136 .0689726 20.03 0.000 1.246045 1.516676
      2002 | 1.399403 .0691871 20.23 0.000 1.263667 1.53514
      2003 | 1.421738 .0692156 20.54 0.000 1.285945 1.55753
      2004 | 1.460104 .0692535 21.08 0.000 1.324237 1.595971
      2005 | 1.494178 .0693395 21.55 0.000 1.358142 1.630213
      2006 | 1.534522 .0693659 22.12 0.000 1.398435 1.670609
      2007 | 1.57527 .0693859 22.70 0.000 1.439143 1.711396
      2008 | 1.580303 .0694289 22.76 0.000 1.444092 1.716514
      2009 | 1.539769 .0694245 22.18 0.000 1.403567 1.675971
      2010 | 1.553785 .0698747 22.24 0.000 1.4167 1.69087
      2011 | 1.585492 .0694835 22.82 0.000 1.449174 1.721809
      2012 | 1.58103 .0699112 22.61 0.000 1.443873 1.718186
      2013 | 1.597259 .0695233 22.97 0.000 1.460863 1.733655
      2014 | 1.673369 .0768886 21.76 0.000 1.522523 1.824215
      |
      _cons | 5.259788 .0591322 88.95 0.000 5.143778 5.375798
      -------------+----------------------------------------------------------------
      sigma_u | 2.6257195
      sigma_e | .20837702
      rho | .99374141 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      And finally, when I did the Hausman test I got the result posted above.
      I am very very sorry that my results are not well presented but I am trying to figure out how dataex is used. I hope it will be fine.

      Kind Regards,
      Katerina





      Comment


      • #4
        Katerina:
        if you have a long N, short T panel dataset and epsilon error term is heteroskedastic, you should invoke clustered robust standard error and replace -hausman- with the community-contributed command -xtoverid- (that you can access and install via -search xtoverid-) to check which specification is right for your data.
        Please note that -xtoverid-, being a bit old-fashioned, does not support -fvvarlist- notation (see -help di as a fix).
        Eventually, -xtoverid- needs to test -re- specification only:
        Code:
        xtreg depvar indepvars controls,  re
        xtoverid
        Closing out aside: when you run -hausman- be sure that -re- follows -fe-:
        Code:
        hausman fe re
        and not the other way round.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Thank you so much, Carlo. I will try it.
          Also, I found out another way by using:
          xtreg depvar indepvars controls, re cluster(ID)
          xtreg depvar indepvars controls, fe cluster(ID)

          and then for the test:
          hausman fe_robust re_robust, force

          Comment


          • #6
            Katerina:
            yes, that's the correct use of -force- option in -hausman-.
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment


            • #7
              Katerina: I have several comments.

              1. You cannot obtain a robust Hausman test by forcing Stata to use the usual formula with the cluster-robust standard errors. It doesn't work that way.
              2. A general problem with the usual form of the Hausman test is that it includes all of the time dummies in the statistic. I discuss in my books about how, in the balanced case, these cannot be included. This causes the problem with the Hausman test variance estimator, and usually leads Stata to report the wrong degrees of freedom. In the unbalanced case, as you have, the issues are more subtle.
              3. Carlo is correct on using xtoverid to obtain a robust form of the Hausman test, but there are other options.
              4. The other option is the correlated random effects approach. It is pretty easy to implement, but you have to take care when you generate the time averages if the panel is unbalanced. The first thing is to create an indicator for the complete cases. I assume the only two variables that are possibly missing are lngdp and tariff.

              Code:
              xtset ID year
              gen s = (lngdp != .) & (tariff != .)
              egen tariffbar = mean(tariff) if s, by(ID)
              egen y1961bar = mean(y1961) if s, by(ID)
              ...
              egen y2014bar = mean(y2014) if s, by(ID)
              xtreg lngdp tarriff tariffbar i.year y1961bar ... y2014bar, cluster(ID)
              The F-type test on all of the "bar" variables is the test that RE is appropriate. If you reject, then you are saying fixed effects is needed. The estimates you get on tariff and the year dummies will be the FE estimates if you have computed the time averages correctly.

              5. In your setting, where T is about as large as N, fixed effects is almost always preferred to random effects. I would use FE unless you have a good reason not to. With large geographic units, it's very difficult to imagine that the tariff variable is not correlated with country effects. Sometimes, one should go with what seems clear rather than actually testing RE versus FE.

              Comment


              • #8
                Thank you so much for your comments. I think I will have to go with number 5.

                Comment


                • #9
                  Carlo Lazzaro Dear Carlo,

                  I tried to do what you suggested as I want to try that also. I have downloaded -xtoverid- by using: ssc install xtoverid.
                  However, I get this when I try to do it:
                  Error - must have ivreg2/ivreg29/ivreg28 version 2.1.15 or greater installed

                  I can't find a way to solve this.
                  Is there a way you can help?
                  Thank you in advance.


                  Kind Regards,
                  Katerina
                  (Stata 16.0 SE)

                  Comment


                  • #10
                    Katerina:
                    just install the community-contributed -ivreg- relese suggested by the message that Stata gave you back and then install -xtoverid-.
                    You will find yourself that it is easier done than said.
                    Kind regards,
                    Carlo
                    (StataNow 18.5)

                    Comment

                    Working...
                    X