Announcement

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

  • Why different results for tests for serial correlation / autocorrelation in panel data (abar, actest, xtserial)?

    I would like to test my panel data for serial correlation. The panel data is unbalanced and has gaps. Therefore, I was looking for test that can handle any sort of unbalancedness. So far, I found the Arellano-Bond (abar) / Cumby-Huizinga (actest) and Wooldridge's (xtserial) test for autocorrelation which meet my requirements.

    Here is my code and my results:

    Code:
    xtset FE_1 FE_2
    
    regress depvar vars i.FE_1 i.FE_2

    Cumby-Huizinga test for autocorrelation
    Code:
    actest, lags(20)
    
    Cumby-Huizinga test for autocorrelation
      H0: variable is MA process up to order q
      HA: serial correlation present at specified lags >q
    -----------------------------------------------------------------------------
      H0: q=0 (serially uncorrelated)        |  H0: q=specified lag-1
      HA: s.c. present at range specified    |  HA: s.c. present at lag specified
    -----------------------------------------+-----------------------------------
        lags   |      chi2      df     p-val | lag |      chi2      df     p-val
    -----------+-----------------------------+-----+-----------------------------
       1 -  1  |    757.212      1    0.0000 |   1 |    757.212      1    0.0000
       1 -  2  |    1385.812     2    0.0000 |   2 |    695.011      1    0.0000
       1 -  3  |    1789.365     3    0.0000 |   3 |    506.361      1    0.0000
       1 -  4  |    2273.550     4    0.0000 |   4 |    639.468      1    0.0000
       1 -  5  |    2629.892     5    0.0000 |   5 |    546.467      1    0.0000
       1 -  6  |    2755.502     6    0.0000 |   6 |    245.182      1    0.0000
       1 -  7  |    2842.962     7    0.0000 |   7 |    219.924      1    0.0000
       1 -  8  |    2935.920     8    0.0000 |   8 |    222.080      1    0.0000
       1 -  9  |    3075.582     9    0.0000 |   9 |    275.906      1    0.0000
       1 - 10  |    3157.055     10   0.0000 |  10 |    209.879      1    0.0000
       1 - 11  |    3265.898     11   0.0000 |  11 |    233.459      1    0.0000
       1 - 12  |    3300.320     12   0.0000 |  12 |    142.085      1    0.0000
       1 - 13  |    3343.435     13   0.0000 |  13 |    154.606      1    0.0000
       1 - 14  |    3393.600     14   0.0000 |  14 |    156.435      1    0.0000
       1 - 15  |    3407.393     15   0.0000 |  15 |     83.492      1    0.0000
       1 - 16  |    3468.555     16   0.0000 |  16 |    174.376      1    0.0000
       1 - 17  |    3478.740     17   0.0000 |  17 |     67.731      1    0.0000
       1 - 18  |    3531.506     18   0.0000 |  18 |    156.942      1    0.0000
       1 - 19  |    3619.679     19   0.0000 |  19 |    207.440      1    0.0000
       1 - 20  |    3676.357     20   0.0000 |  20 |    171.505      1    0.0000
    -----------------------------------------------------------------------------
      Test allows predetermined regressors/instruments
      Test requires conditional homoskedasticity

    Arellano-Bond test for autocorrelation
    Code:
    abar, lags(20)
    
    Arellano-Bond test for AR(1): z =  27.51  Pr > z = 0.0000
    Arellano-Bond test for AR(2): z =  26.38  Pr > z = 0.0000
    Arellano-Bond test for AR(3): z =  22.57  Pr > z = 0.0000
    Arellano-Bond test for AR(4): z =  25.37  Pr > z = 0.0000
    Arellano-Bond test for AR(5): z =  23.49  Pr > z = 0.0000
    Arellano-Bond test for AR(6): z =  15.74  Pr > z = 0.0000
    Arellano-Bond test for AR(7): z =  14.94  Pr > z = 0.0000
    Arellano-Bond test for AR(8): z =  15.00  Pr > z = 0.0000
    Arellano-Bond test for AR(9): z =  16.72  Pr > z = 0.0000
    Arellano-Bond test for AR(10): z =  14.59  Pr > z = 0.0000
    Arellano-Bond test for AR(11): z =  15.40  Pr > z = 0.0000
    Arellano-Bond test for AR(12): z =  12.04  Pr > z = 0.0000
    Arellano-Bond test for AR(13): z =  12.54  Pr > z = 0.0000
    Arellano-Bond test for AR(14): z =  12.62  Pr > z = 0.0000
    Arellano-Bond test for AR(15): z =   9.22  Pr > z = 0.0000
    Arellano-Bond test for AR(16): z =  13.34  Pr > z = 0.0000
    Arellano-Bond test for AR(17): z =   8.30  Pr > z = 0.0000
    Arellano-Bond test for AR(18): z =  12.65  Pr > z = 0.0000
    Arellano-Bond test for AR(19): z =  14.55  Pr > z = 0.0000
    Arellano-Bond test for AR(20): z =  13.23  Pr > z = 0.0000


    Wooldridge test for autocorrelation in panel data
    Code:
    xtserial depvar vars
    
    Wooldridge test for autocorrelation in panel data
    H0: no first-order autocorrelation
        F(  1,    2765) =      0.000
               Prob > F =      0.9980
    I was expecting no serial correlation. But, based on abar and actest I have strong support for serial correlation (even for higher lags). In contrast, Wooldridge's test for serial correlation is indicating no serial correlation...
    • Why do the test have very different results?
    • What is my mistake?
    • What else should I check?

    Best regards,
    Olaf

  • #2
    Several comments. The value for the Wooldridge test seems too small. What is the structure of your data? How big are N and T? My test takes the null to be that the errors in the original model have no serial correlation.

    And it's not obvious the CH and AB tests are valid using the fixed effects residuals -- unless T is pretty large. I do think that the CH test has a different null: it is testing that there is serial correlation. For example, when applied to a differenced equation, you should find MA(1) serial correlation if the original errors had none. The AB test applied using xtabond2 has a similar feature. I don't know about abar.

    I can't say more until you show more output.

    JW

    Comment


    • #3
      My dataset has around 5.000 IDs with T=100. But, the panel data is very unbalanced and has gaps. In average, each ID has only about 35 data points.

      All three tests (Arellano-Bond (abar) / Cumby-Huizinga (actest) and Wooldridge (xtserial)) take the null hypothesis that there is no serial correlation. Your test is specially designed for panel data with fixed effects, Arellano-Bond for "large N, small T" and Cumby-Huizinga for "large T". So I would expect that at least the Wooldridge and Arellano-Bond test should produce the same results.

      And it's not obvious the CH and AB tests are valid using the fixed effects residuals
      I guess this is a useful comment and could be the source of problems. Unfortunately, I couldn't find further and helpful information.
      Does anyone have further details on fixed effects in combination with Arellano-Bond and Cumby-Huizinga test for serial correlation?

      Comment


      • #4
        Your output is too cryptic. Did you include a full set of time period dummies in the Wooldridge test? I can’t tell if you’ve effectively estimated the same model. And how close are the FE and FD estimates? You’re basing the serial correlation tests on different estimates.

        Comment


        • #5
          Did you include a full set of time period dummies in the Wooldridge test?
          No, I did not. I corrected my models, but it does not change a lot. Here are the results for the FE estimator and for xtserial.

          FE estimator (xtreg, fe)
          Code:
          xtset ID TIME
          
          xtreg depvar var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 i.TIME, fe
          
          
          Fixed-effects (within) regression               Number of obs     =    156,507
          Group variable: ID                              Number of groups  =      5,225
          
          R-sq:                                           Obs per group:
               within  = 0.0949                                         min =          1
               between = 0.1478                                         avg =       30.0
               overall = 0.1031                                         max =        100
          
                                                          F(131,5224)       =      74.47
          corr(u_i, Xb)  = 0.0283                         Prob > F          =     0.0000
          
                                                  (Std. Err. adjusted for 5,225 clusters in ID)
          ----------------------------------------------------------------------------------------
                                 |               Robust
                          depvar |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -----------------------+----------------------------------------------------------------
                            var1 |   .0000261   .0000164     1.59   0.112    -6.05e-06    .0000582
                            var2 |   .0592512   .0068405     8.66   0.000     .0458424      .07266
                            var3 |  -.0013062   .0070326    -0.19   0.853    -.0150917    .0124793
                            var4 |   .0614124   .0100319     6.12   0.000     .0417476    .0810772
                            var5 |   .0047622   .0067172     0.71   0.478    -.0084049    .0179293
                            var6 |   .0978107   .0160491     6.09   0.000     .0663508    .1292706
                            var7 |   .0587624    .011058     5.31   0.000     .0370863    .0804385
                            var8 |   .0247905   .0051166     4.85   0.000     .0147608    .0348202
                            var9 |   .0244136    .006641     3.68   0.000     .0113957    .0374315
                           var10 |   .0257202   .0075643     3.40   0.001     .0108924     .040548
                           var11 |   .1619714   .0051336    31.55   0.000     .1519085    .1720344
                                 |
                            TIME |
                              2  |   .0367185   .0182107     2.02   0.044     .0010215    .0724155
                              3  |  -.0297645    .017612    -1.69   0.091    -.0642878    .0047589
                              4  |  -.3868301   .0198277   -19.51   0.000    -.4256967   -.3479634
          ...
                                 |
                           _cons |   .0285867   .0234903     1.22   0.224    -.0174594    .0746329
          -----------------------+----------------------------------------------------------------
                         sigma_u |  .35782306
                         sigma_e |   .5894319
                             rho |  .26928737   (fraction of variance due to u_i)
          ----------------------------------------------------------------------------------------

          Wooldridge test for autocorrelation (xtserial)
          Code:
          xi: xtserial depvar var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 i.TIME, output
          
          
          Linear regression                               Number of obs     =     57,878
                                                          F(131, 3269)      =      23.75
                                                          Prob > F          =     0.0000
                                                          R-squared         =     0.0809
                                                          Root MSE          =     .83458
          
                                                  (Std. Err. adjusted for 3,270 clusters in ID)
          ----------------------------------------------------------------------------------------
                                 |               Robust
                        D.depvar |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -----------------------+----------------------------------------------------------------
                            var1 |
                             D1. |   .0000365     .00003     1.22   0.224    -.0000224    .0000954
                                 |
                            var2 |
                             D1. |   .0615951   .0128793     4.78   0.000     .0363464    .0868439
                                 |
                            var3 |
                             D1. |  -.0145864   .0114973    -1.27   0.205    -.0371259    .0079531
                                 |
                            var4 |
                             D1. |   .0763933    .019004     4.02   0.000     .0391376     .113649
                                 |
                            var5 |
                             D1. |   .0000155   .0113403     0.00   0.999    -.0222163    .0222472
                                 |
                            var6 |
                             D1. |   .0863238    .026958     3.20   0.001     .0334748    .1391727
                                 |
                            var7 |
                             D1. |   .0840948   .0198359     4.24   0.000     .0452081    .1229815
                                 |
                            var8 |
                             D1. |   .0254529   .0094185     2.70   0.007     .0069887    .0439171
                                 |
                            var9 |
                             D1. |   .0226582   .0125625     1.80   0.071    -.0019696    .0472859
                                 |
                           var10 |
                             D1. |   .0356051   .0134454     2.65   0.008     .0092465    .0619636
                                 |
                           var11 |
                             D1. |   .1651531   .0094203    17.53   0.000     .1466854    .1836208
                                 |
                        _ITIME_2 |
                             D1. |   .0419367   .0199764     2.10   0.036     .0027746    .0810987
                                 |
                        _ITIME_3 |
                             D1. |  -.0473197   .0226854    -2.09   0.037    -.0917925    -.002847
          ...
          
                                 |
                      _ITIME_100 |
                             D1. |  -.2849337   .3317277    -0.86   0.390    -.9352574      .36539
          ----------------------------------------------------------------------------------------
          
          Wooldridge test for autocorrelation in panel data
          H0: no first-order autocorrelation
              F(  1,    1765) =      0.100
                     Prob > F =      0.7517

          The Arellano-Bond (abar) and Cumby-Huizinga (actest) test for autocorrelation are postestimation commands. They do not run after xtreg so I used regress with ID and TIME dummies.
          Code:
          regress depvar var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 i.ID i.TIME
          Last edited by Olaf Hotte; 25 Jun 2019, 05:25.

          Comment

          Working...
          X