Announcement

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

  • Testing heteroskedasticity and autocorrelation in xtlogit without time variable

    Hello all,

    I have an unbalanced panel data set. For this, STATA (14.2) wants me to define a panel ID variable and a time variable. In my panel data set, I am looking at corporate transactions over 20 years. Accordingly, it happens that a firm also made more than one transaction per year. Thus, defining the panel ID variable is not a problem, as I can simply use the unique company ID, but I cannot define the time variable, so I omitted it.
    I need to run xtlogit for my data. Using hausman, I decided to use xtlogit, fe. Now I want to (1) test for heteroscedasticity and autocorrelation and (2) deal with these problems (if they exist).
    Here we come to the problems: All tests for heteroskedasticity and autocorrelation (e.g., xtserial) and all methods for dealing with these problems (robust, and cluster robust) are not available for xtlogit and a situation with no defined time variable. How can I test for heteroskedasticity and autocorrelation and how can I deal with them in such a context?

    I am curious to know what the possibilities are. Thanks in advance for the support.

  • #2
    Tim:
    as far as heteroskedasticity in logistis regression is concerned, see https://www.statalist.org/forums/for...ogistic-models and related threads.
    That said:
    1) there's no need to omit -timevar- from the predictors even if you -xtset- your data with -panelid- only. Omitting -timevar- affects the use of time.series oprators only:
    Code:
    . xtset idcode
    . xtlogit nev_mar i.year grade i.collgrad, vce(cluster idcode)
    
    <snip>
    
    Random-effects logistic regression              Number of obs     =     28,516
    Group variable: idcode                          Number of groups  =      4,709
    
    Random effects u_i ~ Gaussian                   Obs per group:
                                                                  min =          1
                                                                  avg =        6.1
                                                                  max =         15
    
    Integration method: mvaghermite                 Integration pts.  =         12
    
                                                    Wald chi2(16)     =      94.70
    Log pseudolikelihood  = -6538.3662              Prob > chi2       =     0.0000
    
                                 (Std. Err. adjusted for 4,709 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         nev_mar |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
            year |
             69  |  -2.103163   .3381283    -6.22   0.000    -2.765882   -1.440443
             70  |  -4.354363   .7430371    -5.86   0.000    -5.810689   -2.898037
             71  |  -6.388592   1.153663    -5.54   0.000     -8.64973   -4.127453
             72  |  -8.445867   1.641965    -5.14   0.000    -11.66406   -5.227675
             73  |  -10.26324   2.015434    -5.09   0.000    -14.21342   -6.313063
             75  |  -13.02047   2.700853    -4.82   0.000    -18.31405   -7.726895
             77  |  -14.76657   3.221512    -4.58   0.000    -21.08061   -8.452519
             78  |  -16.04289   3.562454    -4.50   0.000    -23.02518   -9.060613
             80  |  -17.28638   3.909375    -4.42   0.000    -24.94861   -9.624143
             82  |  -18.31837   4.123085    -4.44   0.000    -26.39947   -10.23727
             83  |  -18.78052   4.212138    -4.46   0.000    -27.03615   -10.52488
             85  |  -20.23677   4.372926    -4.63   0.000    -28.80755     -11.666
             87  |  -21.06047   4.447172    -4.74   0.000    -29.77676   -12.34417
             88  |  -21.38792   4.486054    -4.77   0.000    -30.18043   -12.59542
                 |
           grade |   .5475258   .2239294     2.45   0.014     .1086323    .9864193
      1.collgrad |    4.06499   1.366191     2.98   0.003     1.387305    6.742675
           _cons |  -5.852637   2.568222    -2.28   0.023    -10.88626   -.8190139
    -------------+----------------------------------------------------------------
        /lnsig2u |   5.263559   .2063211                      4.859178    5.667941
    -------------+----------------------------------------------------------------
         sigma_u |   13.89848   1.433775                      11.35421    17.01288
             rho |   .9832541   .0033972                       .975116    .9887613
    ------------------------------------------------------------------------------
    
    
    . xtset idcode year
           panel variable:  idcode (unbalanced)
            time variable:  year, 68 to 88, but with gaps
                    delta:  1 unit
    
    . xtlogit nev_mar i.year grade i.collgrad, vce(cluster idcode)
    
    <snip>
    
    Random-effects logistic regression              Number of obs     =     28,516
    Group variable: idcode                          Number of groups  =      4,709
    
    Random effects u_i ~ Gaussian                   Obs per group:
                                                                  min =          1
                                                                  avg =        6.1
                                                                  max =         15
    
    Integration method: mvaghermite                 Integration pts.  =         12
    
                                                    Wald chi2(16)     =      94.70
    Log pseudolikelihood  = -6538.3662              Prob > chi2       =     0.0000
    
                                 (Std. Err. adjusted for 4,709 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         nev_mar |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
            year |
             69  |  -2.103163   .3381283    -6.22   0.000    -2.765882   -1.440443
             70  |  -4.354363   .7430371    -5.86   0.000    -5.810689   -2.898037
             71  |  -6.388592   1.153663    -5.54   0.000     -8.64973   -4.127453
             72  |  -8.445867   1.641965    -5.14   0.000    -11.66406   -5.227675
             73  |  -10.26324   2.015434    -5.09   0.000    -14.21342   -6.313063
             75  |  -13.02047   2.700853    -4.82   0.000    -18.31405   -7.726895
             77  |  -14.76657   3.221512    -4.58   0.000    -21.08061   -8.452519
             78  |  -16.04289   3.562454    -4.50   0.000    -23.02518   -9.060613
             80  |  -17.28638   3.909375    -4.42   0.000    -24.94861   -9.624143
             82  |  -18.31837   4.123085    -4.44   0.000    -26.39947   -10.23727
             83  |  -18.78052   4.212138    -4.46   0.000    -27.03615   -10.52488
             85  |  -20.23677   4.372926    -4.63   0.000    -28.80755     -11.666
             87  |  -21.06047   4.447172    -4.74   0.000    -29.77676   -12.34417
             88  |  -21.38792   4.486054    -4.77   0.000    -30.18043   -12.59542
                 |
           grade |   .5475258   .2239294     2.45   0.014     .1086323    .9864193
      1.collgrad |    4.06499   1.366191     2.98   0.003     1.387305    6.742675
           _cons |  -5.852637   2.568222    -2.28   0.023    -10.88626   -.8190139
    -------------+----------------------------------------------------------------
        /lnsig2u |   5.263559   .2063211                      4.859178    5.667941
    -------------+----------------------------------------------------------------
         sigma_u |   13.89848   1.433775                      11.35421    17.01288
             rho |   .9832541   .0033972                       .975116    .9887613
    ------------------------------------------------------------------------------
    
    .
    2) depending on your -xtlogit- specification, different options for non-default standard errors are available (see -help xtlogit-).
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment

    Working...
    X