Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Problems with BP and Hausman tests when s.e. are cluster corrected


From   Giovanni Bruno <giovanni.bruno@uni-bocconi.it>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Problems with BP and Hausman tests when s.e. are cluster corrected
Date   Thu, 29 Jun 2006 09:22:03 +0200

Andrea

all your random effect estimates (Wooldridge's auxiliary regression 
included) are actually OLS estimates. This happens because in the first
stage of the GLS computation the estimate of var_u computed from within and 
between residuals is negative and Stata replaces it with zero. This is
well documented in the [xt] Stata manual and may due to bad specification
or small sample problems. One solution may be to estimate the re model using
the -mle- option for -xtreg-.

The BP test is still informative because it uses OLS residuals
(it's a lagrange multiplier test and as such is carried out
under the null).

Giovanni 

Scrive andrea fracasso <andrea.fracasso@gmail.com>:

> Hi.
> I am puzzled by the results I get from running Breusch Pagan and
> Hausman tests on my (unbalanced) panel data sample.
> The results of the tests are quite sensitive to the correction applied
> to the standard errors, and somehow weird (at least, to me).
> The regressors I use are a rate of growth (difa142), and two
> interaction terms, that is in2t=var*difa142 and in2t2=(var^2)*difa142
> 
> 
> I write some comments and questions between the results. I believe
> that these results exhibit a good deal of the problems discussed
> separately by listservers. However, being them all together, I am not
> sure how to interpret the results and how to procede.
> 
> I estimate xtreg difa298 difa142 in2t in2t2, re cluster(co)
> 
> Random-effects GLS regression                   Number of obs      =      
> 772
> Group variable (i): co                          Number of groups   =       
> 73
> 
> R-sq:  within  = 0.3139                         Obs per group: min =        
> 7
>        between = 0.6914                                        avg =     
> 10.6
>        overall = 0.3632                                        max =       
> 11
> 
> Random effects u_i ~ Gaussian                   Wald chi2(3)       =    
> 97.53
> corr(u_i, X)       = 0 (assumed)                Prob > chi2        =   
> 0.0000
> 
>                                     (Std. Err. adjusted for 73 clusters in
> co)
> ------------------------------------------------------------------------------
>              |               Robust
>      difa298 |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>      difa142 |   1.010826   .1579594     6.40   0.000     .7012313   
> 1.320421
>         in2t |  -4.775301   2.948644    -1.62   0.105     -10.55454   
> 1.003935
>        in2t2 |   24.42007   14.02081     1.74   0.082    -3.060215   
> 51.90035
>        _cons |  -.0658962   .1802725    -0.37   0.715    -.4192238   
> .2874315
> -------------+----------------------------------------------------------------
>      sigma_u |          0
>      sigma_e |  6.3054774
>          rho |          0   (fraction of variance due to u_i)
> ------------------------------------------------------------------------------
> 
> I run BP xttest0
> 
> Breusch and Pagan Lagrangian multiplier test for random effects:
> 
>         difa298[co,t] = Xb + u[co] + e[co,t]
> 
>         Estimated results:
>                          |       Var     sd = sqrt(Var)
>                 ---------+-----------------------------
>                  difa298 |   60.12951       7.754322
>                        e |   39.75904       6.305477
>                        u |          0              0
> 
>         Test:   Var(u) = 0
>                               chi2(1) =     5.04
>                           Prob > chi2 =     0.0248
> The BP test suggests the existence of an individual effect even if
> sigma_u is 0. Why?
> I believe that a RE with rho=0 is an OLS!
> (Btw, I checked for serial correlation with -xtserial- and serial
> autocorrelation is rejected)
> 
> The Hausman test (i.e. hausman fixed random) does not produce proper
> results because the difference of the variances is not positive
> definite.
> 
>  Test:  Ho:  difference in coefficients not systematic
> 
>                   chi2(3) = (b-B)'[(V_b-V_B)^(-1)](b-B)
>                           =    -0.02    chi2<0 ==> model fitted on these
>                                         data fails to meet the asymptotic
>                                         assumptions of the Hausman test;
>                                         see suest for a generalized test
> 
> I follow Wooldridge's suggestion and calculate the Hausman test by hand.
> I add to the regressors the averages over time of the time-varying
> regressors and test their significance in a random effects model.
> In the following case, I use the standard errors corrected by means of
> the -cluster- option.
> 
> xtreg difa298 difa142 in2t in2t2 adifa142 ain2t ain2t2, re cluster(co)
> 
> Random-effects GLS regression                   Number of obs      =      
> 772
> Group variable (i): co                          Number of groups   =       
> 73
> 
> R-sq:  within  = 0.3140                         Obs per group: min =        
> 7
>        between = 0.7037                                        avg =     
> 10.6
>        overall = 0.3649                                        max =       
> 11
> 
> Random effects u_i ~ Gaussian                   Wald chi2(6)       =   
> 468.98
> corr(u_i, X)       = 0 (assumed)                Prob > chi2        =   
> 0.0000
> 
>                                     (Std. Err. adjusted for 73 clusters in
> co)
> ------------------------------------------------------------------------------
>              |               Robust
>      difa298 |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>      difa142 |   .9954723   .1916506     5.19   0.000     .6198441     
> 1.3711
>         in2t |  -4.693986   3.283152    -1.43   0.153     -11.12884   
> 1.740873
>        in2t2 |   23.39439   14.53121     1.61   0.107    -5.086252   
> 51.87504
>     adifa142 |   .0635942   .2096473     0.30   0.762    -.3473069   
> .4744954
>        ain2t |  -2.534238   5.876584    -0.43   0.666    -14.05213   
> 8.983655
>       ain2t2 |   29.47941   31.16784     0.95   0.344    -31.60843   
> 90.56725
>        _cons |  -.0055123    .181651    -0.03   0.976    -.3615417   
> .3505171
> -------------+----------------------------------------------------------------
>      sigma_u |          0
>      sigma_e |  6.3054774
>          rho |          0   (fraction of variance due to u_i)
> ------------------------------------------------------------------------------
> 
> Individually, the averages adifa142, ain2t, ain2t2 are massively
> insignificant.
> However, the wald test below reject the hypothesis of them being jointly 0.
> 
> testparm adifa142 ain2t ain2t2
> 
>  ( 1)  adifa142 = 0
>  ( 2)  ain2t = 0
>  ( 3)  ain2t2 = 0
> 
>            chi2(  3) =    7.52
>          Prob > chi2 =    0.0570
> 
> This would be in favour of a fixed effect model (at almost 5% sig.lev.).
> 
> If I run the same r.e. model correcting with robust instead of cluster, I
> get
> 
> xtreg difa298 difa142 in2t in2t2 adifa142 ain2t ain2t2, re robust
> 
> Random-effects GLS regression                   Number of obs      =      
> 772
> Group variable (i): co                          Number of groups   =       
> 73
> 
> R-sq:  within  = 0.3140                         Obs per group: min =        
> 7
>        between = 0.7037                                        avg =     
> 10.6
>        overall = 0.3649                                        max =       
> 11
> 
> Random effects u_i ~ Gaussian                   Wald chi2(6)       =   
> 214.91
> corr(u_i, X)       = 0 (assumed)                Prob > chi2        =   
> 0.0000
> 
> ------------------------------------------------------------------------------
>              |               Robust
>      difa298 |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>      difa142 |   .9954723   .1559118     6.38   0.000     .6898907   
> 1.301054
>         in2t |  -4.693986   3.173922    -1.48   0.139    -10.91476   
> 1.526787
>        in2t2 |   23.39439   13.06566     1.79   0.073     -2.213824   
> 49.00261
>     adifa142 |   .0635942   .2219267     0.29   0.774     -.371374   
> .4985625
>        ain2t |  -2.534238   7.728836    -0.33   0.743    -17.68248     
> 12.614
>       ain2t2 |   29.47941   62.91061     0.47   0.639    -93.82311   
> 152.7819
>        _cons |  -.0055123   .2277465    -0.02   0.981    -.4518874   
> .4408627
> -------------+----------------------------------------------------------------
>      sigma_u |          0
>      sigma_e |  6.3054774
>          rho |          0   (fraction of variance due to u_i)
> ------------------------------------------------------------------------------
> 
> Each of the three averages is individually insignificant and, this
> time, they are also jointly insignificant.
> ( 1)  adifa142 = 0
>  ( 2)  ain2t = 0
>  ( 3)  ain2t2 = 0
> 
>            chi2(  3) =    0.39
>          Prob > chi2 =    0.9418
> 
> The result of this test are at odds with those reported above with the
> correction -cluster-.
> 
> I reckon that in2t and in2t2 (and therefore their averages too) are
> very closely correlated. However I do not see why this should affect
> only the results of the wald tests after the -cluster- corrected
> standard errors regressions.
> Has it anything ro do with the fact that these variables are time
> invariant and the cluster option sucks up all the degrees of freedom
> at the group level?
> 
> As I will show below, the within estimation would suggest a very low
> correlation between u_i and xb. Such findings seem to support a RE
> model. In addition, the RE and FE models produce very similar
> coefficients, as it can be seen below.
> 
> xtreg difa298 difa142 in2t in2t2 adifa142 ain2t ain2t2, fe cluster(co)
> 
> Fixed-effects (within) regression               Number of obs      =      
> 728
> Group variable (i): co                          Number of groups   =       
> 69
> 
> R-sq:  within  = 0.3705                         Obs per group: min =        
> 7
>        between = 0.7088                                        avg =     
> 10.6
>        overall = 0.4242                                        max =       
> 11
> 
>                                                 F(3,68)            =    
> 32.44
> corr(u_i, Xb)  = 0.0700                         Prob > F           =   
> 0.0000
> 
>                                     (Std. Err. adjusted for 69 clusters in
> co)
> ------------------------------------------------------------------------------
>              |               Robust
>      difa300 |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>      difa142 |   .9328421   .1833901     5.09   0.000     .5668929   
> 1.298791
>         in2t |  -4.626382   3.230345    -1.43   0.157     -11.07244   
> 1.819671
>        in2t2 |   23.52781   14.22296     1.65   0.103    -4.853671   
> 51.90928
>        _cons |  -.1133588   .0220161    -5.15   0.000    -.1572912  
> -.0694264
> -------------+----------------------------------------------------------------
>      sigma_u |  1.5468984
>      sigma_e |  5.3383765
>          rho |  .07746212   (fraction of variance due to u_i)
> ------------------------------------------------------------------------------
> 
> 
> In this model the estimated sigma_u is 1.54, not 0 as with the RE.
> Should I use the FE measure of sigma_u and build the RE model by
> quasi-demeaning the series by hand (and hence run the Hausman test by
> adding the averages overt time as I have done before) ?
> 
> I would be extremely grateful if anyone could help me out interpreting
> these results.
> I am stuck since I can't choose which results to consider.
> 
> This is even worse when the BP test  fails to reject the hypothesis of
> no-individual effect, yet the hausman test is strongly in favour of a
> within model.
> 
> many many thanks,
> andrea
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 


-- 
Giovanni S.F. Bruno
http://ideas.repec.org/e/pbr136.html
Istituto di Economia Politica, UniversitÓ Bocconi
Via U. Gobbi, 5, 20136 Milano
Italy
tel. + 02 5836 5411
fax. + 02 5836 5438
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index