help xtcse2 v. 1.03 - February 2023

Title

xtcse2 - estimating the exponent of cross-sectional dependence in large panels.

Syntax

xtcse2 [varlist] [if] [,
pca(integer)
standardize
nocenter
nocd
RESsidual
Reps(integer)
size(real)
tuning(real)
lags(integer)
]

Data has to be xtset before using xtcse2; see tsset.
varlist may contain time-series operators, see tsvarlist.
If varlist if left empty, xtcse2 predicts residuals from the
last estimation command,
see predict.
xtcse2 uses an expectation–maximization (EM) algorithm
to impute missing values if the panel is unbalanced.

Contents

Description

Options

Econometric Model and Estimation

Saved Values

Examples

References

About

Description

xtcse2 estimates the exponent of cross-sectional dependence in a panel
with a large number of observations over time (T) and cross-sectional units (N).
The estimation method follows Bailey, Kapetanios, Pesaran (2016,2019) (henceforth BKP).

A variable or a residual is cross-sectional dependent if it inhibits an
across cross-sectional units common factor.

xtcse2 estimates the strength of the factor, for a residual or
one or more variables.
It outputs a standard error and confidence interval in the usual estimation output fashion,
however it does not show a t or z statistic and p-value. Generally speaking strong cross-sectional
dependence occurs if alpha is above 0.5.
Testing this is done by a separate test of weak cross-sectional dependence.
Therefore a confidence interval is more informative when estimating alpha.

xtcse2 is intend to support the decision whether to include cross-sectional averages when using
xtdcce2 and accompanies xtcd2 in testing for weak cross-sectional dependence.
As a default it uses xtcd2 to test for weak cross-sectional dependence.
For a discussion of xtdcce2 and xtcd2 see Ditzen (2018,2019).

In case of unbalanced panels an Expected Maximisation algorithm taken from
xtnumfac is used.
xtcd2 imputes values independently from xtcse2 and therefore results can differ.

Options

pca(integer) sets the number of principle components for the
calculation of cn. Default is to use the first 4 components.

standardize standardizes variables.

nocenter do not center variables.

nocd suppresses test for cross-sectional dependence using xtcd2.

size(real) size of the test. Default is 10% (0.1).

RESsidual estimates the exponent of cross-sectional depdendence
in residuals, following BKP 2019.

tuning(real) tuning parameter for estimation of the exponent in residuals.
Default is 0.5.

Reps(integer) number of repetitions for bootstrap for calculation of
standard error and confidence interval for exponent in residuals. Default is 0.

lags(integer) number of lags (or training period) for calculation of
recursive residuals when estimating the exponent after a regression with weakly exogenous regressors.

Econometric Model and Estimation of the Exponent

Econometric Model

For the following assume a general factor model with m factors:

x(i,t) = sum(j=1,m) b(j,i) f(j,t) + u(i,t)
i = 1,...,N and t = 1,...,T

where x(i,t) depends on unobserved m common factors f(j,t) with loading
b(j,i) and a cross sectionally independent error term u(i,t).
The time dimension (T) and the number of cross-sectional units (N) increases to infinity;
(N,T) -> infinity.

Chudik et al (2011) specify the factors as weak or strong using a constant 0<=alpha<=1 such that:

lim N^(-alpha) sum(j=1,m) abs(b(j,i)) = K < infinity.

The type of dependence of the factors and thus the series then depends on
the characteristics of b(j,i):

alpha dependence

alpha = 0 weak
0 < alpha < 0.5 semi weak
0.5 <= alpha < 1 semi strong
alpha = 1 strong

Weak cross-sectional dependence can be thought of as the following: Even if
the number of cross-sectional units increases to infinity, the sum of the effect of the
common factors on the dependent variable remain constant. In the case of strong
cross-sectional dependence, the sum of the effect of the common factors becomes
stronger with an increase in the number of cross-sectional units.

In an estimation ignoring (semi-) strong dependence in the dependent or
independent variables can cause an omitted
variable bias and therefore lead to inconsistent estimates.
Pesaran (2015) proposes a test to test for weak cross-sectional dependence,
see xtcd2.
Pesaran (2006) and Chudik, Peasaran (2015) develop a method to estimate models
with cross-sectional dependence by adding time averages of the dependent and
independent variables (cross-sectional averages).
This estimator is implemented in Stata by xtdcce2.

