Announcement

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

  • Question about AR test of xtabond

    Dear all,

    I have a question about xtabond.We can use --estat abond--to do the AR test of the error terms.But I want to do AR test step by step.I mean ,firstly, get the error and then use --reg--command.
    Here is the example.
    Code:
    webuse abdata,clear
     xtabond n w k, twostep
     estat abond
     
     Arellano-Bond test for zero autocorrelation in first-differenced errors
      +-----------------------+
      |Order |  z     Prob > z|
      |------+----------------|
      |   1  |-2.4955  0.0126 |
      |   2  |-.52671  0.5984 |
      +-----------------------+
       H0: no autocorrelation
    
      
     predict e,e
     reg e L.e L2.e
     
     
          Source |       SS           df       MS      Number of obs   =       611
    -------------+----------------------------------   F(2, 608)       =   2845.84
           Model |  75.5173265         2  37.7586633   Prob > F        =    0.0000
        Residual |  8.06695695       608  .013268021   R-squared       =    0.9035
    -------------+----------------------------------   Adj R-squared   =    0.9032
           Total |  83.5842835       610  .137023416   Root MSE        =    .11519
    
    ------------------------------------------------------------------------------
               e |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               e |
             L1. |      0.681      0.042    16.35   0.000        0.599       0.763
             L2. |      0.254      0.041     6.22   0.000        0.174       0.334
                 |
           _cons |     -0.013      0.005    -2.79   0.006       -0.023      -0.004
    ------------------------------------------------------------------------------
    I find that result with --reg-- is different from the result of the command --estat abond--.
    Anyone can give some suggestions?I want to know the calculation process behind --estat abond--.

    Many thanks in advance.


    Best regards.
    Raymond
    Last edited by Raymond Zhang; 28 Jan 2021, 04:11.
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

  • #2
    I can get first-differenced errors by running "predict e, e", but what can I do in next step? Anyone can help me?@Nick Cox Carlo Lazzaro
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

    Comment


    • #3
      Sorry, but I have never used Arellano-Bond.

      Comment


      • #4
        Nick Cox Thank you for your reply.Another simple question,How can I control time trend in panel FE model? here are two methods, which method is right?
        Code:
        webuse grunfeld,clear
        bys company:gen Trend=_n
        xtreg invest mvalue kstock Trend,fe
        Code:
        xtreg invest mvalue kstock c.year,fe
        Best regards.
        Raymond
        Best regards.

        Raymond Zhang
        Stata 17.0,MP

        Comment


        • #5
          Raymond:
          the first advice is to switch form -xtreg- to -xtregar- or -xtgls- if you have a T>N panel dataset.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            @Carlo Lazzaro Thank you for your suggestion ,Carlo. But here ,I just want to know how to control time trend in FE model. If I want to add the time trend in the model ,how can I write the codes?

            Best regards.
            Raymond
            Best regards.

            Raymond Zhang
            Stata 17.0,MP

            Comment


            • #7
              Raymond:
              you cannot include -timevar- in -xtregar-.
              In -xtreg, fe- (that was developed for N>T panel datasets) -timevar- is usually coded as a categorical predictor:
              Code:
              . use "https://www.stata-press.com/data/r16/nlswork.dta"
              (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
              
              . xtreg ln_wage i.year i.race, fe vce(cluster idcode)
              note: 2.race omitted because of collinearity
              note: 3.race omitted because of collinearity
              
              Fixed-effects (within) regression               Number of obs     =     28,534
              Group variable: idcode                          Number of groups  =      4,711
              
              R-sq:                                           Obs per group:
                   within  = 0.1059                                         min =          1
                   between = 0.0788                                         avg =        6.1
                   overall = 0.0721                                         max =         15
              
                                                              F(14,4710)        =      74.45
              corr(u_i, Xb)  = 0.0283                         Prob > F          =     0.0000
              
                                           (Std. Err. adjusted for 4,711 clusters in idcode)
              ------------------------------------------------------------------------------
                           |               Robust
                   ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      year |
                       69  |    .086922   .0104445     8.32   0.000     .0664458    .1073981
                       70  |   .0730999   .0107089     6.83   0.000     .0521054    .0940943
                       71  |   .1245316   .0113143    11.01   0.000     .1023503    .1467129
                       72  |   .1361498   .0122887    11.08   0.000     .1120582    .1602414
                       73  |   .1510882    .012356    12.23   0.000     .1268648    .1753117
                       75  |   .1656841   .0124631    13.29   0.000     .1412506    .1901176
                       77  |    .221329   .0129468    17.10   0.000     .1959472    .2467107
                       78  |   .2570319    .013432    19.14   0.000     .2306989    .2833649
                       80  |   .2650459   .0136801    19.37   0.000     .2382266    .2918652
                       82  |   .2850749    .013733    20.76   0.000     .2581517    .3119981
                       83  |   .3095487   .0141833    21.82   0.000     .2817427    .3373547
                       85  |   .3601922    .013813    26.08   0.000     .3331123    .3872722
                       87  |   .3771489   .0142489    26.47   0.000     .3492145    .4050833
                       88  |   .4354505   .0153701    28.33   0.000     .4053178    .4655831
                           |
                      race |
                    black  |          0  (omitted)
                    other  |          0  (omitted)
                           |
                     _cons |   1.444088    .010313   140.03   0.000      1.42387    1.464307
              -------------+----------------------------------------------------------------
                   sigma_u |  .40806568
                   sigma_e |  .30294584
                       rho |  .64468296   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              
              .
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X