Announcement

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

  • Preference to FE or RE model with Driscoll-Kraay SE

    Hello,

    Is there a similar test that I can run to the Hausman test, with FE/RE models with Driscoll-Kraay standard errors. I am using Driscoll-Kraay standard errors to control for autocorrelation and heteroskedasticity, but the Hausman test won't run returning "sigma option not allowed." Does anyone know a way around this or a similar test that can be run to determine which model is preferred? Thank you for your time.

  • #2
    You can run a test of overidentifying restrictions by means of an artificial regression. The following replicates the results produced by Schaffer and Stillman's xtoverid command from SSC.

    Code:
    webuse grunfeld, clear
    xtreg invest mvalue kstock, re cluster(company)
    *RUN XTOVERID COMMAND
    xtoverid
    *GENERATE MEAN DEVIATED REGRESSORS
    foreach var in mvalue kstock{
    bys company: egen m`var'=mean(`var')
    gen md`var'=`var' -m`var'
    }
    *ARTIFICIAL REGRESSION
    xtreg invest mvalue kstock mdmvalue mdkstock, re cluster(company)
    *TEST OF OVERIDENTIFYING RESTRICTIONS
    test mdmvalue mdkstock

    Res.:

    Code:
    . *RUN XTOVERID COMMAND
    
    . 
    . xtoverid
    
    Test of overidentifying restrictions: fixed vs random effects
    Cross-section time-series model: xtreg re  robust cluster(company)
    Sargan-Hansen statistic   7.320  Chi-sq(2)    P-value = 0.0257
    
    . 
    . *ARTIFICIAL REGRESSION
    
    . 
    . xtreg invest mvalue kstock mdmvalue mdkstock, re cluster(company)
    
    Random-effects GLS regression                   Number of obs     =        200
    Group variable: company                         Number of groups  =         10
    
    R-sq:                                           Obs per group:
         within  = 0.7668                                         min =         20
         between = 0.8578                                         avg =       20.0
         overall = 0.8359                                         max =         20
    
                                                    Wald chi2(4)      =     125.84
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
                                   (Std. Err. adjusted for 10 clusters in company)
    ------------------------------------------------------------------------------
                 |               Robust
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .1346461    .016897     7.97   0.000     .1015286    .1677635
          kstock |   .0320318   .0836383     0.38   0.702    -.1318962    .1959598
        mdmvalue |  -.0245223   .0149885    -1.64   0.102    -.0538991    .0048546
        mdkstock |   .2780335   .1030273     2.70   0.007     .0761037    .4799633
           _cons |  -8.527168   19.42001    -0.44   0.661    -46.58968    29.53534
    -------------+----------------------------------------------------------------
         sigma_u |  90.234986
         sigma_e |  52.767964
             rho |  .74517193   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . 
    . *TEST OF OVERIDENTIFYING RESTRICTIONS
    
    . test mdmvalue mdkstock
    
     ( 1)  mdmvalue = 0
     ( 2)  mdkstock = 0
    
               chi2(  2) =    7.32
             Prob > chi2 =    0.0257

    Comment


    • #3
      Thanks for the help -

      While the second part of your solution works great, I am having trouble with the 'xtoverid' command returning the following error:

      Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS

      Comment


      • #4
        Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS
        Don't run -xtoverid- after the artificial regression. Run it after the original random effects regression. I think that -xtoverid- is not compatible with -xtscc- (Stata Journal), which gives you DK standard errors. Therefore, my suggestion was to use the artificial regression instead.

        Comment

        Working...
        X