Stata 15 help for xtpcse

[XT] xtpcse -- Linear regression with panel-corrected standard errors


xtpcse depvar [indepvars] [if] [in] [weight] [, options]

options Description ------------------------------------------------------------------------- Model noconstant suppress constant term correlation(independent) use independent autocorrelation structure correlation(ar1) use AR1 autocorrelation structure correlation(psar1) use panel-specific AR1 autocorrelation structure rhotype(calc) specify method to compute autocorrelation parameter; seldom used np1 weight panel-specific autocorrelations by panel sizes hetonly assume panel-level heteroskedastic errors independent assume independent errors across panels

by/if/in casewise include only observations with complete cases pairwise include all available observations with nonmissing pairs

SE nmk normalize standard errors by N-k instead of N

Reporting level(#) set confidence level; default is level(95) detail report list of gaps in time series display_options control columns and column formats, row spacing, line width, display of omitted variables and base and empty cells, and factor-variable labeling

coeflegend display legend instead of statistics ------------------------------------------------------------------------- A panel variable and a time variable must be 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. iweights and aweights are allowed; see weight. coeflegend does not appear in the dialog box. See [XT] xtpcse postestimation for features available after estimation.


Statistics > Longitudinal/panel data > Contemporaneous correlation > Regression with panel-corrected standard errors (PCSE)


xtpcse calculates panel-corrected standard error (PCSE) estimates for linear cross-sectional time-series models where the parameters are estimated by either OLS or Prais-Winsten regression. When computing the standard errors and the variance-covariance estimates, xtpcse assumes that the disturbances are, by default, heteroskedastic and contemporaneously correlated across panels.

See [XT] xtgls for the generalized least-squares estimator for these models.


+-------+ ----+ Model +------------------------------------------------------------

noconstant; see [R] estimation options.

correlation(corr) specifies the form of assumed autocorrelation within panels.

correlation(independent), the default, specifies that there is no autocorrelation.

correlation(ar1) specifies that, within panels, there is first-order autocorrelation AR(1) and that the coefficient of the AR(1) process is common to all the panels.

correlation(psar1) specifies that, within panels, there is first-order autocorrelation and that the coefficient of the AR(1) process is specific to each panel. psar1 stands for panel-specific AR(1).

rhotype(calc) specifies the method to be used to calculate the autocorrelation parameter. Allowed strings for calc are

regress regression using lags; the default freg regression using leads tscorr time-series autocorrelation calculation dw Durbin-Watson calculation

All the above methods are consistent and asymptotically equivalent; this is a rarely used option.

np1 specifies that the panel-specific autocorrelations be weighted by T_i rather than by the default T_i-1 when estimating a common rho for all panels, where T_i is the number of observations in panel i. This option has an effect only when panels are unbalanced and the correlation(ar1) option is specified.

hetonly and independent specify alternative forms for the assumed covariance of the disturbances across the panels. If neither is specified, the disturbances are assumed to be heteroskedastic (each panel has its own variance) and contemporaneously correlated across the panels (each pair of panels has its own covariance). This is the standard PCSE model.

hetonly specifies that the disturbances are assumed to be panel-level heteroskedastic only with no contemporaneous correlation across panels.

independent specifies that the disturbances are assumed to be independent across panels; that is, there is one disturbance variance common to all observations.

+----------+ ----+ by/if/in +---------------------------------------------------------

casewise and pairwise specify how missing observations in unbalanced panels are to be treated when estimating the interpanel covariance matrix of the disturbances. The default is casewise selection.

casewise specifies that the entire covariance matrix be computed only on the observations (periods) that are available for all panels. If an observation has missing data, all observations of that period are excluded when estimating the covariance matrix of disturbances. Specifying casewise ensures that the estimated covariance matrix will be of full rank and will be positive definite.

pairwise specifies that, for each element in the covariance matrix, all available observations (periods) that are common to the two panels contributing to the covariance be used to compute the covariance.

The casewise and pairwise options have an effect only when the panels are unbalanced and neither hetonly nor independent is specified.

+----+ ----+ SE +---------------------------------------------------------------

nmk specifies that standard errors be 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 (2018, 313) remarks that whether a degree-of-freedom correction improves the small-sample properties is an open question.

+-----------+ ----+ Reporting +--------------------------------------------------------

level(#); see [R] estimation options.

detail specifies that a detailed list of any gaps in the series be reported.

display_options: noci, nopvalues, noomitted, vsquish, noemptycells, baselevels, allbaselevels, nofvlabel, fvwrap(#), fvwrapon(style), cformat(%fmt), pformat(%fmt), sformat(%fmt), and nolstretch; see [R] estimation options.

The following option is available with xtpcse but is not shown in the dialog box:

coeflegend; see [R] estimation options.


Setup . webuse grunfeld . xtset company year, yearly

Fit linear regression with panel-corrected standard errors, assuming no autocorrelation within panels . xtpcse invest mvalue kstock

Specify first-order autocorrelation within panels . xtpcse invest mvalue kstock, correlation(ar1)

Specify panel-specific first-order autocorrelation; use time-series method to estimate autocorrelation parameters . xtpcse invest mvalue kstock, correlation(psar1) rhotype(tscorr)

Specify first-order autocorrelation within panels; allow panel-level disturbances to be heteroskedastic but not contemporaneously correlated . xtpcse invest mvalue kstock, correlation(ar1) hetonly

Stored results

xtpcse stores the following in e():

Scalars e(N) number of observations e(N_g) number of groups e(N_gaps) number of gaps e(n_cf) number of estimated coefficients e(n_cv) number of estimated covariances e(n_cr) number of estimated correlations e(n_sigma) observations used to estimate elements of Sigma e(mss) model sum of squares e(df) degrees of freedom e(df_m) model degrees of freedom e(rss) residual sum of squares e(g_min) smallest group size e(g_avg) average group size e(g_max) largest group size e(r2) R-squared e(chi2) chi-squared e(p) p-value for model test e(rmse) root mean squared error e(rank) rank of e(V) e(rc) return code

Macros e(cmd) xtpcse e(cmdline) command as typed e(depvar) name of dependent variable e(ivar) variable denoting groups e(tvar) variable denoting time within groups e(wtype) weight type e(wexp) weight expression e(title) title in estimation output e(panels) contemporaneous covariance structure e(corr) correlation structure e(rhotype) type of estimated correlation e(rho) rho e(cons) noconstant or "" e(missmeth) casewise or pairwise e(balance) balanced or unbalanced e(chi2type) Wald; type of model chi-squared test e(vcetype) title used to label Std. Err. e(properties) b V e(predict) program used to implement predict e(marginsok) predictions allowed by margins e(marginsnotok) predictions disallowed by margins 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(rhomat) vector of autocorrelation parameter estimates e(V) variance-covariance matrix of the estimators

Functions e(sample) marks estimation sample


Greene, W. H. 2018. Econometric Analysis. 8th ed. New York: Pearson.

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index