xtcse2 estimates alpha in the equation above.
An alpha above 0.5 implies strong cross-sectional dependence
and the appropriate when using a variable is required.

Exponent Estimation (alpha)

Bailey, Kapetanios and Pesaran (2016) [BKP] propose a method
for the estimation of the exponent. This section summarizes their approach,
a careful reading of the assumptions and theorems is strongly encouraged.

BKP derive a bias-adjusted estimator for alpha in a panel with
N_g cross-sectional units (see Eq. 13):

alpha = 1 + 1/2 ln(sigma_x^2)/ln(N_g) - 1/2 ln(mu^2)/ln(N_g) - 1/2 cn / [N_g * ln(N_g) * sigma_x^2]

where sigma_x^2 is the variance of the cross-sectional averages.
mu^2 is average variance of significant regression coefficients of x(i,t) on
standardized cross-sectional averages with a pre specified size of the test.
cn is the variance of scaled errors from a regression of the x(i,t) on
its first K(PC) principle components.
The number of principle components can be set using the option
pca(integer). The default is to use the first 4 principle components.

xtcse2 outputs a standard error for alpha and a confidence interval in the
usual Stata estimation fashion.
A t- or z-test statistic with p-value is however omitted, because the test is done by the
test for weak cross-sectional dependence (CD-test), see xtcd2.
xtcse2 automatically calculates the CD-test statistic and posts its results.
For the estimation of alpha a confidence interval is therefore more informative.

The calculation of the standard error of alpha follows the equation B47, Section VI of
the online appendix of BKP, available
here:

sigma(alpha) = [1/T V(q) + 4/N^(alpha) S]^(1/2) * 1/2 * 1/ln(N)

V(q) is the regression standard error over the square of the sum of
q coefficients of an AR(q) process of the square of the deviation of standardized
cross-sectional averages. q is the third root of T. S is the squared sum divided by
N^(alpha-1) of OLS coefficients of x(it) on standardized cross-sectional averages
sorted according to their absolute value.

In the case of estimating the exponent of cross-sectional dependence in residuals
Bailey, Kapetanios and Pesaran (2019) propose to use pair-wise correlations to estimate
the exponent. For the calculation, only significant correlations are taken into account.
The exponent is estiamted according to (Eq 25 in BKP 2019):

