*! version 1.2.3 04aug2020

*! Sebastian Kripfganz, www.kripfganz.de

Title

xtseqreg -- Sequential linear panel data estimation

Syntax

xtseqreg depvar [(indepvars1)] [indepvars2] [if] [in] [, options]

options

Model
first(first_spec) specify first-stage estimation results

both estimate both stages

nocommonesample do not restrict estimation samples to be the same

iv(iv_spec) standard instruments; can be specified more than once

gmmiv(gmmiv_spec) GMM-type instruments; can be specified more than once

wmatrix(wmat_spec) specify initial weighting matrix

twostep compute two-step instead of one-step estimator

teffects add time effects to the model

noconstant suppress constant term

SE/Robust
vce(vcetype) vcetype may be conventional, ec, robust, or cluster clustvar

Reporting
combine combine the estimation results for both equations

level(#) set confidence level; default is level(95)

noheader suppress output header

notable suppress coefficient table

noomitted suppress omitted variables

first_spec is

[name] [, noconstant equation(eqno|eqname) copy]

iv_spec is

varlist [, iv_options]

gmmiv_spec is

varlist [, lagrange(#_1 [#_2]) ec collapse iv_options]

where iv_options are difference, model(model), and equation(eqno|eqname),
and where model is either level or difference, and eqno is either #1 or #2.

wmat_spec is

[wmat_type] [, ratio(#)]

and wmat_type is either unadjusted, independent, or separate.

You must xtset your data before using xtseqreg; see [XT] xtset.

depvar and all varlists may contain time-series operators; see tsvarlist.

See xtseqreg postestimation for features available after estimation.

xtseqreg is a community-contributed program. The current version requires Stata version 12.1 or higher; see version history and updates.

Description

xtseqreg implements sequential estimators for linear panel models with the analytical second-stage standard error correction of Kripfganz and Schwarz (2019).

xtseqreg estimates the coefficients b2 and the corresponding standard errors for the linear panel model

y - x1' b1 = x2' b2 + e

where x1 and x2 are the variables in indepvars1 and indepvars2, respectively. The coefficients b1 are taken from a first-stage regression of y on x1 (and potentially additional independent variables).
At the second stage, the standard errors for the coefficients b2 need to be corrected to account for the first-stage estimation error.

xtseqreg estimates a standard linear panel model if indepvars1 is not specified. Ordinary least squares and two-stage least squares estimation are supported,
as well as generalized method of moments estimation in the spirit of Arellano and Bond (1991), Arellano and Bover (1995), and Blundell and Bond (1998) with flexible choice of the instruments.

Options

Model

first([name] [, suboptions]) specifies the first-stage estimation results. By default, the last estimation results currently active in memory are used.
Specifying name is equivalent to typing estimates restore name prior to executing xtseqreg; see [R] estimates restore.
Allowed suboptions are noconstant, equation(eqno|eqname), and copy.

noconstant specifies that the estimated first-stage constant term, if any, should not be added to indepvars1 and that an overall regression constant is estimated at the second stage.

equation(eqno|eqname) is relevant only when you have previously fit a multiple-equation model. It specifies the equation to which you are referring. You can refer to the equation by its equation number, ##, or equation name.
By default, the first equation is used.

copy specifies that the first-stage coefficients shall be copied from the prior estimation results by position rather than by name. Equation names are ignored when you have previously fit a multiple-equation model.
The number of coefficients must equal the number of variables in indepvars1, including the constant term unless the suboption noconstant is also specified.

both requests that both the first and the second stage are estimated. By default, the estimation results specified with the option first(first_spec) are used as first-stage estimates and only stage two is estimated.

nocommonesample requests that the estimation sample is not restricted to be the same for both equations.

iv(varlist [, suboptions]) specifies standard instruments. You may specify as many sets of standard instruments as you need.
Allowed suboptions are difference, model(level|difference), and equation(eqno|eqname).

difference requests a first-difference transformation of varlist. This is equivalent to specifying iv(D.(varlist)); see tsvarlist.

model(model) specifies if the instruments apply to the model in levels, model(level), or in first differences, model(difference). The default is model(level).

equation(eqno|eqname) is relevant only in combination with option both. It specifies the equation to which you are referring and eqno should be either #1 or #2.

gmmiv(varlist [, suboptions]) specifies GMM-type instruments. These are separate instruments for each time period. You may specify as many sets of GMM-type instruments as you need.
Allowed suboptions are lagrange(#_1 [#_2]), ec, collapse, difference, model(level|difference), and equation(eqno|eqname).

lagrange(#_1 [#_2]) specifies the lags of varlist to be used as instruments. Negative integers are allowed to include leads. A missing value for #_1 requests all available leads to be used until #_2,
while a missing value for #_2 requests all available lags to be used starting with #_1. Thus, lagrange(. .) uses all available observations. The default is lagrange(1 .).

ec specifies instruments valid under an error-components structure with an independent and identically distributed idiosyncratic component.
These are the additional instruments implied by the linear moment conditions derived by Ahn and Schmidt (1995) under the assumption of homoskedastic errors if varlist is specified as L.depvar.
This suboption is seldom used and it implies the other suboptions model(difference) and lagrange(0 0).

collapse requests to collapse the GMM-type instruments into standard instruments. This option is useful to reduce the number of instruments, in particular if all available lags are used.
With a limited number of lags, lagrange(#_1 #_2), this is equivalent to specifying iv(L(#_1/#_2).varlist).

difference requests a first-difference transformation of varlist. This is equivalent to specifying gmmiv(D.(varlist)); see tsvarlist.

model(model) specifies if the instruments apply to the model in levels, model(level), or in first differences, model(difference). The default is model(level).

equation(eqno|eqname) is relevant only in combination with option both. It specifies the equation to which you are referring and eqno should be either #1 or #2.

wmatrix([wmat_type] [, ratio(#)]) specifies the weighting matrix to be used to obtain one-step GMM estimates or initial estimates for two-step GMM estimation.
wmat_type is either unadjusted, independent, or separate.

wmatrix(unadjusted), the default, is optimal for an error-components structure with a unit-specific component and an independent and identically distributed idiosyncratic component
if all instruments refer to the model in first differences or if the variance ratio of the unit-specific error component to the idiosyncratic error component is known.
This ratio can be specified with the suboption ratio(#). The default is ratio(0).

wmatrix(independent) is the same as wmatrix(unadjusted) but treats the models in levels and first differences as independent, thus ignoring the covariance between the respective error terms.

wmatrix(separate) is the same as wmatrix(unadjusted) but treats the models in levels and first differences as separate models with an independent and identically distributed error term for the model in first differences,
thus ignoring the covariance between the respective error terms and the first-order serial correlation of the first-differenced error term.

twostep requests the two-step GMM estimator to be computed that is based on an optimal weighting matrix. By default, the one-step GMM estimator is used based on the initial weighting matrix specified with option wmatrix(wmat_spec).
An unrestricted optimal weighting matrix is computed using these one-step GMM estimates unless vce(ec) is specified in which case a restricted estimate based on an error-components structure is computed.
The unrestricted weighting matrix allows for intragroup correlation at the level specified with vce(cluster clustvar). By default, clustvar equals panelvar.

teffects requests that time-specific effects are added to the model. The first time period in the estimation sample is treated as the base period.
If indepvars1 is specified, the time effects are added to the first-stage regression if option both is also specified and otherwise to the second-stage regression.

noconstant; see [R] estimation options.

SE/Robust

vce(vcetype) specifies the type of standard error reported, which includes types that are derived from asymptotic theory (conventional, ec), that are robust to some kinds of misspecification (robust),
and that allow for intragroup correlation (cluster clustvar).

vce(conventional [, difference]) uses the conventionally derived variance estimator. It is robust to some kinds of misspecification if the two-step GMM estimator is used.
The suboption difference requests the error variance to be computed from the first-differenced residuals if the one-step GMM estimator is used.
vce(conventional) is the default, although in most cases vce(robust) would be recommended.

vce(ec) assumes an error-components structure with a unit-specific component and an independent and identically distributed idiosyncratic component.

vce(robust) and vce(cluster clustvar) use the sandwich estimator for one-step GMM estimation. For two-step GMM estimation, they compute the conventional estimator with the Windmeijer (2005) correction.
vce(robust) is equivalent to vce(cluster panelvar).

Reporting

combine combines the estimation results for both equations if indepvars1 is specified instead of displaying them as separate equations.
This option implies the options noheader and noomitted and affects the behavior of postestimation commands that compute equation-specific statistics; see xtseqreg postestimation.

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

noheader suppresses display of the header above the coefficient table that displays the number of observations and instruments.

notable suppresses display of the coefficient table.

noomitted; see [R] estimation options.

Remarks

xtseqreg can be used to fit both stages of a sequential regression. In the first stage,

xtseqreg depvar indepvars1 [if] [in] [, options]

fits a linear panel model of depvar on indepvars1. In the second stage,

xtseqreg depvar (indepvars1) indepvars2 [if] [in] [, options]

fits a linear panel model of depvar, adjusted for the impact of indepvars1, on indepvars2.
It is often the case that indepvars1 constitutes time-varying independent variables and indepvars2 time-invariant independent variables.

See Kripfganz and Schwarz (2019) for background information about the analytical standard error correction in the context of sequential GMM estimation of linear dynamic panel models with time-invariant regressors.

Example

Setup

. webuse psidextract

Fit a first-stage model for time-varying indepvars with OLS

. xtseqreg lwage wks south smsa ms exp exp2 occ ind union

Fit a second-stage model for time-invariant indepvars with OLS

. xtseqreg lwage (wks south smsa ms exp exp2 occ ind union) fem blk ed

Saved results

xtseqreg saves the following in e():

Scalars

e(N) number of observations

e(N_g) number of groups

e(N_clust) number of clusters; not always saved

e(rank) rank of e(V)

e(sigma2e) estimate of sigma_e^2; not always saved

e(sigma2u) estimate of sigma_u^2; not always saved

e(twostep) = 1 if the two-step GMM estimator is computed

Macros

e(cmd) xtseqreg

e(cmdline) command as typed

e(ivar) variable denoting groups

e(tvar) variable denoting time

e(estat_cmd) xtseqreg_estat

e(predict) xtseqreg_p

e(teffects) time effects created with option teffects

e(ivvars_1) standard instruments for equation #1

e(gmmivvars_1) GMM-type instruments for equation #1

e(divvars_1) standard instruments for differenced equation #1

e(dgmmivvars_1) GMM-type instruments for differenced equation #1

e(ecivvars_1) collapsed EC instruments for differenced equation #1

e(ecgmmivvars_1) GMM-type EC instruments for differenced equation #1

e(ivvars_2) standard instruments for equation #2

e(gmmivvars_2) GMM-type instruments for equation #2

e(divvars_2) standard instruments for differenced equation #2

e(dgmmivvars_2) GMM-type instruments for differenced equation #2

e(ecivvars_2) collapsed EC instruments for differenced equation #2

e(ecgmmivvars_2) GMM-type EC instruments for differenced equation #2

e(wmatrix) wmat_spec specified with option wmatrix()

e(vce) conventional, ec, or robust

e(vcetype) title used to label Std. Err.

e(properties) b V

e(depvar) name of dependent variable

Matrices

e(b) coefficient vector

e(V) variance-covariance matrix of the estimators

e(V_modelbased) model-based variance; not always saved

e(W) weighting matrix

e(b_onestep) one-step GMM coefficients; not always saved

e(V_onestep) one-step GMM variance; not always saved

e(W_onestep) one-step GMM weighting matrix; not always saved

e(stats) equation-specific statistics

Functions

e(sample) marks estimation sample

Version history and updates

xtseqreg is a community-contributed program. To determine the currently installed version, type

. which xtseqreg, all

To update the xtseqreg package to the latest version, type

. //www.kripfganz.de/stata/") replace"'

If the connection to the previous website fails, alternatively type

. ssc install xtseqreg, replace

The SSC version is less frequently updated and may not be the latest available version. The current version of the xtseqreg package requires Stata version 12.1 or higher.

Author

Sebastian Kripfganz, University of Exeter, http://www.kripfganz.de

References

Ahn, S. C., and P. Schmidt. 1995.
Efficient estimation of models for dynamic panel data.
Journal of Econometrics 68: 5-27.

Arellano, M., and S. R. Bond. 1991.
Some tests of specification for panel data: Monte Carlo evidence and an application to employment equations.
Review of Economic Studies 58: 277-297.

Arellano, M., and O. Bover. 1995.
Another look at the instrumental variable estimation of error-components models.
Journal of Econometrics 68: 29-51.

Blundell, R., and S. R. Bond. 1998.
Initial conditions and moment restrictions in dynamic panel data models.
Review of Economic Studies 87: 115-143.

Kripfganz, S., and C. Schwarz. 2019.
Estimation of linear dynamic panel data models with time-invariant regressors.
Journal of Applied Econometrics 34: 526-546.

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