Stata 15 help for prais

[TS] prais -- Prais-Winsten and Cochrane-Orcutt regression


prais depvar [indepvars] [if] [in] [, options]

options Description ------------------------------------------------------------------------- Model rhotype(regress) base rho on single-lag OLS of residuals; the default rhotype(freg) base rho on single-lead OLS of residuals rhotype(tscorr) base rho on autocorrelation of residuals rhotype(dw) base rho on autocorrelation based on Durbin-Watson rhotype(theil) base rho on adjusted autocorrelation rhotype(nagar) base rho on adjusted Durbin-Watson corc use Cochrane-Orcutt transformation ssesearch search for rho that minimizes SSE twostep stop after the first iteration noconstant suppress constant term hascons has user-defined constant savespace conserve memory during estimation

SE/Robust vce(vcetype) vcetype may be ols, robust, cluster clustvar, hc2, or hc3

Reporting level(#) set confidence level; default is level(95) nodw do not report the Durbin-Watson statistic display_options control columns and column formats, row spacing, line width, display of omitted variables and base and empty cells, and factor-variable labeling

Optimization optimize_options control the optimization process; seldom used

coeflegend display legend instead of statistics ------------------------------------------------------------------------- You must tsset your data before using prais; see [TS] tsset. indepvars may contain factor variables; see fvvarlist. depvar and indepvars may contain time-series operators; see tsvarlist. by, fp, rolling, and statsby are allowed; see prefix. coeflegend does not appear in the dialog box. See [TS] prais postestimation for features available after estimation.


Statistics > Time series > Prais-Winsten regression


prais uses the generalized least-squares method to estimate the parameters in a linear regression model in which the errors are serially correlated. Specifically, the errors are assumed to follow a first-order autoregressive process.


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

rhotype(rhomethod) selects a specific computation for the autocorrelation parameter rho, where rhomethod can be

regress rho_reg = B from the residual regression e_t = B * e_(t-1) freg rho_freg = B from the residual regression e_t = B * e_(t+1) tscorr rho_tscorr = e'e_(t-1)/e'e, where e is the vector of residuals dw rho_dw = 1 - dw/2, where dw is the Durbin-Watson d statistic theil rho_theil = rho_tscorr * (N - k)/N nagar rho_nagar = (rho_dw * N^2 + k^2)/(N^2 - k^2)

The prais estimator can use any consistent estimate of rho to transform the equation, and each of these estimates meets that requirement. The default is regress, which produces the minimum sum-of-squares solution (ssesearch option) for the Cochrane-Orcutt transformation -- none of these computations will produce the minimum sum-of-square solution for the full Prais-Winsten transformation. See Judge et al. (1985) for a discussion of each estimate of rho.

corc specifies that the Cochrane-Orcutt transformation be used to estimate the equation. With this option, the Prais-Winsten transformation of the first observation is not performed, and the first observation is dropped when estimating the transformed equation; see Methods and formulas in [TS] prais.

ssesearch specifies that a search be performed for the value of rho that minimizes the sum-of-squared errors of the transformed equation (Cochrane-Orcutt or Prais-Winsten transformation). The search method is a combination of quadratic and modified bisection searches using golden sections.

twostep specifies that prais stop on the first iteration after the equation is transformed by rho -- the two-step efficient estimator. Although iterating these estimators to convergence is customary, they are efficient at each step.

noconstant; see [R] estimation options.

hascons indicates that a user-defined constant, or a set of variables that in linear combination forms a constant, has been included in the regression. For some computational concerns, see the discussion in [R] regress.

savespace specifies that prais attempt to save as much space as possible by retaining only those variables required for estimation. The original data are restored after estimation. This option is rarely used and should be used only if there is insufficient space to fit a model without the option.

+-----------+ ----+ SE/Robust +--------------------------------------------------------

vce(vcetype) specifies the estimator for the variance-covariance matrix of the estimator; see [R] vce_options.

vce(ols), the default, uses the standard variance estimator for ordinary least-squares regression.

vce(robust) specifies to use the Huber/White/sandwich estimator.

vce(cluster clustvar) specifies to use the intragroup correlation estimator.

vce(hc2) and vce(hc3) specify an alternative bias correction for the vce(robust) variance calculation; for more information, see [R] regress. You may specify only one of vce(hc2), vce(hc3), or vce(robust).

All estimates from prais are conditional on the estimated value of rho. Robust variance estimates here are robust only to heteroskedasticity and are not generally robust to misspecification of the functional form or omitted variables. The estimation of the functional form is intertwined with the estimation of rho, and all estimates are conditional on rho. Thus estimates cannot be robust to misspecification of functional form. For these reasons, it is probably best to interpret vce(robust) in the spirit of White's (1980) original paper on estimation of heteroskedastic-consistent covariance matrices.

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

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

nodw suppresses reporting of the Durbin-Watson statistic.

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.

+--------------+ ----+ Optimization +-----------------------------------------------------

optimize_options: iterate(#), [no]log, tolerance(#). iterate() specifies the maximum number of iterations. log/nolog specifies whether to show the iteration log. tolerance() specifies the tolerance for the coefficient vector; tolerance(1e-6) is the default. These options are seldom used.

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

coeflegend; see [R] estimation options.


--------------------------------------------------------------------------- Setup . webuse idle . tsset t

Perform Prais-Winsten AR(1) regression . prais usr idle

Perform Cochrane-Orcutt AR(1) regression . prais usr idle, corc

Same as above, but request robust standard errors . prais usr idle, corc vce(robust)

--------------------------------------------------------------------------- Setup . webuse qsales

Perform Cochrane-Orcutt AR(1) regression and search for rho that minimizes SSE . prais csales isales, corc ssesearch

Replay result with 99% confidence interval . prais, level(99) ---------------------------------------------------------------------------

Stored results

prais stores the following in e():

Scalars e(N) number of observations e(N_gaps) number of gaps e(mss) model sum of squares e(df_m) model degrees of freedom e(rss) residual sum of squares e(df_r) residual degrees of freedom e(r2) R-squared e(r2_a) adjusted R-squared e(F) F statistic e(rmse) root mean squared error e(ll) log likelihood e(N_clust) number of clusters e(rho) autocorrelation parameter rho e(dw) Durbin-Watson d statistic for transformed regression e(dw_0) Durbin-Watson d statistic for untransformed regression e(rank) rank of e(V) e(tol) target tolerance e(max_ic) maximum number of iterations e(ic) number of iterations

Macros e(cmd) prais e(cmdline) command as typed e(depvar) name of dependent variable e(title) title in estimation output e(clustvar) name of cluster variable e(cons) noconstant or not reported e(method) twostep, iterated, or SSE search e(tranmeth) corc or prais e(rhotype) method specified in rhotype() option e(vce) vcetype specified in vce() 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(asbalanced) factor variables fvset as asbalanced e(asobserved) factor variables fvset as asobserved

Matrices e(b) coefficient vector e(V) variance-covariance matrix of the estimators e(V_modelbased) model-based variance

Functions e(sample) estimation sample


Judge, G. G., W. E. Griffiths, R. C. Hill, H. L├╝tkepohl, and T.-C. Lee. 1985. The Theory and Practice of Econometrics. 2nd ed. New York: Wiley.

White, H. 1980. A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroskedasticity. Econometrica 48: 817-838.

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