Announcement

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

  • Panel data tests

    Hi, I'm doing some estimates with panel data. I have some questions. Can I use -hettest- with panel data? I run -xtreg, fe- and -xtreg,re- and to test what was the best choice i did the hausman test, but because from -hettest- resulted that there was heteroskedaticity i used -xtoverid- after -xtreg, re cluster (clustvar)- . Is that correct? I got a p-value= 0,0013 so i rejected the null hypothesis, and prefer the fixed effect model.
    After that does it make sense to run -xttest0- to investigate if there are random effects? I did and I got a p-value= 0,1889 so I can't reject the null right?
    Best regards,
    Carla.

  • #2
    Once you reject random effects as inconsistent, you cannot go back and compare it with anything else. So do not waste your time running xttest0. If you have \(N>>T\), estimate the fixed effects model and cluster on the panel variable. Don't even bother testing for heteroscedasticity or serial correlation.

    Comment


    • #3
      Thank you for your answer. Fon N and T you mean time and countries right? Sorry I'm a beginner. Fon N I have 15 countries and for T 40 quarters so T>N. So in my case is correct to run -hettest- -xtreg, fe cluster- and than -xtoverid-? I deleted -xttest-
      Last edited by Carla Ferro; 19 Aug 2021, 04:42.

      Comment


      • #4
        As you have \(T>N\), look at estimation with xtgls.

        Code:
        help xtgls

        Also, as your \(T\) dimension is large enough, you may want to allow cross-sectional correlation. Therefore, consider the command xtscc from SSC (ivreghdfe from SSC also allows Driscoll and Kraay standard errors, and is an alternative to xtscc, especially when you have
        multiple levels of fixed effects).

        Code:
        ssc install xtscc
        help xtscc

        Comment


        • #5
          Ok thank you, I try this new calculations. Also I have another question. I know that I should delete it, but isn't weird that with the xttest0 gets a p value> 0,05 so there aren't panel wise effects? I should preferer the OLS, so is correct then compare fixed vs random knowing that there aren't panel wise effect?

          Comment


          • #6
            You still have the choice between pooled OLS and fixed effects. This is the Wald test that the country dummies are jointly equal to 0 (in xtreg, you find the statistic at the foot of the table). It may still happen that you conclude that pooled OLS is the way to go.

            Code:
            webuse grunfeld
            regress invest mvalue kstock i.company
            testparm i.company
            xtreg invest mvalue kstock, fe
            Res.:

            Code:
            . testparm i.company
            
             ( 1)  2.company = 0
             ( 2)  3.company = 0
             ( 3)  4.company = 0
             ( 4)  5.company = 0
             ( 5)  6.company = 0
             ( 6)  7.company = 0
             ( 7)  8.company = 0
             ( 8)  9.company = 0
             ( 9)  10.company = 0
            
                   F(  9,   188) =   49.18
                        Prob > F =    0.0000
            
            . 
            . xtreg invest mvalue kstock, fe
            
            Fixed-effects (within) regression               Number of obs     =        200
            Group variable: company                         Number of groups  =         10
            
            R-sq:                                           Obs per group:
                 within  = 0.7668                                         min =         20
                 between = 0.8194                                         avg =       20.0
                 overall = 0.8060                                         max =         20
            
                                                            F(2,188)          =     309.01
            corr(u_i, Xb)  = -0.1517                        Prob > F          =     0.0000
            
            ------------------------------------------------------------------------------
                  invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                  mvalue |   .1101238   .0118567     9.29   0.000     .0867345    .1335131
                  kstock |   .3100653   .0173545    17.87   0.000     .2758308    .3442999
                   _cons |  -58.74393   12.45369    -4.72   0.000    -83.31086     -34.177
            -------------+----------------------------------------------------------------
                 sigma_u |  85.732501
                 sigma_e |  52.767964
                     rho |  .72525012   (fraction of variance due to u_i)
            ------------------------------------------------------------------------------
            F test that all u_i=0: F(9, 188) = 49.18                     Prob > F = 0.0000
            
            .

            Comment


            • #7
              Thank you so so much!! In your example we can say that the fixed model is the one correct, right?
              Last edited by Carla Ferro; 19 Aug 2021, 11:54.

              Comment


              • #8
                Correct.

                Comment


                • #9
                  Thank you!!

                  Comment

                  Working...
                  X