alpha = ln(tau' delta tau) / [2 ln(N)]

where tau is a Nx1 vector of ones and delta is a matrix which contains
the significant pair-wise correlations.
For the significance, the size of the test and a tuning parameter need to be
set a priori.
xtcse2 uses a size of 10% and a tuning parameter of 0.5 as a default.
Both can be changed with the options size() and tuning().

In the case of a panel with weakly exogenous regressors, the pair-wise correlations
are based on recursive residuals, see BKP 2019, section 5.2.
xtcse2 allows for this if the option lags() is used.

BKP 2019 do not derive a closed form solution for standard errors.
Therefore standard errors and confidence intervals are calculated using a simple bootstrap,
where the cross-sectional units are replaced with replacement. This approach is
outlined in BKP 2019 section 5.3.

Saved Values

xtcse2 stores the following in r():

Matrices
r(alpha) matrix with estimated alphas
r(alphaSE) matrix with estimated standard errors of alphas
r(alphas) matrix with estimated alpha tilde, alpha hat and alpha
r(N_g) matrix with number of cross-sectional units
r(T) matrix with number of time periods
r(CD) matrix with values of CD test statistic (if requested)
r(CDp) matrix values of p value of CD test statistic (if requested)

Examples

An example dataset of the Penn World Tables 8 is available for download here.
The dataset contains yearly observations from 1960 until 2007 and is already tsset.
To estimate a growth equation the following variables are used:
log_rgdpo (real GDP), log_hc (human capital), log_ck (physical capital) and log_ngd (population growth + break even investments of 5%).

Before running the growth regression the exponent of the cross-sectional
dependence for the variables is estimated:

xtcse2 d.log_rgdpo L.log_rgdpo log_hc log_ck log_ngd.

All variables are highly cross-sectional dependent with alphas close or even
above 1. Therefore an
estimation method taking cross-sectional dependence is required.
xtdcce2 is uses such an estimation method by adding cross-sectional averages
to the model. After running xtdcce2 it is possible to use xtcse2 to estimate
the strength of the exponent of the residual using the option residuals.

xtdcce2 log_rgdpo L.log_rgdpo log_ck log_ngd log_hc , cr(log_rgdpo log_ck log_ngd log_hc).

xtcse2, res

xtcse2 automatically predicts the residuals using predict
(predict after xtdcce2).
The CD statistic is still in a rejection region, therefore the residuals
exhibit strong cross-sectional dependence.

The estimated model above is mis-specified as it is a dynamic model, but no lags
of the cross-sectional averages are added. The number of lags should be in the
region of T^(1/3), so with 47 periods 3 lags are added. Then xtcse2 is used
to estimate alpha again, this time the CD test is omitted:

xtdcce2 log_rgdpo L.log_rgdpo log_ck log_ngd log_hc , cr(log_rgdpo log_ck log_ngd log_hc) cr_lags(3).

xtcse2 ,nocd residual lags(3) reps(200)

The value of the CD test statistic is 1.32 and in a non-rejection region.
The estimate of alpha is considerably small the confidence interval does not
overlap with 0.5

As a second exercise the first row of Table 1. in BKP is reproduced.
The data is available on Pesaran's
webpage
and for download here.

After the data is loaded, reshaped (it comes in a matrix) and renamed as variable gdp,
the option standardize is used to standardize the variable as done in BKP:

xtcse2 gdp , standardize.

References

Bailey, N., G. Kapetanios and M. H. Pesaran. 2016.
Exponent of cross-sectional dependence: estimation and inference.
Journal of Applied Econometrics 31: 929-960.

Bailey, N., G. Kapetanios and M. H. Pesaran. 2019.
Exponent of Cross-sectional Dependence for Residuals.
Sankhya B. The Indian Journal of Statistics: 81(4) p. 46-102.

Chudik, A., M. H. Pesaran and E. Tosetti. 2011.
Weak and strong cross-section dependence and estimation of large panels.
The Econometrics Journal 14(1):C45–C90.

Chudik, A., and M. H. Pesaran. 2015.
Common correlated effects estimation of heterogeneous dynamic panel data models with weakly exogenous regressors.
Journal of Econometrics 188(2): 393-420.

Ditzen, J. 2018. Estimating Dynamic Common Correlated Effcts in Stata. The Stata Journal, 18:3, 585 - 617.

Ditzen, J. 2019. Estimating long run effects in models with cross-sectional dependence using xtdcce2.
CEERP Working Paper Series: 7.

Pesaran, M. H. 2006.
Estimation and inference in large heterogeneous panels with a multifactor error structure.
Econometrica 74(4): 967-1012.

Pesaran, M. H. 2015.
Testing Weak Cross-Sectional Dependence in Large Panels.
Econometric Reviews 34(6-10):1089–1117.

Author

Jan Ditzen (Free University of Bozen-Bolzano)

Email: jan.ditzen@unibz.it

Web: www.jan.ditzen.net

I am grateful to Sean Holly for the suggestion to implement the test
to xtdcce2 and xtcd2 and Hashem Pesaran and Natalia Bailey for their
help.
Part of the code is taken from BKP and transferred from Gauss to Stata.
The original Gauss code is available on Pesaran's
webpage
and for download here.
All remaining errors are my own.

In the fashion of xtdcce2 and xtcd2 xtcse2 has a 2 as a suffix.
There is no such program called xtcsee.

Small discrepancies to BKP 2018 and 2019 can arise due to different programs
Stata vs. Gauss.

Please cite as follows:

Ditzen, J. 2019. xtcse2: Estimating Exponent of Cross-Sectional Dependence in large panels.

The latest versions can be obtained as a part of xtdcce2 via net from https://github.com/JanDitzen/xtdcce2
.

Changelog

Version 1.3 - May 2023

- nocenter affects xtcd2 as well

Version 1.2 - 11. January 2021

- added support for residuals

- bug fixed

- added option nocenter

- added xtbalance2 to balance paneldataset

Also see

See also: xtdcce2, xtcd2, xtbalance2