0% found this document useful (0 votes)
197 views

Kao 1999 Pedroni 1999 2004 Westerlund 2005: Xtcointtest - Panel-Data Cointegration Tests

This document provides an overview of the xtcointtest command in Stata, which performs panel-data cointegration tests. It describes the Kao, Pedroni, and Westerlund tests of cointegration that can be performed. All tests have a null hypothesis of no cointegration, while the alternative hypotheses differ between the tests. The document provides examples of how to use the xtcointtest command and explanations of the options that can be specified.

Uploaded by

Saiganesh Ramesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
197 views

Kao 1999 Pedroni 1999 2004 Westerlund 2005: Xtcointtest - Panel-Data Cointegration Tests

This document provides an overview of the xtcointtest command in Stata, which performs panel-data cointegration tests. It describes the Kao, Pedroni, and Westerlund tests of cointegration that can be performed. All tests have a null hypothesis of no cointegration, while the alternative hypotheses differ between the tests. The document provides examples of how to use the xtcointtest command and explanations of the options that can be specified.

Uploaded by

Saiganesh Ramesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Title stata.

com
xtcointtest — Panel-data cointegration tests

Description Quick start Menu Syntax


Options Remarks and examples Stored results Methods and formulas
References Also see

Description
xtcointtest performs the Kao (1999), Pedroni (1999, 2004), and Westerlund (2005) tests of
cointegration on a panel dataset. Panel-specific means (fixed effects) and panel-specific time trends
may be included in the cointegrating regression model.
All tests have a common null hypothesis of no cointegration. The alternative hypothesis of the
Kao tests and the Pedroni tests is that the variables are cointegrated in all panels. In one version of
the Westerlund test, the alternative hypothesis is that the variables are cointegrated in some of the
panels. In another version of the Westerlund test, the alternative hypothesis is that the variables are
cointegrated in all the panels.

Quick start
Kao test of no cointegration between y and x with the alternative hypothesis that they are cointegrated
in all panels using xtset data
xtcointtest kao y x
Pedroni test of no cointegration using a panel-specific autoregressive (AR) term and panel-specific
time trends with the alternative hypothesis of cointegration in all panels
xtcointtest pedroni y x, trend
As above, but use the same AR term in all panels
xtcointtest pedroni y x, trend ar(same)
Westerlund test of no cointegration with the alternative hypothesis that the variables are cointegrated
in some of the panels
xtcointtest westerlund y x
Westerlund test of no cointegration with the alternative hypothesis of cointegration in all panels
xtcointtest westerlund y x, allpanels

Menu
Statistics > Longitudinal/panel data > Cointegrated data > Tests for cointegration

1
2 xtcointtest — Panel-data cointegration tests

Syntax
Kao test
     
xtcointtest kao depvar varlist if in , kao options

Pedroni test
     
xtcointtest pedroni depvar varlist if in , pedroni options

Westerlund test
     
xtcointtest westerlund depvar varlist if in , westerlund options

kao options Description


Main
lags(lspec) specify lag structure for augmented Dickey–Fuller regressions
kernel(kspec) specify method to estimate long-run variance
demean subtract cross-sectional means

pedroni options Description


Main
ar(panelspecific | same) specify autoregressive parameter as panel specific or as the same
for all panels; ar(panelspecific) is the default
trend include panel-specific time trends
noconstant suppress panel-specific means
lags(lspec) specify lag structure for augmented Dickey–Fuller regressions
kernel(kspec) specify method to estimate long-run variance
demean subtract cross-sectional means

westerlund options Description


Main
somepanels use alternative hypothesis of cointegration in some panels;
the default
allpanels use alternative hypothesis of cointegration in all panels
trend include panel-specific time trends
demean subtract cross-sectional means

collect is allowed with all xtcointtest tests; see [U] 11.1.10 Prefix commands.
xtcointtest — Panel-data cointegration tests 3

lspec is
# number of lags of series; 1 is the default
aic # Akaike information criterion (AIC) with up to # lags
bic # Bayesian information criterion (BIC) with up to # lags
hqic # Hannan–Quinn information criterion (HQIC) with up to # lags

kspec is
bartlett nwest Bartlett kernel with Newey–West lags; the default
bartlett # Bartlett kernel with up to # lags
parzen nwest Parzen kernel with Newey–West lags
parzen # Parzen kernel with up to # lags
quadraticspectral nwest quadratic spectral kernel with Newey–West lags
quadraticspectral # quadratic spectral kernel with up to # lags

Options
Options are presented under the following headings:
Options for xtcointtest kao
Options for xtcointtest pedroni
Options for xtcointtest westerlund

Options for xtcointtest kao



 Main
