Announcement

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

  • Treatment for heteroskedasticity and serial correlation

    Hello Statalist members,

    I’m in need of some help, I have a model off differences in differences where I’m testing for the impact of a policy change in the bank industry, it’s an unbalanced panel.
    I run the model as it follows:

    P_dummy is a time dummy, T_dummy is a treatment dummy, DifDif is the product of T_dummy and P_dummy, the others are control variables

    Code:
    . xtset
           panel variable:  ID (unbalanced)
            time variable:  time, 2002m3 to 2012m4
                    delta:  1 month
    
    
    . xtreg CRk DifDif P_dummy T_dummy DRLP Un, re
    
    Random-effects GLS regression                   Number of obs      =      3340
    Group variable: ID                              Number of groups   =        64
    
    R-sq:  within  = 0.2215                         Obs per group: min =         3
           between = 0.6283                                        avg =      52.2
           overall = 0.4601                                        max =       103
    
                                                    Wald chi2(5)       =    930.00
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2        =    0.0000
    
    ------------------------------------------------------------------------------
             CRk |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          DifDif |    1.18954   .0496293    23.97   0.000     1.092268    1.286811
         P_dummy |  -.3073857   .0482846    -6.37   0.000    -.4020218   -.2127497
         T_dummy |   .7410848   .1687651     4.39   0.000     .4103114    1.071858
            DRLP |  -.4023052   .0925115    -4.35   0.000    -.5836245   -.2209859
              Un |  -.0908159    .016692    -5.44   0.000    -.1235315   -.0581002
           _cons |     3.8108   .5965272     6.39   0.000     2.641628    4.979972
    -------------+----------------------------------------------------------------
         sigma_u |  4.6378604
         sigma_e |  .55184455
             rho |  .98603977   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . xtoverid
    
    Test of overidentifying restrictions: fixed vs random effects
    Cross-section time-series model: xtreg re   
    Sargan-Hansen statistic  88.754  Chi-sq(5)    P-value = 0.0000
    The xtoverid command suggest that I should use Fixed effects, which I did, as it follows:

    Code:
    . xtreg CRk DifDif P_dummy T_dummy DRLP Un, fe
    
    Fixed-effects (within) regression               Number of obs      =      3340
    Group variable: ID                              Number of groups   =        64
    
    R-sq:  within  = 0.2217                         Obs per group: min =         3
           between = 0.6347                                        avg =      52.2
           overall = 0.4463                                        max =       103
    
                                                    F(5,3271)          =    186.38
    corr(u_i, Xb)  = 0.6223                         Prob > F           =    0.0000
    
    ------------------------------------------------------------------------------
             CRk |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          DifDif |   1.184449   .0490231    24.16   0.000      1.08833    1.280568
         P_dummy |  -.3048414   .0476903    -6.39   0.000    -.3983473   -.2113355
         T_dummy |   .5766794   .1679742     3.43   0.001     .2473342    .9060246
            DRLP |   -.400709   .0913726    -4.39   0.000    -.5798624   -.2215556
              Un |  -.0895465   .0164898    -5.43   0.000    -.1218778   -.0572152
           _cons |   4.075789   .1099719    37.06   0.000     3.860168     4.29141
    -------------+----------------------------------------------------------------
         sigma_u |  7.1052858
         sigma_e |  .55184455
             rho |  .99400404   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0:     F(63, 3271) =  5213.34            Prob > F = 0.0000
    After this I tested for heteroskedasticity and serial correlation:

    Code:
    . xttest3
    
    Modified Wald test for groupwise heteroskedasticity
    in fixed effect regression model
    
    H0: sigma(i)^2 = sigma^2 for all i
    
    chi2 (64)  =    4.5e+07
    Prob>chi2 =      0.0000
    
    
    . xtserial CRk DifDif P_dummy T_dummy DRLP Un
    
    Wooldridge test for autocorrelation in panel data
    H0: no first-order autocorrelation
        F(  1,      63) =    377.268
               Prob > F =      0.0000
    And so I get to the conclusion the model have both. I have searched some things and apparently if I go with robust errors this will deal with those problems, and that is what i did:

    Code:
    . xtreg CRk DifDif P_dummy T_dummy DRLP Un, fe robust
    
    Fixed-effects (within) regression               Number of obs      =      3340
    Group variable: ID                              Number of groups   =        64
    
    R-sq:  within  = 0.2217                         Obs per group: min =         3
           between = 0.6347                                        avg =      52.2
           overall = 0.4463                                        max =       103
    
                                                    F(4,63)            =         .
    corr(u_i, Xb)  = 0.6223                         Prob > F           =         .
    
                                        (Std. Err. adjusted for 64 clusters in ID)
    ------------------------------------------------------------------------------
                 |               Robust
             CRk |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          DifDif |   1.184449   .5629363     2.10   0.039     .0595108    2.309388
         P_dummy |  -.3048414   .1498798    -2.03   0.046    -.6043522   -.0053306
         T_dummy |   .5766794   .1579478     3.65   0.001      .261046    .8923129
            DRLP |   -.400709   .2100127    -1.91   0.061    -.8203858    .0189678
              Un |  -.0895465   .0442645    -2.02   0.047    -.1780021   -.0010909
           _cons |   4.075789   .3456725    11.79   0.000     3.385018    4.766561
    -------------+----------------------------------------------------------------
         sigma_u |  7.1052858
         sigma_e |  .55184455
             rho |  .99400404   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    And so I test again for both the problems:

    . xttest3

    Code:
    Modified Wald test for groupwise heteroskedasticity
    in fixed effect regression model
    
    H0: sigma(i)^2 = sigma^2 for all i
    
    chi2 (64)  =    4.5e+07
    Prob>chi2 =      0.0000
    
    
    . xtserial CRk DifDif P_dummy T_dummy DRLP Un
    
    Wooldridge test for autocorrelation in panel data
    H0: no first-order autocorrelation
        F(  1,      63) =    377.268
               Prob > F =      0.0000
    And nothing changes, is the serial correlation and the heteroskedasticity to severe to correct? There are no other alternatives? If so, the model has no use?

    Hope someone can give me good news...

    Thank you all in advance!











  • #2
    (Cluster)Robust standard errors will make your standard errors robust to heteroskedasticity and serial correlation. It has no effect whatsoever on the data or the residuals itself, so they will still be serially correlated and/or heteroskedastic.

    Comment


    • #3
      Gustavo:
      Jesse has already helpfuly replied to the substantive matter of your query.
      As an aside, why bothering yoursel with creating categorical variables and interactions when -fvvarlist- can do it for you?
      Code:
      i.T_dummy##i.P_dummy
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X