**[XT] xtdpd** -- Linear dynamic panel-data estimation

__Syntax__

**xtdpd** *depvar* [*indepvars*] [*if*] [*in*] **,** __dg__**mmiv(***varlist* [...]**)** [*options*]

*options* Description
-------------------------------------------------------------------------
Model
* __dg__**mmiv(***varlist*[*...*]**)** GMM-type instruments for the difference equation;
can be specified more than once
__lg__**mmiv(***varlist*[*...*]**)** GMM-type instruments for the level equation; can
be specified more than once
**iv(***varlist*[*...*]**)** standard instruments for the difference and level
equations; can be specified more than once
**div(***varlist*[*...*]**)** standard instruments for the difference equation
only; can be specified more than once
**liv(***varlist***)** standard instruments for the level equation only;
can be specified more than once
__nocons__**tant** suppress constant term
__two__**step** compute the two-step estimator instead of the
one-step estimator
__h__**ascons** check for collinearity only among levels of
independent variables; by default checks occur
among levels and differences
__fod__**eviation** use forward-orthogonal deviations instead of
first differences

SE/Robust
**vce(***vcetype***)** *vcetype* may be **gmm** or __r__**obust**

Reporting
__l__**evel(***#***)** set confidence level; default is **level(95)**
__ar__**tests(***#***)** use *#* as maximum order for AR tests; default is
**artests(2)**
*display_options* control spacing and line width

__coefl__**egend** display legend instead of statistics
-------------------------------------------------------------------------
* **dgmmiv()** is required.
A panel variable and a time variable must be specified; use **xtset**; see
**[XT] xtset**.
*depvar*, *indepvars*, and all *varlists* may contain time-series operators;
see tsvarlist.
**by**, **statsby**, and **xi** are allowed; see prefix.
**coeflegend** does not appear in the dialog box.
See **[XT] xtdpd postestimation** for features available after estimation.

__Menu__

**Statistics > Longitudinal/panel data > Dynamic panel data (DPD) >** **Linear**
**DPD estimation**

__Description__

**xtdpd** fits a linear dynamic panel-data model where the unobserved
panel-level effects are correlated with the lags of the dependent
variable. The command can fit Arellano-Bond and
Arellano-Bover/Blundell-Bond models like those fit by **xtabond** and
**xtdpdsys**. However, it also allows models with low-order moving-average
correlation in the idiosyncratic errors or predetermined variables with a
more complicated structure than allowed for **xtabond** or **xtdpdsys**.

__Options__

+-------+
----+ Model +------------------------------------------------------------

**dgmmiv(***varlist* [**,** __l__**agrange(***flag* [*llag*]**)**]**)** specifies GMM-type instruments
for the difference equation. Levels of the variables are used to
form GMM-type instruments for the difference equation. All possible
lags are used, unless **lagrange(***flag* *llag***)** restricts the lags to begin
with *flag* and end with *llag*. You may specify as many sets of
GMM-type instruments for the difference equation as you need within
the standard Stata limits on matrix size. Each set may have its own
*flag* and *llag*. **dgmmiv()** is required.

**lgmmiv(***varlist* [**,** __l__**ag(***#***)**]**)** specifies GMM-type instruments for the level
equation. Differences of the variables are used to form GMM-type
instruments for the level equation. The first lag of the differences
is used unless **lag(***#***)** is specified, indicating that *#*th lag of the
differences be used. You may specify as many sets of GMM-type
instruments for the level equation as you need within the standard
Stata limits on matrix size. Each set may have its own *lag*.

**iv(***varlist* [**,** __nodi__**fference**]**)** specifies standard instruments for both the
difference and level equations. Differences of the variables are
used as instruments for the difference equation, unless **nodifference**
is specified, which requests that levels be used. Levels of the
variables are used as instruments for the level equation. You may
specify as many sets of standard instruments for both the difference
and level equations as you need within the standard Stata limits on
matrix size.

**div(***varlist* [**,** __nodi__**fference**]**)** specifies additional standard instruments
for the difference equation. Specified variables may not be included
in **iv()** or in **liv()**. Differences of the variables are used, unless
**nodifference** is specified, which requests that levels of the
variables be used as instruments for the difference equation. You
may specify as many additional sets of standard instruments for the
difference equation as you need within the standard Stata limits on
matrix size.

**liv(***varlist***)** specifies additional standard instruments for the level
equation. Specified variables may not be included in **iv()** or in
**div()**. Levels of the variables are used as instruments for the level
equation. You may specify as many additional sets of standard
instruments for the level equation as you need within the standard
Stata limits on matrix size.

**noconstant**; see **[R] estimation options**.

**twostep** specifies that the two-step estimator be calculated.

**hascons** specifies that **xtdpd** check for collinearity only among levels of
independent variables; by default checks occur among levels and
differences.

**fodeviation** specifies that forward-orthogonal deviations be used instead
of first differences. **fodeviation** is not allowed when there are gaps
in the data or when **lgmmiv()** is specified.

+-----------+
----+ SE/Robust +--------------------------------------------------------

**vce(***vcetype***)** specifies the type of standard error reported, which
includes types that are derived from asymptotic theory and that are
robust to some kinds of misspecification; see *Methods and formulas* in
**[XT] xtdpd**.

**vce(gmm)**, the default, uses the conventionally derived variance
estimator for generalized method of moments estimation.

**vce(robust)** uses the robust estimator. For the one-step estimator,
this is the Arellano-Bond robust VCE estimator. For the two-step
estimator, this is the Windmeijer (2005) WC-robust estimator.

+-----------+
----+ Reporting +--------------------------------------------------------

**level(***#***)**; see **[R] estimation options**.

**artests(***#***)** specifies the maximum order of the autocorrelation test to be
calculated. The tests are reported by **estat** **abond**; see **[XT] xtdpd**
**postestimation**. Specifying the order of the highest test at
estimation time is more efficient than specifying it to **estat** **abond**,
because **estat** **abond** must refit the model to obtain the test
statistics. The maximum order must be less than or equal to the
number of periods in the longest panel. The default is **artests(2)**.

*display_options*: **vsquish** and **nolstretch**; see **[R] estimation options**.

The following option is available with **xtdpd** but is not shown in the
dialog box:

**coeflegend**; see **[R] estimation options**.

__Examples__

Setup
**. webuse abdata**

Arellano-Bond estimator with two lags of dependent variable included as
regressors and strictly exogenous covariates
**. xtdpd l(0/2).n l(0/1).(w ys) k, dgmmiv(n) div(l(0/1).(w ys) k)**
**. xtdpd l(0/2).n l(0/1).(w ys) k year yr1980-yr1984, dgmmiv(n)**
**div(l(0/1).(w ys) k year) div(yr1980-yr1984) nocons hascons**

Arellano-Bond estimator with two lags of dependent variable included as
regressors, strictly exogenous covariates and robust VCE
**. xtdpd l(0/2).n l(0/1).(w ys) k year yr1980-yr1984, dgmmiv(n)**
**div(l(0/1).(w ys) k year) div(yr1980-yr1984) nocons hascons**
**twostep vce(robust)**

Arellano-Bover/Blundell-Bond system estimator with two lags of dependent
variable included as regressors and strictly exogenous covariates
**. xtdpd l(0/2).n l(0/1).(w ys) k, dgmmiv(n) lgmmiv(n) div(l(0/1).(w**
**ys) k )**

Arellano-Bond estimator with two lags of dependent variable included as
regressors, endogenous covariates and a robust VCE
**. xtdpd L(0/1).(n w k) year yr1979-yr1984, dgmmiv(n w k) div(year**
**yr1979-yr1984) nocons hascons vce(robust)**

Arellano-Bover/Blundell-Bond system estimator with two lags of dependent
variable included as regressors, endogenous covariates and a robust VCE
**. xtdpd L(0/1).(n w k) year yr1979-yr1984, dgmmiv(n w k) lgmmiv(n w**
**k) div(year yr1979-yr1984) nocons hascons vce(robust)**

__Stored results__

**xtdpd** stores the following in **e()**:

Scalars
**e(N)** number of observations
**e(N_g)** number of groups
**e(df_m)** model degrees of freedom
**e(g_min)** smallest group size
**e(g_avg)** average group size
**e(g_max)** largest group size
**e(t_min)** minimum time in sample
**e(t_max)** maximum time in sample
**e(chi2)** chi-squared
**e(arm***#***)** test for autocorrelation of order *#*
**e(artests)** number of AR tests computed
**e(sig2)** estimate of sigma_epsilon^2
**e(rss)** sum of squared differenced residuals
**e(sargan)** Sargan test statistic
**e(rank)** rank of **e(V)**
**e(zrank)** rank of instrument matrix

Macros
**e(cmd)** **xtdpd**
**e(cmdline)** command as typed
**e(depvar)** name of dependent variable
**e(twostep)** **twostep**, if specified
**e(ivar)** variable denoting groups
**e(tvar)** variable denoting time within groups
**e(vce)** *vcetype* specified in **vce()**
**e(vcetype)** title used to label Std. Err.
**e(system)** **system**, if system estimator
**e(hascons)** **hascons**, if specified
**e(transform)** specified transform
**e(diffvars)** already differenced variables
**e(datasignature)** checksum from **datasignature**
**e(properties)** **b V**
**e(estat_cmd)** program used to implement **estat**
**e(predict)** program used to implement **predict**
**e(marginsok)** predictions allowed by **margins**

Matrices
**e(b)** coefficient vector
**e(V)** variance-covariance matrix of the estimators

Functions
**e(sample)** marks estimation sample

__Reference__

Windmeijer, F. 2005. A finite sample correction for the variance of
linear efficient two-step GMM estimators. *Journal of Econometrics*
126: 25-51.