Announcement

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

  • Heteroskedastic Test in Random Effects

    Hello!

    I have a unbalanced panel data with 123 cross sections and 247,904 observations . The observations are daily.

    I need to make a regresion by random effects because I have dummy variables, so I can't estimate by fixed effects.

    I tried to estimate with xtreghet, but I didn't have succeed. The message was
    "matsize too small to create a [297539,1] matrix
    r(908);"

    I already set matsize 8000 and set emptycells drop, but I still did not succeed.

    How I have to proced to test Heteroskedastic?

    Thanks for the help!!

  • #2
    Maybe this thread will be helpful to you.
    Best regards,

    Marcos

    Comment


    • #3
      Hello Marcos!

      I read the post and I understood that I can use the Breusch-Pagan test for Heteroskedastic in random effects. I am right?

      Comment


      • #4
        One way to test the HT would be a graphic effect betwen the error and lagged error, this might give you an idea if errors have a constant distribution over time, if not, HT exist even with panel regression, a bad thing is that xttest3 doesn't work with re , just with fe and xtgls

        So a quick way in order to either check and correct HT is to implement ,vce(robust) after your panel data regression and check if the standart errors associate to your coeficient increases or not. if not, HT wasn't present, if they do, the previously model had HT and it's been corrected. it's not a formal test, but it can help you to see if your model has HT.
        Last edited by John Riveros; 19 Sep 2018, 23:15.

        Comment


        • #5
          Ok John, Thank you!

          Comment


          • #6
            Jessica:
            you may also be interested in the following thread: https://economics.stackexchange.com/...vs-time-series.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Hello Carlo!! Thanks a lot!!

              I read the post and made the test with my data, like below:

              Code:
              . xtreg CaptaçãoLíquida Retornomensal Retornoanual logPL Dummy, re
              
              Random-effects GLS regression                   Number of obs     =    300,168
              Group variable: ID                              Number of groups  =        148
              
              R-sq:                                           Obs per group:
                   within  = 0.0017                                         min =         37
                   between = 0.1234                                         avg =    2,028.2
                   overall = 0.0017                                         max =      3,012
              
                                                              Wald chi2(4)      =     521.31
              corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
              
              -------------------------------------------------------------------------------------
                  CaptaçãoLíquida |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              --------------------+----------------------------------------------------------------
                    Retornomensal |   114135.9   24445.55     4.67   0.000     66223.47    162048.3
              Retornoanual12meses |   129070.7   6379.846    20.23   0.000     116566.4    141574.9
                            logPL |  -3206.386   5150.497    -0.62   0.534    -13301.17    6888.402
                            Dummy |   18306.71   21220.63     0.86   0.388    -23284.97    59898.39
                            _cons |   7190.148   37873.88     0.19   0.849    -67041.29    81421.58
              --------------------+----------------------------------------------------------------
                          sigma_u |  91362.686
                          sigma_e |  937374.07
                              rho |  .00941035   (fraction of variance due to u_i)
              -------------------------------------------------------------------------------------
              
              . 
              . predict uhat, ue
              (34,028 missing values generated)
              
              . 
              . predict xb, xb
              (34,028 missing values generated)
              
              . 
              . gen uhatsq = uhat^2
              (34,028 missing values generated)
              
              . 
              . reg uhatsq c.xb##c.xb, vce(cl ID)
              
              Linear regression                               Number of obs     =    300,168
                                                              F(2, 147)         =       1.68
                                                              Prob > F          =     0.1890
                                                              R-squared         =     0.0000
                                                              Root MSE          =     6.6e+13
              
                                                 (Std. Err. adjusted for 148 clusters in ID)
              ------------------------------------------------------------------------------
                           |               Robust
                    uhatsq |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                        xb |   784429.2    4046911     0.19   0.847     -7213212     8782070
                           |
                 c.xb#c.xb |   40.39247   48.58825     0.83   0.407    -55.62925    136.4142
                           |
                     _cons |   8.18e+11   2.42e+11     3.38   0.001     3.39e+11    1.30e+12
              ------------------------------------------------------------------------------
              
              . 
              . testparm c.xb##c.xb
              
               ( 1)  xb = 0
               ( 2)  c.xb#c.xb = 0
              
                     F(  2,   147) =    1.68
                          Prob > F =    0.1890
              Can I say that I don't have Heteroskedastic?

              I have another question... I am the same person who posted the forum "Panel Data with heteroskedastic - How to procede?"

              I am doing 3 regresions with the data that I mentioned in the other forum. One of the regresion is with a Dummy, and because of the Dummy I am estimating with the random effects..... Do you think that I can use the xtgls for correct autocorrelation too? I read something about xthtaylor, do you think that is good for my job?

              Once again so many thanks!!!

              Comment


              • #8
                Jessica:
                with a T>N panel dataset, I would switch to -xtgls- and take heteroskedacity and autocorrelation into account with the appropriate option, if needed.
                Admittedly, I fail to get why you ​​​adopted random effect specification due to categorical variables among your predictors. With a bit of a guess-work, I assume that you mean that fixed effect specification, getting rid of time-invariant predictors, cannot estimate related coefficients.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Originally posted by Carlo Lazzaro View Post
                  Jessica:
                  with a T>N panel dataset, I would switch to -xtgls- and take heteroskedacity and autocorrelation into account with the appropriate option, if needed.
                  Admittedly, I fail to get why you ​​​adopted random effect specification due to categorical variables among your predictors. With a bit of a guess-work, I assume that you mean that fixed effect specification, getting rid of time-invariant predictors, cannot estimate related coefficients.
                  Hi Carlo,
                  What is the name of heteroskedacity test for random effect model? I need the test's name to present in my study. Thank a lot for providing useful information.

                  Comment

                  Working...
                  X