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

Title

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

Syntax

xtdolshmdepvarindepvars[if] [in] [,options]

optionsDescription ------------------------------------------------------------------------- MainLevelset confidence level; default islevel(95)nlagsspecify the number of lagsnleadsspecify the number of leads -------------------------------------------------------------------------You must

tssetyour data before usingxtdolshm; seetsset.varlistmay contain time-series operators; see tsvarlist.byis allowed withxtdolshmif no time-series operators are used in the command line; see[D] byfor more details onby.

Description

xtdolshmfits 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 islevel(95).

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

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

Options forpredict

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

dolsrescalculates the dols residuals.

Citation

xtdolshmis 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 languageMata. The usual disclimers apply: all errors and imperfections in this package are mine and all comments are very welcome.

RemarksThe package

xtdolshmrely on the packageltimbimata. Hence you must installltimbimatato makextdolshmwork. To install the packageltimbimatafrom withinStata, please click on: ssc install ltimbimata, replace. Note that you must be connected to Internet for this action to work. The commandxtdolshmnow works withtest,predict,outreg(if installed),outreg2(if installed) and allStatacommands that allow tabulating estimations results.

Return valuesScalars

e(N)Number of observations usede(k1)Number of variables usede(T)Time usede(N_g)Number of included individualse(r2)R-squarede(r2_a)Adj R-squarede(g_avg)Average number of observations per included individua > le(g_min)Lowest number of observations in an included individu > ale(g_max)Highest number of observations in an included individ > uale(nlags)Number of lagse(nleads)Number of leadse(chi2)Wald chi-squared statistice(chi2_p)p value of Wald statisticMacros

e(cmdline)Command as typed by the usere(cmd)"xtdolshm", command namee(predict)Program used to implement predicte(ivar)Individual (panel) variablee(depvar)Dependent variablee(properties)sets the e(properties) macroMatrices

e(b)Coefficient vectore(V)Variance-covariance matrixe(omega_1_2)The estimated long-run conditional varianceFunctions

e(sample)Marks estimation sample

Before beginning the estimations, we use the

set more offinstruction to tellStatanot to pause when displaying the output.set more off

We illustrate the use of the command

xtdolshmwith the datasetxtdolshmdata.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()andnleads(). 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

xtdolshmwith 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

xtdolshmwith[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

xtdolshmworks withtest. 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

xtdolshmwithpredict. 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

ReferencesKao, 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.

AuthorDiallo Ibrahima Amadou, zavren@gmail.com

Also seeOnline: help for

xtpmg(if installed),xtwest(if installed),xtmg(if installed),mata,ltimbimata