# Re: st: xtabond

 From "David M. Drukker" To statalist@hsphsun2.harvard.edu Subject Re: st: xtabond Date Wed, 17 Sep 2003 08:54:59 -0500 (CDT)

```Mine Zeynep Senses <msenses@umich.edu> asked how to specify a model that
includes an interaction between a predetermined variable and an exogenous
categorical variable in -xtabond-.

Mark Schaffer <M.E.Schaffer@hw.ac.uk> pointed out since one of the
variables in the interaction is predetermined, the new interaction
variables will also be predetermined.  So the short answer is to create
the new variables using the -xi- command and then include an incomplete
set of the interaction terms using the -predetermined()- option in
-xtabond-.  Here is an example.

First, load the data and create the interaction terms.

. use  http://www.stata-press.com/data/r8/abdata.dta

. tsset
panel variable:  id, 1 to 140
time variable:  year, 1976 to 1984

. xi i.year*w
i.year            _Iyear_1976-1984    (naturally coded; _Iyear_1976 omitted)
i.year*w          _IyeaXw_#           (coded as above)

Since, the instrument matrix is going to be larger than 40, we need to reset
the matsize.

. set matsize 800

Now we are ready to make the call to -xtabond-.

. xtabond n w k , pre(_IyeaXw_1978- _IyeaXw_1983)

Arellano-Bond dynamic panel-data estimation     Number of obs      =       751
Group variable (i): id                          Number of groups   =       140

Wald chi2(9)       =    624.34

Time variable (t): year                         Obs per group: min =         5
avg =  5.364286
max =         7

One-step results
------------------------------------------------------------------------------
D.n          |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
n            |
LD |   .1983164   .0583268     3.40   0.001      .083998    .3126349
_IyeaXw_1978 |
D1 |  -.0023495   .0034753    -0.68   0.499     -.009161     .004462
_IyeaXw_1979 |
D1 |   .0011238   .0037163     0.30   0.762      -.00616    .0084077
_IyeaXw_1980 |
D1 |  -.0021206   .0042034    -0.50   0.614     -.010359    .0061179
_IyeaXw_1981 |
D1 |   -.014984   .0044381    -3.38   0.001    -.0236826   -.0062855
_IyeaXw_1982 |
D1 |  -.0152869   .0043979    -3.48   0.001    -.0239067   -.0066671
_IyeaXw_1983 |
D1 |  -.0078014   .0049774    -1.57   0.117    -.0175571    .0019542
w            |
D1 |  -.4356998   .0473467    -9.20   0.000    -.5284977   -.3429019
k            |
D1 |   .3535819   .0259731    13.61   0.000     .3026756    .4044882
_cons        |  -.0175745   .0035327    -4.97   0.000    -.0244984   -.0106505
------------------------------------------------------------------------------
Sargan test of over-identifying restrictions:
chi2(231) =   128.30     Prob > chi2 = 1.0000

Arellano-Bond test that average autocovariance in residuals of order 1 is 0:
H0: no autocorrelation   z =  -1.72   Pr > z = 0.0847
Arellano-Bond test that average autocovariance in residuals of order 2 is 0:
H0: no autocorrelation   z =  -0.50   Pr > z = 0.6171

The inclusion of so many overidentifying restrictions, evident from the
degrees of freedom of the Sargan test, can increase the finite sample bias
of the estimator.  For this reason, Mine might want to use the
-lagstruct()- suboption to limit the number of instruments used for each
of the predetermined variables.

For example,

. xtabond n w k , pre(_IyeaXw_1978- _IyeaXw_1983, lagstruct(0,1))

Arellano-Bond dynamic panel-data estimation     Number of obs      =       751
Group variable (i): id                          Number of groups   =       140

Wald chi2(9)       =    614.67

Time variable (t): year                         Obs per group: min =         5
avg =  5.364286
max =         7

One-step results
------------------------------------------------------------------------------
D.n          |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
n            |
LD |   .1928331   .0601789     3.20   0.001     .0748847    .3107816
_IyeaXw_1978 |
D1 |  -.0022473   .0034813    -0.65   0.519    -.0090705    .0045758
_IyeaXw_1979 |
D1 |   .0013843   .0037424     0.37   0.711    -.0059508    .0087193
_IyeaXw_1980 |
D1 |  -.0017308   .0042616    -0.41   0.685    -.0100835    .0066218
_IyeaXw_1981 |
D1 |   -.014524   .0045055    -3.22   0.001    -.0233546   -.0056935
_IyeaXw_1982 |
D1 |   -.014912   .0044387    -3.36   0.001    -.0236117   -.0062124
_IyeaXw_1983 |
D1 |  -.0075573   .0050117    -1.51   0.132    -.0173802    .0022655
w            |
D1 |  -.4383602    .048046    -9.12   0.000    -.5325287   -.3441917
k            |
D1 |   .3519153   .0260975    13.48   0.000     .3007652    .4030654
_cons        |  -.0180174   .0036005    -5.00   0.000    -.0250742   -.0109606
------------------------------------------------------------------------------
Sargan test of over-identifying restrictions:
chi2(105) =   115.54     Prob > chi2 = 0.2267

Arellano-Bond test that average autocovariance in residuals of order 1 is 0:
H0: no autocorrelation   z =  -1.58   Pr > z = 0.1149
Arellano-Bond test that average autocovariance in residuals of order 2 is 0:
H0: no autocorrelation   z =  -0.48   Pr > z = 0.6309

--David
ddrukker@stata.com

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```

• References:
• st: xtabond
• From: Mine Zeynep Senses <msenses@umich.edu>