Announcement

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

  • Heteroskedasticity & Autocorrelation in a random panel data

    Dear communty,

    i have a data set with N=74 and T=47, so I have a panel data set and this is also strong balanced.

    In order to find an appropriate model, first, i conduct the Hausman Test and that indicate the use of random effects model

    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
    | fixed random Difference S.E.
    -------------+----------------------------------------------------------------
    Inside_Event | -.2731725 -.2725065 -.0006661 .
    Q2 | -.6792971 -.6819931 .002696 .
    Q3 | -.3889817 -.3869155 -.0020662 .
    Q4 | .2907415 .2873648 .0033767 .
    Adv1 | .0000203 .0000236 -3.25e-06 1.18e-06
    Adv_Sponsor1 | -6.07e-06 -8.17e-06 2.10e-06 .
    Adv_Inside1 | .0000384 .0000393 -8.87e-07 .
    Adv_Insid~r1 | -9.35e-08 -4.92e-07 3.98e-07 .
    Competitor~1 | .0000365 .0000379 -1.37e-06 3.83e-07
    Google_Tre~s | .0158409 .0156065 .0002344 .0002866
    ------------------------------------------------------------------------------
    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(9) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = 3.61
    Prob>chi2 = 0.9354
    (V_b-V_B is not positive definite)

    Afterwards I us the Breusch Pagan test and that showed that the random effect model is appropriate

    Breusch and Pagan Lagrangian multiplier test for random effects

    Ind_Stand[Brand_ID,t] = Xb + u[Brand_ID] + e[Brand_ID,t]

    Estimated results:
    | Var sd = sqrt(Var)
    ---------+-----------------------------
    Ind_Stand | 250.7955 15.83652
    e | 5.665431 2.380217
    u | 231.1569 15.20384

    Test: Var(u) = 0
    chibar2(01) = 69065.76
    Prob > chibar2 = 0.0000

    Next, i examine the assumptions of autocorrelation, using xtserial command and then hetereskedacsticity with the help of xttest3, but also afterwards test the assumption following the suggestion on the link (http://www.stata.com/support/faqs/st...tocorrelation/).

    According to the results both assumption were violated. So I have a panel data with serial autocorrelation and heteroskedasticity and now I have no idea what model would be the most appropriate in this case and what command I can use in Stata.

    In the next step I'm going also to integrate a lagged (one lag) DV in my model as control variable. I have also the question, how I can find out, what dynamic panel data model is the best?

    Thanks in advance and I hope, dear forum members, that u can help me.

    A.

  • #2
    funtik (as per FAQ, please note the strong preference for real full names on this forum. Just click on the Contact us button at the bottom of the screen and re-register. Thank you)
    As far as
    So I have a panel data with serial autocorrelation and heteroskedasticity
    is concerned, you should impose:
    Code:
    xtreg depvar indepvar1 ...indepvarn, re vce(cluster panelid)
    You may also want to take a look at Hoechle, D. 2007. Robust standard errors for panel regressions with cross-sectional dependence. Stata Journal 7: 281–312 (http://www.stata-journal.com/sjpdf.h...iclenum=st0128).
    .
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      dear community,
      i have done a standard hausman test on my dependant variable and the results was:
      chi2(11) = (b-B)'[(V_b-V_B)^(-1)](b-B)
      = 11.23
      Prob>chi2 = 0.4246
      (V_b-V_B is not positive definite)
      so i used the robust version and the results are:
      . xtoverid
      Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS
      r(198);

      what should i do now? do I assume that I should use the fe model?
      is there a test which allows us to choose between fe and pooled ols?


      also, the standard hausman test should first be done before checking heteroskedasticity or vice versa? because the robust hausman test and standard hausman test does not show same results.
      thank you

      Comment


      • #4
        Benazire:
        welcome to the list.
        For the future, I would recommend you to start a new thread. Thanks.
        Assuming that you ran -xtreg- having a large N, small T panel dataset (as per FAQ, that you're kindly requested to read before your first post, please note how to post more effectively, by providing the list with all details needed to reply to your query positively) and you suspect autocorrelation and/or heteroskedasticity, you can simply robustifying/clustering your standard errors (SEs).
        As per -hausman- outcome, you can give it one more try (with default SEs, as -hausman- does not support other flavours of SEs) including the -sigmamore- option.
        As per -xtoverid- outcome it may be that your panel data regression can be handled with a pooled OLS because the individual effects are negligible. I find difficult to comment on any further as you did non post what you typed and what Stata gave you back (via CODE delimiters) as per FAQ again.
        As far as your last question is concerned, if the F-test at the foot of -xtreg,fe- (with default SEs) outcome table does not reach statistical significance, there's no evidence that panel data regession with fixed effects specification outperforms pooled OLS.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Dear Carlo,
          I am sorry I am new to stata that is why I having difficulty to post.
          I used the sigmamore option and the results is still the same i.e not positive and that xtoverid cannot be generated. An extract of my results is:
          . xtreg DROE SI FOR CAP OPER DIV LT DCRE DINF DLEV INT GDP LOGMS,fe
          note: FOR omitted because of collinearity

          Fixed-effects (within) regression Number of obs = 143
          Group variable: banknum Number of groups = 13

          R-sq: within = 0.2560 Obs per group: min = 11
          between = 0.1699 avg = 11.0
          overall = 0.0983 max = 11

          F(11,119) = 3.72
          corr(u_i, Xb) = -0.8346 Prob > F = 0.0001

          ------------------------------------------------------------------------------
          DROE | Coef. Std. Err. t P>|t| [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          SI | .0460808 .0476597 0.97 0.336 -.0482902 .1404518
          FOR | 0 (omitted)
          CAP | .3800529 .2940966 1.29 0.199 -.2022877 .9623935
          OPER | -7.438018 1.550303 -4.80 0.000 -10.50777 -4.368263
          DIV | 5.77091 1.41302 4.08 0.000 2.972989 8.568831
          LT | -.013274 .1032155 -0.13 0.898 -.217651 .191103
          DCRE | -.974008 .3598181 -2.71 0.008 -1.686484 -.2615321
          DINF | .469359 .5237653 0.90 0.372 -.5677486 1.506467
          DLEV | -.0001692 .0014744 -0.11 0.909 -.0030887 .0027502
          INT | .5859163 .7650078 0.77 0.445 -.9288756 2.100708
          GDP | .7687877 .8184024 0.94 0.349 -.8517308 2.389306
          LOGMS | .2720517 .4861522 0.56 0.577 -.6905782 1.234682
          _cons | -1.987936 2.251568 -0.88 0.379 -6.446266 2.470395
          -------------+----------------------------------------------------------------
          sigma_u | .10117947
          sigma_e | .12156791
          rho | .4092288 (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(12, 119) = 1.10 Prob > F = 0.3645

          . estimate store fe

          . xtreg DROE SI FOR CAP OPER DIV LT DCRE DINF DLEV INT GDP LOGMS,re

          Random-effects GLS regression Number of obs = 143
          Group variable: banknum Number of groups = 13

          R-sq: within = 0.2206 Obs per group: min = 11
          between = 0.1566 avg = 11.0
          overall = 0.1963 max = 11

          Wald chi2(12) = 31.75
          corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0015

          ------------------------------------------------------------------------------
          DROE | Coef. Std. Err. z P>|z| [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          SI | -.0217974 .0112791 -1.93 0.053 -.0439041 .0003093
          FOR | -.0369358 .0309392 -1.19 0.233 -.0975754 .0237039
          CAP | -.1129379 .1051661 -1.07 0.283 -.3190597 .0931839
          OPER | -4.860142 1.247274 -3.90 0.000 -7.304755 -2.415529
          DIV | 4.996007 1.325476 3.77 0.000 2.398121 7.593893
          LT | .058153 .0596294 0.98 0.329 -.0587185 .1750245
          DCRE | -1.022181 .3478043 -2.94 0.003 -1.703865 -.3404967
          DINF | .3033672 .5169409 0.59 0.557 -.7098183 1.316553
          DLEV | .0005365 .0013697 0.39 0.695 -.0021481 .0032212
          INT | .147327 .6562801 0.22 0.822 -1.138958 1.433612
          GDP | .2009391 .6787933 0.30 0.767 -1.129471 1.53135
          LOGMS | -.0326379 .4483227 -0.07 0.942 -.9113342 .8460585
          _cons | .6541225 1.392724 0.47 0.639 -2.075566 3.383811
          -------------+----------------------------------------------------------------
          sigma_u | 0
          sigma_e | .12156791
          rho | 0 (fraction of variance due to u_i)
          ------------------------------------------------------------------------------

          . estimate store re

          . hausman fe re, sigmamore

          Note: the rank of the differenced variance matrix (8) does not equal the number of coefficients being tested (11); 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.

          ---- Coefficients ----
          | (b) (B) (b-B) sqrt(diag(V_b-V_B))
          | fe re Difference S.E.
          -------------+----------------------------------------------------------------
          SI | .0460808 -.0217974 .0678782 .0464557
          CAP | .3800529 -.1129379 .4929908 .2756126
          OPER | -7.438018 -4.860142 -2.577876 .9286866
          DIV | 5.77091 4.996007 .774903 .5019562
          LT | -.013274 .058153 -.071427 .0846344
          DCRE | -.974008 -1.022181 .0481727 .096404
          DINF | .469359 .3033672 .1659917 .0937092
          DLEV | -.0001692 .0005365 -.0007057 .0005576
          INT | .5859163 .147327 .4385892 .3976376
          GDP | .7687877 .2009391 .5678486 .4616513
          LOGMS | .2720517 -.0326379 .3046896 .1918265
          ------------------------------------------------------------------------------
          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(8) = (b-B)'[(V_b-V_B)^(-1)](b-B)
          = 10.96
          Prob>chi2 = 0.2040
          (V_b-V_B is not positive definite)

          . xtoverid
          Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS
          r(198);

          .
          I would be grateful if you could help me to identify which choice of the model should I use .. FE , RE or pooled OLS

          Comment


          • #6
            Benazire:
            thanks for providing further details (but, please, try harder acting on FAQ about how to post more effectively. Thanks).
            As per your results, I think you should go POLS (with standard errors clustered on -panelid-, though).
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              Dear Carlo,

              does the vce(cluster panelid) work for panel data that has large T and small N? What about cases where T is approximately equal to N but not too large (approximately 30)?

              Many thanks,
              Jay Yen

              Comment


              • #8
                Yay:
                take a look at http://www.stata.com/statalist/archi.../msg00127.html.
                Kind regards,
                Carlo
                (Stata 18.0 SE)

                Comment


                • #9
                  Dear Carlo:

                  Thank you for your reply. From the link, Wooldridge explained that vce(robust) does not apply to samples with large N and large T, or samples where T is larger than N. It would be immensely helpful if you can explain what could be done in these situations to correct for heteroskedasticity and autocorrelation. Thank you in advance.

                  Kind regards,
                  Jay

                  Comment


                  • #10
                    Jay:
                    take a look at -xtgls- entry in Stata .pdf manual, with -panels()- and -corr()- options.
                    Kind regards,
                    Carlo
                    (Stata 18.0 SE)

                    Comment


                    • #11
                      Dear Carlo, is it logical to use robust std. errors in all cases? I mean if we do not have heterokedasticity problem.

                      Comment


                      • #12
                        Originally posted by Abdurrahman Kara View Post
                        Dear Carlo, is it logical to use robust std. errors in all cases? I mean if we do not have heterokedasticity problem.
                        It's logical, yeah. However if standart errors do not change, logic says it wouldn't be necessary to use standart robust errors. But if they do change, it means heterokedasticity problem was existing and it's fixed.

                        Comment


                        • #13
                          I agree with John.
                          Kind regards,
                          Carlo
                          (Stata 18.0 SE)

                          Comment

                          Working...
                          X