Announcement

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

  • Choosing between fixed effects vs. random effects in the presence of heteroskedasticity

    Hi all,

    I am working with a panel data set of about 180 countries spread over 27 years.

    My data suffers from both serial correlation and heteroskedasticity, which I correct for using the user written program -xtscc-.
    I would use this program to provide estimates for my Hausman test, but the program only works with fixed effects, not random effects.

    My problem is that, as far as I am aware, the Hausman test is only valid under homoskedasticity, and thus invalid in my case.
    However, when I try correcting for this by adding -, robust- at the end of my -xtreg- regression, Stata is unable to compute the Hausman test.
    The exact error comes out as "hausman cannot be used with vce(robust), vce(cluster cvar), or p-weighted data".

    Do anyone have a solution for this?

    As I have GDP as an explanatory variable, I am aware that the fixed effects model is probably the best choice from a theoretical standpoint.
    This is just to cover all my bases for my bachelor's thesis.

    Also, a side question: Does anyone know of another (better) way to correct for serial correlation and heteroskedasticity at the same time, than the -xtscc- program?

    Any comments will be greatly appreciated,

    Mathias

  • #2
    Matthias:
    welcome to this forrum.
    If yoiur data suffer from both autocorrelation and serial correaltion, you can simply invoke cluster (or robust) standard errors.
    As you noticed, -hausman- does not allow non-default standard errors.
    The trick is to switch to the community-contributed -xtoverid- (just type -search xtoverid- from within Stata to spot and install it).
    The following toy-example may be useful:
    Code:
    . use "http://www.stata-press.com/data/r15/nlswork.dta"
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    *being a bit old-fashioned, -xtoverid- does not support -fvvarlist- notation.///The trick is to prefix your -xtreg- code with -xi:-*
    
    . xi: xtreg ln_wage i.race age i.south, re robust
    i.race            _Irace_1-3          (naturally coded; _Irace_1 omitted)
    i.south           _Isouth_0-1         (naturally coded; _Isouth_0 omitted)
    
    Random-effects GLS regression                   Number of obs     =     28,502
    Group variable: idcode                          Number of groups  =      4,710
    
    R-sq:                                           Obs per group:
         within  = 0.1040                                         min =          1
         between = 0.1363                                         avg =        6.1
         overall = 0.1224                                         max =         15
    
                                                    Wald chi2(4)      =    1285.10
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
                                 (Std. Err. adjusted for 4,710 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
        _Irace_2 |  -.0884286   .0125046    -7.07   0.000    -.1129372   -.0639199
        _Irace_3 |   .0699498   .0620017     1.13   0.259    -.0515714    .1914709
             age |   .0186806   .0005655    33.03   0.000     .0175722    .0197891
       _Isouth_1 |  -.1203053    .011358   -10.59   0.000    -.1425666   -.0980441
           _cons |   1.189348    .016563    71.81   0.000     1.156885    1.221811
    -------------+----------------------------------------------------------------
         sigma_u |  .35736892
         sigma_e |  .30322383
             rho |  .58141743   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . xtoverid
    
    Test of overidentifying restrictions: fixed vs random effects
    Cross-section time-series model: xtreg re  robust cluster(idcode)
    Sargan-Hansen statistic  37.823  Chi-sq(2)    P-value = 0.0000
    
    *-xtoverid- outcome points to fixed effect specification*
    Kind regards,
    Carlo
    (StataNow 19.0)

    Comment


    • #3
      Carlo, thank you very much for your quick answer! That was very helpful.

      I have another, more technical question:
      Do you know, what the exact specification of the robust standard errors are, i.e. what is the mathematical specification of the robust standard errors computed by Stata?

      Does clustering just mean, that Stata identifies each panel and then applies HAC-errors to these, or is it more complicated than that?

      Kind regards,
      Mathias

      Comment


      • #4
        Mathias:
        just type -help robust- from within Stata and you can easily access what you're interested in.
        Kind regards,
        Carlo
        (StataNow 19.0)

        Comment


        • #5
          Alright thanks, again very helpful!

          Last question: The residuals of my regressions are non-normal distributed, but would it be reasonable to assume an asymptotic approximation to a normal distribution when I have an N of 3000+?
          In other words, is it reasonable to apply standard inference?

          Comment


          • #6
            Yes, it's reasonable with such a large sample.
            Kind regards,
            Carlo
            (StataNow 19.0)

            Comment

            Working...
            X