Announcement

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

  • Xtabond postestimation - export results to Excel

    Dear all,

    I estimate a dynamic panel model using xtabond command. Next I use xtabond postestimation command "estat abond" to obtain Arellano-Bond test for zero autocorrelation in first-differenced errors. The results are like the one below:

    Arellano-Bond test for zero autocorrelation in first-differenced errors
    +-----------------------+
    |Order | z Prob > z|
    |------+----------------|
    | 1 |-2.5735 0.0101 |
    | 2 |-1.6586 0.0972 |
    +-----------------------+
    H0: no autocorrelation

    How can I export the results, together with the A-B test results to Excel? I can export the results using outreg2 (below), but how to add the p-values from the test? I'm using Stata 16

    xtabond y_var x_var1 xvar_2, maxlag(1) vce(robust)
    est store results
    estat abond

    outreg2 [results] using results.xls stats (coef se)

  • #2
    outreg2 is from SSC, as you are asked to explain in FAQ Advice #12. The two-tailed Z-test P value is easy to calculate.

    Code:
    webuse abdata
    qui xtabond n l(0/1).w l(0/2).(k ys), lags(2) vce(robust)
    est sto m1
    estat abond
    ereturn list
    local p1= 2*normal(e(arm1))
    local p2= 2*normal(e(arm2))
    outreg2 m1 using myfile.xls, seeout replace ///
    addstat(Z-stat. no autocorrelation in FD errors (order 1), e(arm1), ///
    P-value, `p1', Z-stat. no autocorrelation in FD errors (order 2), e(arm2), P-value, `p2')
    Res.:

    Code:
    . estat abond
    
    Arellano-Bond test for zero autocorrelation in first-differenced errors
      +-----------------------+
      |Order |  z     Prob > z|
      |------+----------------|
      |   1  |-3.8272  0.0001 |
      |   2  |-.50783  0.6116 |
      +-----------------------+
       H0: no autocorrelation
    
       
    (1)
    VARIABLES n
    L.n 0.720***
    (0.149)
    L2.n -0.0916
    (0.0582)
    w -0.612***
    (0.178)
    L.w 0.387**
    (0.183)
    k 0.361***
    (0.0586)
    L.k -0.0612
    (0.0718)
    L2.k -0.0289
    (0.0352)
    ys 0.658***
    (0.117)
    L.ys -0.532**
    (0.217)
    L2.ys 0.0135
    (0.147)
    Constant 0.562
    (0.576)
    Observations 611
    Number of id 140
    Z-stat. no autocorrelation in FD errors (order 1) -3.827
    P-value 0.000130
    Z-stat. no autocorrelation in FD errors (order 2) -0.508
    P-value 0.612
    Robust standard errors in parentheses *** p<0.01, ** p<0.05, * p<0.1
    Last edited by Andrew Musau; 30 Oct 2020, 13:22.

    Comment

    Working...
    X