help xtgls dialog: xtgls
also see: xtgls postestimation
-------------------------------------------------------------------------------
Title
[XT] xtgls -- Fit panel-data models by using GLS
Syntax
xtgls depvar [indepvars] [if] [in] [weight] [, options]
options description
-------------------------------------------------------------------------
Model
noconstant suppress constant term
panels(iid) use i.i.d. error structure
panels(heteroskedastic) use heteroskedastic but uncorrelated error
structure
panels(correlated) use heteroskedastic and correlated error
structure
corr(independent) use independent autocorrelation structure
corr(ar1) use AR1 autocorrelation structure
corr(psar1) use panel-specific AR1 autocorrelation
structure
rhotype(calc) specify method to compute autocorrelation
parameter; see Options for details; seldom
used
igls use iterated GLS estimator instead of two-step
GLS estimator
force estimate even if observations unequally spaced
in time
SE
nmk normalize standard error by N-k instead of N
Reporting
level(#) set confidence level; default is level(95)
display_options control spacing and display of omitted
variables and base and empty cells
Optimization
optimize_options control the optimization process; seldom used
+ coeflegend display coefficients' legend instead of
coefficient table
-------------------------------------------------------------------------
+ coeflegend does not appear in the dialog box.
A panel variable must be specified. For correlation structures other than
independent, a time variable must be specified. A time variable must
also be specified if panels(correlated) is specified. Use xtset.
indepvars may contain factor variables; see fvvarlist.
depvar and indepvars may contain time-series operators; see tsvarlist.
by and statsby are allowed; see prefix.
aweights are allowed; see weight. Weights must be constant within panel.
See [XT] xtgls postestimation for features available after estimation.
Menu
Statistics > Longitudinal/panel data > Contemporaneous correlation > GLS
regression with correlated disturbances
Description
xtgls fits panel-data linear models by using feasible generalized least
squares. This command allows estimation in the presence of AR(1)
autocorrelation within panels and cross-sectional correlation and
heteroskedasticity across panels.
Options
+-------+
----+ Model +------------------------------------------------------------
noconstant; see [R] estimation options.
panels(pdist) specifies the error structure across panels.
panels(iid) specifies a homoskedastic error structure with no
cross-sectional correlation. This is the default.
panels(heteroskedastic) specifies heteroskedastic error structure
with no cross-sectional correlation.
panels(correlated) specifies heteroskedastic error structure with
cross-sectional correlation. If p(c) is specified, you must also
specify a time variable (use xtset). The results will be based on a
generalized inverse of a singular matrix unless T>=m (the number of
periods is greater than or equal to the number of panels).
corr(corr) specifies the assumed autocorrelation within panels.
corr(independent) specifies that there is no autocorrelation. This
is the default.
corr(ar1) specifies that, within panels, there is AR(1)
autocorrelation and that the coefficient of the AR(1) process is
common to all the panels. If c(ar1) is specified, you must also
specify a time variable (use xtset).
corr(psar1) specifies that, within panels, there is AR(1)
autocorrelation and that the coefficient of the AR(1) process is
specific to each panel. psar1 stands for panel-specific AR(1). If
c(psar1) is specified, a time variable must also be specified; use
xtset.
rhotype(calc) specifies the method to be used to calculate the
autocorrelation parameter:
regress regression using lags; the default
dw Durbin-Watson calculation
freg regression using leads
nagar Nagar calculation
theil Theil calculation
tscorr time series autocorrelation calculation
All of the calculations are asymptotically equivalent and consistent;
this is a rarely used option.
igls requests an iterated GLS estimator instead of the two-step GLS
estimator for a nonautocorrelated model or instead of the three-step
GLS estimator for an autocorrelated model. The iterated GLS
estimator converges to the MLE for the corr(independent) models, but
does not for the other corr() models.
force; [R] estimation options.
+----+
----+ SE +---------------------------------------------------------------
nmk specifies that standard errors normalized by N-k, where k is the
number of parameters estimated, rather than N, the number of
observations. Different authors have used one or the other
normalization. Greene remarks that whether a degree-of-freedom
correction improves the small-sample properties is an open question.
+-----------+
----+ Reporting +--------------------------------------------------------
level(#); see [R] estimation options.
display_options: noomitted, vsquish, noemptycells, baselevels,
allbaselevels; see [R] estimation options.
+--------------+
----+ Optimization +-----------------------------------------------------
optimize_options control the iterative optimization process. These
options are seldom used.
iterate(#) specifies the maximum number of iterations. When the
number of iterations equals #, the optimization stops and presents
the current results, even if the convergence tolerance has not been
reached. The default value of iterate() is 100.
tolerance(#) specifies the tolerance for the coefficient vector.
When the relative change in the coefficient vector from one iteration
to the next is less than or equal to #, the optimization process is
stopped. tolerance(1e-6) is the default.
nolog suppress the display of the iteration log.
The following option is available with xtgls but is not shown in the
dialog box:
coeflegend; see [R] estimation options.
Examples
Setup
. webuse invest2
. xtset company time
Fit panel-data model with heteroskedasticity across panels
. xtgls invest market stock, panels(hetero)
Correlation and heteroskedasticity across panels
. xtgls invest market stock, panels(correlated)
Heteroskedasticity across panels and autocorrelation within panels
. xtgls invest market stock, panels(hetero) corr(ar1)
Saved results
xtgls saves the following in e():
Scalars
e(N) number of observations
e(N_g) number of groups
e(N_t) number of time periods
e(N_miss) number of missing observations
e(n_cf) number of estimated coefficients
e(n_cv) number of estimated covariances
e(n_cr) number of estimated correlations
e(df_pear) degrees of freedom for Pearson chi-squared
e(ll) log likelihood
e(chi2) chi-squared
e(df) degrees of freedom
e(g_min) smallest group size
e(g_avg) average group size
e(g_max) largest group size
e(rank) rank of e(V)
e(rc) return code
Macros
e(cmd) xtgls
e(cmdline) command as typed
e(depvar) name of dependent variable
e(ivar) variable denoting groups
e(tvar) variable denoting time
e(coefftype) estimation scheme
e(corr) correlation structure
e(vt) panel option
e(rhotype) type of estimated correlation
e(wtype) weight type
e(wexp) weight expression
e(title) title in estimation output
e(chi2type) Wald; type of model chi-squared test
e(rho) rho
e(properties) b V
e(predict) program used to implement predict
e(asbalanced) factor variables fvset as asbalanced
e(asobserved) factor variables fvset as asobserved
Matrices
e(b) coefficient vector
e(Sigma) Sigma hat matrix
e(V) variance-covariance matrix of the estimators
Functions
e(sample) marks estimation sample
Also see
Manual: [XT] xtgls
Help: [XT] xtgls postestimation;
[XT] xtpcse, [XT] xtreg, [XT] xtregar, [TS] newey, [TS] prais,
[R] regress