lags(lspec) specifies the lag structure to use for the augmented Dickey–Fuller (ADF) regressions
performed in computing the test statistic.
lags(#) specifies that # lags of the series be used in the ADF regressions. # must be a nonnegative
integer. The default is lags(1).
lags(aic | bic | hqic #) specifies that xtcointtest fit ADF regressions with 1 to # lags and
choose the number of lags for which the AIC, BIC, or HQIC is minimized.
kernel(kspec) specifies the method used to estimate the long-run variance of each panel’s series.
You may specify the kernel type and either #, the maximum number of lags as a positive integer,
or nwest, the maximum number of lags selected by the bandwidth-selection algorithm given in
Newey and West (1994). The kernel type may be bartlett, parzen, or quadraticspectral.
The default is kernel(bartlett nwest).
demean specifies that xtcointtest first subtract the cross-sectional averages from the series. When
specified, for each time period xtcointtest computes the mean of the series across panels and
subtracts this mean from the series. Levin, Lin, and Chu (2002) suggest this procedure to mitigate
the impact of cross-sectional dependence.
4 xtcointtest — Panel-data cointegration tests

Options for xtcointtest pedroni



 Main
ar(panelspecific | same) specifies whether the AR parameter for ADF or Phillips–Perron (PP)
regressions is panel specific or the same across panels.
ar(panelspecific) specifies that the AR parameter be panel specific in the ADF or PP regressions.
The test statistics obtained from using this option are also known as group-mean statistics or
between-dimension statistics. This is the default.
ar(same) specifies that the AR parameter be the same for all panels in the ADF or PP regressions.
The test statistics obtained from using this option are also known as panel cointegration statistics
or within-dimension statistics.
trend includes panel-specific linear time trends in the model for the dependent variable on the
covariates.
noconstant suppresses the panel-specific means in the model for the dependent variable on the
covariates. Specifying noconstant imposes the assumption that the series has a mean of zero for
all panels. This option may not be specified with trend.
lags(lspec) specifies the lag structure to use for the ADF regressions performed in computing the test
statistic. See the description of lags() under Options for xtcointtest kao for additional details.
kernel(kspec) specifies the method used to estimate the long-run variance of each panel’s series.
See the description of kernel() under Options for xtcointtest kao for additional details.
demean specifies that xtcointtest first subtract the cross-sectional averages from the series. See
the description of demean under Options for xtcointtest kao for additional details.

Options for xtcointtest westerlund



 Main
somepanels specifies that the test statistic for panel cointegration be computed using the alternative
hypothesis that some of the panels are cointegrated. This statistic is also known as the group-
mean variance-ratio (VR) statistic. This option uses a regression in which the AR parameter for
Dickey–Fuller (DF) regressions is panel specific. This is the default.
allpanels specifies that the test statistic for panel cointegration be computed using the alternative
hypothesis that all the panels are cointegrated, also known as the panel VR statistic. This option
also implies that the AR parameter for DF regressions is the same for all panels.
trend includes panel-specific linear time trends in the model for dependent variable on the covariates.
demean specifies that xtcointtest first subtract the cross-sectional averages from the series. See
the description of demean under Options for xtcointtest kao for additional details.

Remarks and examples stata.com


Remarks are presented under the following headings:
Overview
Test details
Kao tests
Pedroni tests
Westerlund tests
xtcointtest — Panel-data cointegration tests 5

Overview
A stationary process has a time-invariant mean and a time-invariant variance. By contrast, a
nonstationary process has a time-varying mean, a time-varying variance, or both. A nonstationary
process may wander arbitrarily over time because its first two moments vary over time.
When the first difference of a nonstationary process is stationary, the process is said to be integrated
of order one, denoted I(1). When a linear combination of several I(1) series is stationary, the series
are said to be cointegrated (Engle and Granger 1987). We test for cointegration because cointegration
implies that the I(1) series are in a long-run equilibrium; they move together, although the group of
them can wander arbitrarily.
For example, income and consumption are I(1) series that wander over time. According to
economic theory, income determines consumption in the long run. In practice, time-series data on
income and consumption typically have periods where the series seem to wander in isolation, which
is contrary to the theory. However, when we look at the overall trend, the two series are close to one
another, implying a long-run relation. A test of cointegration provides evidence that indeed there is
(or is not) a long-run relation between these series even if they tend to deviate temporarily.
xtcointtest implements tests of cointegration in panel data, which have many observations
on each of many individual units. This type of sample is known as large-N-large-T-panel data.
The popular Engle–Granger residual-based test for cointegration has low power when applied to a
single time series but has good power when statistics from many individual panels are combined.
The Kao tests, the Pedroni tests, and the Westerlund tests implemented in xtcointtest combine
statistics computed for each individual in the panel, thereby producing a test with higher power.
Furthermore, the limiting distribution of the combined test converges to a standard normal distribution
after appropriate standardization, whereas tests for cointegration based on a single time series have
nonstandard distributions.
All the tests in xtcointtest are based on the following panel-data model for the I(1) dependent
variable yit , where i = 1, . . . , N denotes the panel (individual) and t = 1, . . . , Ti denotes time:

yit = x0it βi + z0it γi + eit (1)

For each panel i, each of the covariates in xit is an I(1) series. All the tests require that the covariates
are not cointegrated among themselves. The Pedroni and Westerlund tests allow a maximum of seven
covariates in xit . βi denotes the cointegrating vector, which may vary across panels. γi is a vector
of coefficients on zit , the deterministic terms that control for panel-specific effects and linear time
trends. eit is the error term.
Depending on the options specified with xtcointtest, the vector zit allows for panel-specific
means, panel-specific means and panel-specific time trends, or nothing. By default, zit = 1, so the
term z0it γi represents panel-specific means (fixed effects). If trend is specified, z0it = (1, t) so z0it γi
represents panel-specific means and panel-specific linear time trends. For tests that allow it, specifying
noconstant omits the z0it γi term.
The tests share a common null hypothesis that yit and xit are not cointegrated. xtcointtest
tests for no cointegration by testing that et is nonstationary. Rejection of the null hypothesis implies
that eit is stationary and that the series yit and xit are cointegrated. The alternative hypothesis of the
Kao tests, the Pedroni tests, and the allpanels version of the Westerlund test is that the variables are
cointegrated in all panels. The alternative hypothesis of the somepanels version of the Westerlund
test is that the variables are cointegrated in some of the panels.
All tests allow unbalanced panels and require that N is large enough that the distribution of a
sample average of panel-level statistics converges to its population distribution. They also require that
each Ti is large enough to run time-series regressions using observations only from that panel. These
6 xtcointtest — Panel-data cointegration tests

tests have nominal coverage only when both T and N are large. The smallest combinations of T and
N for which the tests have close to nominal coverage and decent power differs by test and varies
with the degree of serial correlation in the residuals. See Test details for more information. All the
tests require that there be no gaps in any panel’s series.

Test details
The Kao, Pedroni, and Westerlund tests implement different types of tests for whether eit
is nonstationary. The DF t tests, ADF t tests, PP t tests, and their variants that are reported by
xtcointtest kao and xtcointtest pedroni use different regression frameworks to handle serial
correlation in eit . The VR tests that are reported by xtcointtest westerlund and xtcointtest
pedroni do not require modeling or accommodating for serial correlation; see Westerlund (2005).
All variants of the DF t test statistics are constructed by fitting the model in (1) using ordinary
least squares, obtaining the predicted residuals (ebit ), and then fitting the DF regression model

ebit = ρb
ei,t−1 + νit (2)

where ρ is the AR parameter and νit is a stationary error term. The DF t and the unadjusted DF t
test whether the coefficient ρ is 1. By contrast, the modified DF t and the unadjusted modified DF t
test whether ρ − 1 = 0. Nonstationarity under the null hypothesis causes a test of whether ρ = 1 to
differ from a test of whether ρ − 1 = 0; see Dickey and Fuller (1979) and Kao (1999).
The variants of the PP t test statistics are also constructed by fitting the model in (1) using ordinary
least squares and obtaining the predicted residuals (ebit ). For the PP t tests, we then fit the DF regression
model

ebit = ρi ebi,t−1 + νit (3)

In this case, we have a panel-specific AR parameter ρi . The PP t tests whether the ρi s are 1, whereas
the modified PP t tests whether ρi − 1 = 0. The PP t test statistic is nonparametrically adjusted
for serial correlation in the residuals using the Newey and West (1987) heteroskedasticity- and
autocorrelation-consistent (HAC) covariance matrix estimator.
The DF t, the modified DF t, the PP t, the modified PP t, and the modified VR tests are derived by
specifying a data-generating process for the dependent variable and the regressors. This specification
allows the regressors to be endogenous as well as serially correlated. Therefore, constructing the test
statistics requires estimating the contemporaneous and dynamic covariances between the regressors
and the dependent variable. The unadjusted DF t and the unadjusted modified DF t assume absence of
serial correlation and strictly exogenous covariates and do not require any adjustments in the residuals.
Like the DF and PP tests, the ADF t tests that ρ = 1. However, the ADF test uses additional lags of
the residuals to control for serial correlation instead of the Newey–West nonparametric adjustments.
The ADF regression is
p
X

ebit = ρi ebi,t−1 + ρij ∆b
ei,t−j + νit
j=1

where ∆b ei,t−j is the j th lag of the first difference of ebit and j = 1, . . . , p is where p is the number
of lag differences.
The VR tests are based on Phillips and Ouliaris (1990) and Breitung (2002), where the test statistic
is constructed as a ratio of variances. These tests do not require modeling or accommodating serial
correlation; see Westerlund (2005). VR tests also test for no cointegration by testing for the presence
xtcointtest — Panel-data cointegration tests 7

of a unit root in the residuals. However, they do so using the ratio of variances of the predicted
residuals. The modified VR test removes estimated conditional variances prior to computing the VR.
For further details, see Methods and formulas.
These tests get good coverage and power properties by combining panel-level statistics computed
from a time-series regression using only the observations in that panel. Kao (1999) finds that his tests
have nearly nominal size when T = 100 and N = 300. Pedroni (2004) finds that his tests have nearly
nominal size when T = 250 and N = 60. Westerlund (2005) limited his simulations to datasets with
T = 150, and he did not find a combination of T and N in which his tests had nearly nominal size.
He said that T > 150 should produce better coverage. Each author used a different data-generating
process; see Kao (1999), Pedroni (2004), and Westerlund (2005) for details.

Technical note
The asymptotic distribution of all the test statistics are obtained using sequential limit theory,
denoted as (T, N ) →seq ∞, in which the time dimension goes to infinity followed by the number
of panels going to infinity. See Phillips and Moon (2000) for an introduction to asymptotic theory
that depend on both N and T and their relation to nonstationary panels. Phillips and Moon (1999)
contains a more technical discussion of “multi-indexed” asymptotic theory.

Kao tests
The tests derived in Kao (1999) assume a cointegrating vector that is the same across all panels,
which restricts βi = β in (1). Kao tests estimate panel-specific means and do not allow a time trend,
so z from (1) is always a vector of 1s for Kao tests. This yields the cointegrating relationship
yit = γi + x0it β + eit
where γi denotes panel-specific means (fixed effects). The null hypothesis of the Kao test is that
there is no cointegration among the series. The alternative hypothesis is that the series in all panels
are cointegrated with the same cointegrating vector.
xtcointtest kao reports the modified DF t, DF t, ADF t, unadjusted modified DF t, and unadjusted
DF t statistics. They are constructed using the estimated ρ from DF and ADF regressions; see Test
details. The test statistics differ in how they formulate the hypothesis and in how they control for
serial correlation in eit . See Test details for an overview of the differences in the test statistics and
see Kao tests in Methods and formulas for further discussion.

Example 1: Kao tests assuming a constant cointegrating vector


We are interested in the long-run effect of domestic research and development (R&D) and foreign
R&D on an economy’s productivity. The fictitious dataset, xtcoint.dta, is a balanced panel on
100 countries observed from 1973q3 to 2010q4. It contains quarterly data on the log of produc-
tivity (productivity), log of domestic R&D capital stock (rddomestic), and log of foreign R&D
(rdforeign).
The cointegrating relationship is specified as
productivityit = γi + β1 rddomesticit + β2 rdforeignit + eit
where γi is the panel-specific mean and the cointegrating parameters, β1 and β2 , are the same across
panels. We assume that each series is I(1). A formal test for the presence of a unit root in panel
data may be performed using xtunitroot. We perform the Kao test of cointegration by typing
8 xtcointtest — Panel-data cointegration tests

. use https://www.stata-press.com/data/r17/xtcoint
(Fictitious cointegration data)
. xtcointtest kao productivity rddomestic rdforeign
Kao test for cointegration

H0: No cointegration Number of panels = 100


Ha: All panels are cointegrated Number of periods = 148
Cointegrating vector: Same
Panel means: Included Kernel: Bartlett
Time trend: Not included Lags: 3.60 (Newey--West)
AR parameter: Same Augmented lags: 1

Statistic p-value

Modified Dickey--Fuller t -23.6733 0.0000


Dickey--Fuller t -15.1293 0.0000
Augmented Dickey--Fuller t -3.6909 0.0001
Unadjusted modified Dickey--Fuller t -46.7561 0.0000
Unadjusted Dickey--Fuller t -20.2521 0.0000

We used a model with panel-specific means and no time trend, as reported in the header. The AR
parameter that determines the presence or lack of cointegration is assumed to be the same for all
panels and is thus labeled as Same in the header.
By default, xtcointtest kao uses a Bartlett kernel with Newey and West (1994) automatic lag
selection algorithm. In this example, the algorithm chose an average of 3.6 lags across all panels to
correct for serial correlation. To choose different kernels and the number of lags, specify the kernel()
option. The ADF t statistic also includes lagged differences of the dependent variable to control for
serial correlation. The number of lags is reported in Augmented lags. By default, xtcointtest
kao uses the first lag. To include more lags, specify the lags() option.
The output reports the values of all test statistics with their respective p-values. All test statistics
reject the null hypothesis of no cointegration in favor of the alternative hypothesis of the existence
of a cointegrating relation among productivity, rddomestic, and rdforeign. The modified DF
t, the DF t, and the ADF t test statistics are adjusted for serial correlation using the HAC estimator;
see Methods and formulas.

Pedroni tests
The tests derived by Pedroni (1999, 2004) allow for panel-specific cointegrating vectors. This
heterogeneity distinguishes Pedroni tests from those derived by Kao. Another difference is that the
Pedroni tests allow the AR coefficient (ρi ) to vary over panels as in (3), while the Kao tests assumed
the same AR coefficient. These panel-specific AR coefficients are the default in the Pedroni tests, but
the ar(same) option restricts the AR coefficients (ρi = ρ) to be the same over panels.
Pedroni (1999, 2004) refers to the tests based on panel-specific AR parameters as “between-
dimension tests” and refers to the tests based on the same AR parameters as “within-dimension
tests”.
See Test details and Methods and formulas for further discussion of the specific tests.
xtcointtest — Panel-data cointegration tests 9

Example 2: Pedroni cointegration test with panel-specific AR parameter


Continuing with example 1, we perform the Pedroni test of cointegration between productivity,
rddomestic, and rdforeign, assuming panel-specific cointegrating vectors and autoregressive
parameters. The cointegrating relationship is specified as
productivityit = γi + β1i rddomesticit + β2i rdforeignit + eit
where β1i and β2i represent panel-specific cointegration parameters.
. xtcointtest pedroni productivity rddomestic rdforeign
Pedroni test for cointegration

H0: No cointegration Number of panels = 100


Ha: All panels are cointegrated Number of periods = 149
Cointegrating vector: Panel specific
Panel means: Included Kernel: Bartlett
Time trend: Not included Lags: 4.00 (Newey--West)
AR parameter: Panel specific Augmented lags: 1

Statistic p-value

Modified Phillips--Perron t -26.1145 0.0000


Phillips--Perron t -21.2436 0.0000
Augmented Dickey--Fuller t -25.3701 0.0000

All the test statistics reject the null hypothesis of no cointegration in favor of the alternative
hypothesis that productivity, rddomestic, and rdforeign are cointegrated in all panels with a
panel-specific cointegrating vector.
The model underlying the reported statistics includes panel-specific means and panel-specific AR
parameters and does not include a time trend. All three statistics used a Bartlett kernel with four
lags, as selected by the Newey–West methods, to adjust for serial correlation. The ADF test used a
regression with only one additional lag.

Example 3: Pedroni cointegration test with a common AR parameter


The alternative hypothesis in example 2 allows for panel-specific AR parameters. In this example,
we use the ar(same) option to specify an alternative hypothesis that assumes the same AR parameter
across all panels.
. xtcointtest pedroni productivity rddomestic rdforeign, ar(same)
Pedroni test for cointegration

H0: No cointegration Number of panels = 100


Ha: All panels are cointegrated Number of periods = 149
Cointegrating vector: Panel specific
Panel means: Included Kernel: Bartlett
Time trend: Not included Lags: 4.00 (Newey--West)
AR parameter: Same Augmented lags: 1

Statistic p-value

Modified variance ratio 14.8852 0.0000


Modified Phillips--Perron t -23.0042 0.0000
Phillips--Perron t -17.6735 0.0000
Augmented Dickey--Fuller t -21.1119 0.0000
10 xtcointtest — Panel-data cointegration tests

All test statistics reject the null hypothesis of no cointegration in favor of the alternative hypothesis
of cointegration between productivity, rddomestic, and rdforeign.
The header reports Same for the AR parameter, reminding us that we are now using an alternative
hypothesis that assumes a constant ρ for all panels.

Westerlund tests
Westerlund (2005) derived a pair of VR test statistics for the null hypothesis of no cointegration.
The default test uses a model in which the AR parameter is panel specific and for which the alternative
hypothesis is that the series in some of the panels are cointegrated. Specifying the allpanels option
produces the results for a test in which the alternative hypothesis is that the series in all the panels
are cointegrated, and this test uses a model in which the AR parameter is the same over the panels.
More specifically, the alternative hypothesis using the allpanels option restricts ρi = ρ in (3).
See Test details and Methods and formulas for further discussion of the specific tests.

Example 4: Westerlund test with some panels cointegrated under the alternative
Continuing with example 1, we perform the Westerlund test of cointegration between produc-
tivity, rddomestic, and rdforeign. The cointegrating relationship is specified as

productivityit = γi + β1i rddomesticit + β2i rdforeignit + eit

where β1i and β2i are panel-specific cointegration parameters. We now test the null hypothesis of no
cointegration under the alternative that some of the β1i and β2i produce cointegrated series:
. xtcointtest westerlund productivity rddomestic rdforeign
Westerlund test for cointegration

H0: No cointegration Number of panels = 100


Ha: Some panels are cointegrated Number of periods = 150
Cointegrating vector: Panel specific
Panel means: Included
Time trend: Not included
AR parameter: Panel specific

Statistic p-value

Variance ratio -8.0237 0.0000

The VR test statistic rejects the null hypothesis of no cointegration between productivity,
rddomestic, and rdforeign in favor of the alternative that at least some panels are cointegrated.
The header tells us that the cointegrating vectors vary by panel, that panel-specific means were
included in the model, that no time trend was included in the model, and that the AR parameter varies
by panel.
xtcointtest — Panel-data cointegration tests 11

Example 5: Westerlund test with all panels cointegrated under the alternative
In this example, we use the allpanels option to test the null hypothesis of no cointegration under
the alternative hypothesis that all panels are cointegrated. This test is based on a model in which the
AR parameter is the same over the panels.
. xtcointtest westerlund productivity rddomestic rdforeign, allpanels
Westerlund test for cointegration

H0: No cointegration Number of panels = 100


Ha: All panels are cointegrated Number of periods = 150
Cointegrating vector: Panel specific
Panel means: Included
Time trend: Not included
AR parameter: Same

Statistic p-value

Variance ratio -5.9709 0.0000

The VR statistic rejects the null hypothesis of no cointegration. This implies all panels are
cointegrated.

Stored results
xtcointtest kao stores the following in r():
Scalars
r(N) number of observations
r(N g) number of groups
r(N t) number of time periods
r(hac lagm) average lags used in HAC variance estimator
r(adf lags) lags used in ADF regressions
Macros
r(test) kao
r(hac kernel) kernel used in HAC variance estimator
r(hac method) HAC lag-selection algorithm
r(adf method) ADF regression lag-selection criterion
r(demean) demean, if the data were demeaned
r(deterministics) constant
Matrices
r(stats) Kao test statistics
r(p) p-values

xtcointtest pedroni stores the following in r():


Scalars
r(N) number of observations
r(N g) number of groups
r(N t) number of time periods
r(hac lagm) average lags used in HAC variance estimator
r(adf lags) lags used in ADF regressions
Macros
r(test) pedroni
r(hac kernel) kernel used in HAC variance estimator
r(hac method) HAC lag-selection algorithm
12 xtcointtest — Panel-data cointegration tests

r(adf method) ADF regression lag-selection criterion


r(demean) demean, if the data were demeaned
r(deterministics) noconstant, constant, or trend
Matrices
r(stats) Pedroni test statistics
r(p) p-values

xtcointtest westerlund stores the following in r():


Scalars
r(N) number of observations
r(N g) number of groups
r(N t) number of time periods
r(stat) Westerlund test statistic
r(p) p-value
Macros
r(test) westerlund
r(demean) demean, if the data were demeaned
r(deterministics) constant or trend

Methods and formulas


Methods and formulas are presented under the following headings:
Overview
Kao tests
Pedroni tests
Westerlund tests
Long-run variance

Overview
Consider the panel-data model

yit = x0it βi + z0it γi + eit (4)

where i = 1, . . . , N denotes the panel and t = 1, . . . , Ti denotes time. For each i, yit is a nonstationary
dependent variable for which the first difference is stationary, which is to say that yit is integrated of
order 1—denoted I(1)—for each panel. Similarly, xit is a k × 1 vector of I(1) variables. βi denotes
the cointegrating vector that may vary across panels. zit contains terms to control for panel-specific
effects and or panel-specific time trends. γi denotes the coefficients on the deterministic terms such
as panel-specific means and panel-specific linear time trends. eit is an error term.
The vector zit allows for panel-specific means, panel-specific means and panel-specific time trends,
or nothing, depending on the options specified to xtcointtest. By default, zit = 1, so the term
z0it γi represents panel-specific means (fixed effects). If trend is specified, then z0it = (1, t), so z0it γi
represents panel-specific means and panel-specific linear time trends. For tests that allow it, specifying
noconstant omits the z0it γi term.
The data-generating process for yit and xit is given by

yit = yi,t−1 + uit


xit = xi,t−1 + it
xtcointtest — Panel-data cointegration tests 13

Let wit = (uit , it )0 denote a (k + 1) × 1 vector process with zero mean and long-run covariance
matrix Ωi . (A long-run covariance matrix is a covariance matrix that accounts for the serial correlation
in the process; see Hall (2005, sec. 3.5) for an introduction.) The long-run matrix can be decomposed
as Ωi = Σi + Γ0i + Γi , where Σi and Γi denote the contemporaneous and autocovariance matrices
for a given panel i. The elements of long-run and contemporaneous matrices Ωi and Σi are given by
 2 
ωu,i Ωu,i
Ωi =
Ω0u,i Ω,i

2
 
σu,i Σu,i
Σi = 0
Σu,i Σ,i

b i and Σ
We obtain consistent estimators Ω b i using Newey and West (1987).

Kao tests
Kao (1999) assumes the same cointegrating vector βi = β in (4) so that all panels share a common
slope coefficient. This implies a common long-run covariance matrix given by Ω = Σ + Γ0 + Γ. The
regression model is
yit = γi + x0it β + eit
where γi denotes panel-specific fixed effects and β is the same cointegrating vector.
Kao (1999) proposes five test statistics. The DF t, the modified DF t, the unadjusted DF t, and the
unadjusted modified DF t are based on the DF regression

ebit = ρb
ei,t−1 + νit
where ρ is the common AR parameter of the estimated residuals.
The test statistics based on DF regressions are

tρ + 6N b σν
2b
ων
DF t = r
ων2 σ2
3b
+ ν2
b
σν2
2b 10b
ων
√ √
3 N b σν2
ρ − 1) +
N T (b
ων2
Modified DF t =
b
r
σ4
36b
3 + 4ν
5b
ων

bν2 and ω
where ρb is the estimated value of ρ. σ bν2 are scalar terms that are consistent estimates of
2 2 0 2 2 0
σν = σu −Σu Σ Σu and ων = ωu − Ωu Ω Ωu . tρ is the t statistic for testing the null hypothesis
H0 : ρ = 1.
The DF test statistics that assume strict exogeneity and absence of serial correlation are given by
r r
5tρ 15N
Unadjusted DF t = +
4 8
√ √
ρ − 1) + 3 N
N T (b
Unadjusted modified DF t = p
51/5
14 xtcointtest — Panel-data cointegration tests

The ADF regression is given by


p
X

ebit = ρb
ei,t−1 + ρj ∆b
ei,t−j + νit (5)
j=1

where p is the number of lagged difference terms.


The test statistic based on ADF regression is

tADF + 6N b σν
2b
ων
ADF t = r
ων2 σ2
3b
+ ν2
b
σν2
2b 10b
ων

where
ρb
tADF =
b (b
SE ρ)
is computed from the ADF regression.
The asymptotic distribution of all test statistics converge to N (0, 1).

Pedroni tests
Pedroni (1999) assumes a panel-specific cointegrating vector as in (4), where all panels have
individual slope coefficients. The panel cointegration tests are obtained by testing for a unit root in
the estimated residuals using the ADF regression in (5) but allowing panel-specific ρi instead of ρ or
using the PP regressions given in Pedroni (1999).
Pedroni (1999, 2004) derives test statistics based on a model in which the AR parameter either is
panel-specific or is the same over the panels. Pedroni (1999, 2004) calls the panel-specific-AR test
statistics “group-mean statistics” and the same-AR test statistics “panel cointegration statistics”.
The panel-specific-AR test statistics are

N T
!−1 T
X X X
Modified PP t = T N −1/2 eb2i,t−1 (b ei,t − λ
ei,t−1 ∆b bi )
i=1 t=1 t=1
N T
!−1/2 T
X X X
PP t = N −1/2 bi2
σ eb2i,t−1 (b ei,t − λ
ei,t−1 ∆b bi )
i=1 t=1 t=1
N T
!−1/2 T
X X X
−1/2
ADF t=N sb∗2
i eb2i,t−1 ebi,t−1 ∆b
ei,t
i=1 t=1 t=1

where ebit are the residuals from the panel-data regression model in (4). We calculate

bi = 1 (b
λ σ 2 − sb2i )
2 i
where sb2i and σ
bi2 are the individual contemporaneous and long-run variances of the residuals from
the DF regression in (3). sb∗2
i is the individual contemporaneous variance of the residuals from the
ADF regression in (5) but with panel-specific ρi instead of ρ.
xtcointtest — Panel-data cointegration tests 15

The same-AR test statistics are

N X
T
!−1
X
Modified VR = T N 2 3/2 b −2 eb2i,t−1
L 11i
i=1 t=1
N X
T
!−1 N X
T
√ X X
Modified PP t = T N b −2 eb2
L b −2 (b
L ei,t − λ
11i ei,t−1 ∆b
bi )
11i i,t−1
i=1 t=1 i=1 t=1
N X
T
!−1/2 N X
T
X X
t= σ 2 b −2 eb2i,t−1
L b −2 (b
L ei,t − λ
11i ei,t−1 ∆b
PP eN,T bi )
11i
i=1 t=1 i=1 t=1
T
N X
!−1/2 N X
T
X X
ADF t= se∗2
N,T
b −2 eb2i,t−1
L b −2 ebi,t−1 ∆b
L ei,t
11i 11i
i=1 t=1 i=1 t=1

where the residuals are as defined above and where

N
2 1 X b −2 2
σ
eN,T = L σ
N i=1 11i i
b

L
b 11i = ω 2
bu,i −Ω
b u,i Ω b 0u,i
b ,i Ω

and

N
1 X ∗2
se∗2
N,T = sb
N i=1 i

The asymptotic distribution of all test statistics, after appropriate standardization, converges to
N (0, 1). The adjustment is given by √
χ−µ N

ν
where χ is any of the test statistics given above, and the parameters µ and ν are the mean and
variance of the test statistic obtained through simulation. Refer to Pedroni (1999) for details and an
algorithm to obtain the predicted residuals. The adjusted statistics are reported in the output.

Westerlund tests
Westerlund (2005) assumes panel-specific cointegrating vectors as in (4), where all panels have
individual slope coefficients. The VR test statistics are obtained by testing for a unit root in the
predicted residuals using the DF regression in (3).
Westerlund (2005) derives test statistics based on a model in which the AR parameter either is
panel-specific or is the same over the panels.
The panel-specific-AR test statistic is used to test the null hypothesis of no cointegration against
the alternative hypothesis that some panels are cointegrated. The same-AR test statistic is used to
test the null hypothesis of no cointegration against the alternative hypothesis that all the panels are
cointegrated.
16 xtcointtest — Panel-data cointegration tests

The panel-specific-AR test statistic is given by

N X
X T
VR = b2 R
E b−1
it i
i=1 t=1

The same-AR test statistic is given by

N X
T N
!−1
X X
2
VR = E
bit R
bi
i=1 t=1 i=1

where E bit = Pt ebij , Rbi = PT eb2 , and ebit are the residuals from the panel-data regression model
j=1 t=1 it
in (4). The asymptotic distribution of all test statistics, after appropriate standardization, converges to
N (0, 1).

Long-run variance
We use the Newey and West (1987) estimator to consistently estimate the long-run variance matrix
Ωi , given by

T m T
bi = 1 1X
X X
0 0 0
Ω w
b it w
b it + K(j, m) (w
b it w
b it +w
b i,t−j w
b it )
T t=1
T j=1 t=j+1

where m is the maximum number of lags and K(j, m) is the kernel weight function. Define
z = j/(m + 1). If kernel is bartlett, then

1−z 0≤z≤1
n
K(j, m) =
0 otherwise

If kspec is parzen, then

1 − 6z 2 + 6z 3 0 ≤ z ≤ 0.5
(
K(j, m) = 2(1 − z)3 0.5 < z ≤ 1
0 otherwise

If kernel is quadraticspectral, then



1 z=0
K(j, m) =
3{sin(θ)/θ − cos(θ)}/θ2 otherwise

where θ = 6πz/5. If we request automatic bandwidth (lag) selection using the Newey–West algorithm,
then the method documented in Methods and formulas of [R] ivregress with zi = h = 1 is used.
xtcointtest — Panel-data cointegration tests 17

References
Breitung, J. 2002. Nonparametric tests for unit roots and cointegration. Journal of Econometrics 108: 343–363.
https://doi.org/10.1016/S0304-4076(01)00139-7.
Dickey, D. A., and W. A. Fuller. 1979. Distribution of the estimators for autoregressive time series with a unit root.
Journal of the American Statistical Association 74: 427–431. https://doi.org/10.2307/2286348.
Ditzen, J. 2018. Estimating dynamic common-correlated effects in Stata. Stata Journal 18: 585–617.
Engle, R. F., and C. W. J. Granger. 1987. Co-integration and error correction: Representation, estimation, and testing.
Econometrica 55: 251–276. https://doi.org/10.2307/1913236.
Hall, A. R. 2005. Generalized Method of Moments. Oxford: Oxford University Press.
Herwartz, H., S. Maxand, F. H. C. Raters, and Y. M. Walle. 2018. Panel unit-root tests for heteroskedastic panels.
Stata Journal 18: 184–196.
Kao, C. 1999. Spurious regression and residual-based tests for cointegration in panel data. Journal of Econometrics
90: 1–44. https://doi.org/10.1016/S0304-4076(98)00023-2.
Levin, A., C.-F. Lin, and C.-S. J. Chu. 2002. Unit root tests in panel data: Asymptotic and finite-sample properties.
Journal of Econometrics 108: 1–24. https://doi.org/10.1016/S0304-4076(01)00098-7.
Newey, W. K., and K. D. West. 1987. A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent
covariance matrix. Econometrica 55: 703–708. https://doi.org/10.2307/1913610.
. 1994. Automatic lag selection in covariance matrix estimation. Review of Economic Studies 61: 631–653.
https://doi.org/10.2307/2297912.
Pedroni, P. 1999. Critical values for cointegration tests in heterogeneous panels with multiple regressors. Oxford
Bulletin of Economics and Statistics 61: 653–670.
. 2004. Panel cointegration: Asymptotic and finite sample properties of pooled time series tests with an application
to the PPP hypothesis. Econometric Theory 20: 597–625. https://doi.org/10.1017/S0266466604203073.
Phillips, P. C. B., and H. R. Moon. 1999. Linear regression limit theory for nonstationary panel data. Econometrica
67: 1057–1111. https://doi.org/10.1111/1468-0262.00070.
. 2000. Nonstationary panel data analysis: An overview of some recent developments. Econometric Reviews 19:
263–286. https://doi.org/10.1080/07474930008800473.
Phillips, P. C. B., and S. Ouliaris. 1990. Asymptotic properties of residual based tests for cointegration. Econometrica
58: 165–193. https://doi.org/10.2307/2938339.
Westerlund, J. 2005. New simple tests for panel cointegration. Econometric Reviews 24: 297–316.
https://doi.org/10.1080/07474930500243019.
Wursten, J. 2018. Testing for serial correlation in fixed-effects panel models. Stata Journal 18: 76–100.

Also see
[XT] xtunitroot — Panel-data unit-root tests
[TS] dfgls — DF-GLS unit-root test
[TS] dfuller — Augmented Dickey–Fuller unit-root test
[TS] pperron — Phillips–Perron unit-root test

You might also like