*! version 1.0.0 24Feb2016

help xtregcluster

Title

xtregcluster -- Partially heterogeneous linear panel data with fixed effects

Syntax

xtregcluster depvar indepvars [if] [in] [weight], omega(#) initpartition [options]

initpartition

You must specify one of the following methods for obtaining the initial partition:

random obtain the initial partition through
uniform random selection

preclass(varname) obtain the initial partition on the
basis of one categorical variable. omega(#) is not allowed
with preclass(varname) as the levels of varname
determine the size of Omega

prevars(varlist) obtain the initial partition on the basis
of pre-specified variables using the Calinski-Harabasz clustering criterion
from cluster kmeans.
prevars(varlist) takes a specific list of covariates which may
include variables specified in indepvars or not.
Special cases include prevars(X) for using all explanatory variables
as specified in varlist, and prevars(b) for using the individual
specific slopes.

prevarsopt(kmeansopt) can only be specified with prevars(varlist)
and takes all options from cluster kmeans with the sole
exception of k(#) which is already set by the option omega(#).

Description

xtregcluster operationalises the Sarafidis and Weber (2015) estimator for
classifying individuals into clusters with homogeneous slope parameters
and the intra-cluster heterogeneity being attributed to unobserved fixed effects.
The method is available for linear short panel data and is useful for exploring
data in the absence of knowledge about parameter structures. It is also useful
for confirming parameter homogeneity and examining the validity of normatively
imposed classifications.

Options

Method options

* omega(#) omega(#) is required. It specifies the size of Omega > 1.
omega(#) takes integer arguments.

theta(#) specifies the theta given N in the penalty function of the MIC
for overfitting Omega. The default is theta((1/3)*ln(N)+(2/3)*sqrt(N))).
theta() can take any other real argument. Other typical theta include the
value of 2, ln(N) and sqrt(N)

seed(#) sets the random-number seed for the entire program.
The seed is relevant for randomizing the numerical panel identifiers, and for the
random method in obtaining the initial partition. The default is seed(123).

Iteration options

iterate(#) specifies the maximum number of iterations for
minimizing the Total RSS given omega(#). The default is iterate(100)

tolerance(#) specifies the tolerance for the convergence of Total RSS
givenomega(#). The default is tolerance(1e-6)

Reporting options

name(varname) specifies the name for the newly generated variable
that identifies the levels in the optimized partition given Omega. The default
name is omegas#, where # is the number specified in omega(#)

nolog supress RSS iteration log

graph see clustered scatter plots with superimposed linear fits
for every omega

table print a table of estimates for all linear panel data
fixed effects by omega, e.g. xtreg if omega==1, fe for the first omega,
and so on for the rest.

Examples

Setup

. use http://www.stata-press.com/data/r14/productivity.dta

. xtset state year

. global yx gsp private emp hwy water other unemp

Obtaining initial partition using random selection

. xtregcluster $yx, random omega(2/10)

. xtregcluster $yx i.year, random omega(2/10) name(omT)

. xtregcluster $yx, random omega(4) name(om3) seed(456)

Obtaining initial partition using predetermined categorical variables

. xtregcluster $yx, preclass(region)

. tabulate region omega_region, all

Obtaining initial partition using prespecified variation in variables

. xtregcluster $yx, prevars(gsp) omega(2/6) name(om_gsp)

. xtregcluster $yx, prevars(hwy private) omega(2/6) name(omhp)

. xtregcluster $yx, prevars(X) omega(2/8) name(omX)

Obtaining initial partition using prespecified variation in individual slopes

. bysort state: generate Ti = _N

. xtregcluster $yx if Ti>=7, prevars(b) omega(2/6) name(omb)

Stricter penalty for the MIC

. egen tag = tag(state)

. quietly count if tag

. scalar sqrtN = sqrt(r(N))

. xtregcluster $yx, random omega(2/10) name(omega_srict) theta(`=sqrtN')

Reporting and convergence options

. drop omega*

. xtregcluster $yx, random omega(2/5) nolog

. xtregcluster $yx, random omega(2/8) name(omtol) tolerance(0.01) iterate(50)

Saved results

Scalars
e(N) N panels used in estimation
e(T) T or average Ti
e(NT) NT or NTi
e(rss_pool) Pooled RSS
e(mic_pool) Pooled MIC
e(omega) Specified Omega
e(theta) Specified theta
e(rss_tot) Total RSS given Omega
e(mic_tot) Total MIC given Omega

Macros
e(cmdline) Estimator

Matrices
e(rss) Total RSS at every iteration

Functions
e(sample) Marks estimation sample

References

Christodoulou, D. and V. Sarafidis (20XX),
xtcluster: A partially heterogeneous framework for short panel data models,
The Stata Journal, Volume vv, Number ii, pp. xx-xx.

Sarafidis, V. and N. Webber (2015),
A partially heterogeneous framework for analyzing panel data,
Oxford Bulletin of Economics and Statistics, Volume 77, Number 2, pp. 274-296.

Authors

Demetris Christodoulou

MEAFA Research Group

The University of Sydney Business School

Sydney, NSW 2006

Australia

demetris.christodoulou@sydney.edu.au

Vasilis Sarafidis

Department of Econometrics and Business Statistics

Monash University

Melbourne, VIC 3145

Australia

Vasilis.Sarafidis@monash.edu

Acknowledgements

xtregcluster is not an official Stata command, it is a free
contribution to the research community. Please cite the respective
publication in The Stata Journal as provided just above. We acknowledge Karl Keesman's
input in the develoment of the first draft of the program.