help xtdolshm
-------------------------------------------------------------------------------

Title

Performs Dynamic Ordinary Least Squares for Cointegrated Panel Data with h > omogeneous covariance structure

Syntax

xtdolshm depvar indepvars [if] [in] [, options]

options Description ------------------------------------------------------------------------- Main Level set confidence level; default is level(95) nlags specify the number of lags nleads specify the number of leads -------------------------------------------------------------------------

You must tsset your data before using xtdolshm; see tsset. varlist may contain time-series operators; see tsvarlist. by is allowed with xtdolshm if no time-series operators are used in the command line; see [D] by for more details on by.

Description

xtdolshm fits a model of depvar on indepvars using Kao and Chiang (2000) Dynamic Ordinary Least Squares (dols) for Cointegrated Panel Data with homogeneous long-run covariance structure accross cross-sectional units.

Options

+------+ ----+ Main +-------------------------------------------------------------

level(#) sets confidence level; default is level(95).

nlags(integer) indicates the number of lags, default is 2.

nlags(integer) indicates the number of leads, default is 1.

Options for predict

xb, the default, calculates the linear prediction from the long-run coefficients.

dolsres calculates the dols residuals.

Citation

xtdolshm is not an official Stata command. The main program of this command is an adaptation of Kao and Chiang (2002) Gauss corresponding original procedure. It is entirely writing in the new powerful and wonderful Stata matrix programming language Mata. The usual disclimers apply: all errors and imperfections in this package are mine and all comments are very welcome.

Remarks

The package xtdolshm rely on the package ltimbimata. Hence you must install ltimbimata to make xtdolshm work. To install the package ltimbimata from within Stata, please click on: ssc install ltimbimata, replace. Note that you must be connected to Internet for this action to work. The command xtdolshm now works with test, predict, outreg (if installed), outreg2 (if installed) and all Stata commands that allow tabulating estimations results.

Return values

Scalars e(N) Number of observations used e(k1) Number of variables used e(T) Time used e(N_g) Number of included individuals e(r2) R-squared e(r2_a) Adj R-squared e(g_avg) Average number of observations per included individua > l e(g_min) Lowest number of observations in an included individu > al e(g_max) Highest number of observations in an included individ > ual e(nlags) Number of lags e(nleads) Number of leads e(chi2) Wald chi-squared statistic e(chi2_p) p value of Wald statistic

Macros e(cmdline) Command as typed by the user e(cmd) "xtdolshm", command name e(predict) Program used to implement predict e(ivar) Individual (panel) variable e(depvar) Dependent variable e(properties) sets the e(properties) macro

Matrices e(b) Coefficient vector e(V) Variance-covariance matrix e(omega_1_2) The estimated long-run conditional variance

Functions e(sample) Marks estimation sample

Examples

Before beginning the estimations, we use the set more off instruction to tell Stata not to pause when displaying the output.

set more off

We illustrate the use of the command xtdolshm with the dataset xtdolshmdata.dta. This dataset contains panel data of 51 countries from 1975 to 2004.

use http://fmwww.bc.edu/repec/bocode/x/xtdolshmdata.dta, clear

Next we describe the dataset to see the definition of each variable.

describe

We regress iskr (dependent variable) on the regressors (irxmap1 defigd2 ltinflcd opins2 totwdct ltdgdpd). It appears from this estimation that real effective exchange rate (REER) volatility has significant negative effect on investment.

xtdolshm iskr gdskr irxmap1 defigd2 ltinflcd opins2 totwdct ltdgdpd

We show how to use the options nlags() and nleads(). We increase the number of lags to 3 and the number of leads to 4. The regression indicates that REER Volatility is still negatively linked with investment.

xtdolshm iskr gdskr irxmap1 defigd2 ltinflcd opins2 totwdct, nla(3) nle(4)

We estimate the previous equation with a 90% confidence interval.

xtdolshm iskr gdskr irxmap1 defigd2 ltinflcd opins2 totwdct, nla(3) nle(4) level(90)

We illustrate the use of a time series operator by lagging inflation by one period.

xtdolshm iskr gdskr irxmap1 defigd2 l.ltinflcd opins2 totwdct

Now we show how to use the package xtdolshm with the command [D] by. First we tabulate the variable income levels.

tab inclevel

Then we sort the dataset by income levels.

sort inclevel

Finally we use the command xtdolshm with [D] by. We observe that REER volatility continues to be negative and significant in both income categories.

by inclevel: xtdolshm iskr gdskr irxmap1 defigd2 ltinflcd opins2 totwdct ltdgdpd

Let us illustrate how the command xtdolshm works with test. First, we restore the original ordering of the dataset.

tsset

Second, we perform the following regression.

xtdolshm iskr gdskr irxmap1 defigd2 ltinflcd opins2 totwdct

Third, we test that the coefficients on irxmap1 and opins2 are jointly equal to 0.

test (irxmap1=0) (opins2=0)

The result suggests that the coefficients of the two variables are jointly different to 0.

To finish this example section, we now illustrate how to use the command xtdolshm with predict. We start by running the following regression.

xtdolshm iskr gdskr irxmap1 defigd2 ltinflcd opins2 totwdct ltdgdpd

We calculate the linear prediction from the long-run coefficients.

predict linpred, xb

We calculate the dols residuals.

predict dolsresiduals, dolsres

References

Kao, C. and Chiang, M. H.: 2002, "Nonstationary Panel Time Series Using NPT 1.3 - A User Guide," Center for Policy Research, Syracuse University. Downloadable at: http://faculty.maxwell.syr.edu/cdkao/working/npt.html.

Kao, C. and Chiang, M. H.: 2000, "On the estimation and inference of a cointegrated regression in panel data", Advances in Econometrics 15, 179-222. Downloadable at: http://faculty.maxwell.syr.edu/cdkao/working/w.html.

Author

Diallo Ibrahima Amadou, zavren@gmail.com

Also see

Online: help for xtpmg (if installed), xtwest (if installed), xtmg (if installed), mata, ltimbimata