Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Description
The Time-Series Reference Manual organizes the commands alphabetically, making it easy to find
individual command entries if you know the name of the command. This overview organizes and
presents the commands conceptually, that is, according to the similarities in the functions that they
perform.
The commands listed under the heading Data-management tools and time-series operators help
you prepare your data for further analysis. The commands listed under the heading Univariate time
series are grouped together because they are either estimators or filters designed for univariate time
series or preestimation or postestimation commands that are conceptually related to one or more
univariate time-series estimators. The commands listed under the heading Multivariate time series
are similarly grouped together because they are either estimators designed for use with multivariate time
series or preestimation or postestimation commands conceptually related to one or more multivariate
time-series estimators. Within these three broad categories, similar commands have been grouped
together.
3
4 time series — Introduction to time-series commands
Estimators
arima ARIMA, ARMAX, and other dynamic regression models
arima postestimation Postestimation tools for arima
arch Autoregressive conditional heteroskedasticity (ARCH) family of
estimators
arch postestimation Postestimation tools for arch
newey Regression with Newey–West standard errors
newey postestimation Postestimation tools for newey
prais Prais–Winsten and Cochrane–Orcutt regression
prais postestimation Postestimation tools for prais
Diagnostic tools
corrgram Tabulate and graph autocorrelations
xcorr Cross-correlogram for bivariate time series
cumsp Cumulative spectral distribution
pergram Periodogram
dfgls DF-GLS unit-root test
dfuller Augmented Dickey–Fuller unit-root test
pperron Phillips–Perron unit-root test
estat dwatson Durbin–Watson d statistic
estat durbinalt Durbin’s alternative test for serial correlation
estat bgodfrey Breusch–Godfrey test for higher-order serial correlation
estat archlm Engle’s LM test for the presence of autoregressive conditional
heteroskedasticity
wntestb Bartlett’s periodogram-based test for white noise
wntestq Portmanteau (Q) test for white noise
time series — Introduction to time-series commands 5
Estimators
dfactor Dynamic-factor models
dfactor postestimation Postestimation tools for dfactor
dvech Diagonal vech multivariate GARCH models
dvech postestimation Postestimation tools for dvech
sspace State-space models
sspace postestimation Postestimation tools for sspace
var Vector autoregressive models
var postestimation Postestimation tools for var
svar Structural vector autoregressive models
svar postestimation Postestimation tools for svar
varbasic Fit a simple VAR and graph IRFs or FEVDs
varbasic postestimation Postestimation tools for varbasic
vec Vector error-correction models
vec postestimation Postestimation tools for vec
Diagnostic tools
varlmar Perform LM test for residual autocorrelation after var or svar
varnorm Test for normally distributed disturbances after var or svar
varsoc Obtain lag-order selection statistics for VARs and VECMs
varstable Check the stability condition of VAR or SVAR estimates
varwle Obtain Wald lag-exclusion statistics after var or svar
veclmar Perform LM test for residual autocorrelation after vec
vecnorm Test for normally distributed disturbances after vec
vecrank Estimate the cointegrating rank of a VECM
vecstable Check the stability condition of VECM estimates
Remarks
Remarks are presented under the following headings:
Data-management tools and time-series operators
Univariate time series
Estimators
Time-series smoothers and filters
Diagnostic tools
Multivariate time series
Estimators
Diagnostic tools
Diagnostic tools
Stata’s time-series commands also include several preestimation and postestimation diagnostic
commands. corrgram estimates the autocorrelation function and partial autocorrelation function of
a univariate time series, as well as Q statistics. These functions and statistics are often used to
determine the appropriate model specification before fitting ARIMA models. corrgram can also be
used with wntestb and wntestq to examine the residuals after fitting a model for evidence of model
misspecification. Stata’s time-series commands also include the commands pergram and cumsp,
which provide the log-standardized periodogram and the cumulative-sample spectral distribution,
respectively, for time-series analysts who prefer to estimate in the frequency domain rather than the
time domain.
8 time series — Introduction to time-series commands
xcorr estimates the cross-correlogram for bivariate time series and can similarly be used both
for preestimation and postestimation. For example, the cross-correlogram can be used before fitting
a transfer-function model to produce initial estimates of the IRF. This estimate can then be used to
determine the optimal lag length of the input series to include in the model specification. It can
also be used as a postestimation tool after fitting a transfer function. The cross-correlogram between
the residual from a transfer-function model and the prewhitened input series of the model can be
examined for evidence of model misspecification.
When you fit ARMA or ARIMA models, the dependent variable being modeled must be covariance
stationary (ARMA models), or the order of integration must be known (ARIMA models). Stata has three
commands that can test for the presence of a unit root in a time-series variable: dfuller performs
the augmented Dickey–Fuller test, pperron performs the Phillips–Perron test, and dfgls performs
a modified Dickey–Fuller test.
The remaining diagnostic tools for univariate time series are for use after fitting a linear model via
OLS with Stata’s regress command. They are documented collectively in [R] regress postestimation
time series. They include estat dwatson, estat durbinalt, estat bgodfrey, and estat
archlm. estat dwatson computes the Durbin–Watson d statistic to test for the presence of first-
order autocorrelation in the OLS residuals. estat durbinalt likewise tests for the presence of
autocorrelation in the residuals. By comparison, however, Durbin’s alternative test is more general
and easier to use than the Durbin–Watson test. With estat durbinalt, you can test for higher
orders of autocorrelation, the assumption that the covariates in the model are strictly exogenous is
relaxed, and there is no need to consult tables to compute rejection regions, as you must with the
Durbin–Watson test. estat bgodfrey computes the Breusch–Godfrey test for autocorrelation in the
residuals, and although the computations are different, the test in estat bgodfrey is asymptotically
equivalent to the test in estat durbinalt. Finally, estat archlm performs Engle’s LM test for the
presence of autoregressive conditional heteroskedasticity.
Estimators
Stata provides commands for fitting the most widely applied multivariate time-series models. var
and svar fit vector autoregressive and structural vector autoregressive models to stationary data.
vec fits cointegrating vector error-correction models. dfactor fits dynamic-factor models. dvech fits
diagonal vech multivariate GARCH models. sspace fits state-space models. Many linear time-series
models, including vector autoregressive moving average (VARMA) models and structural time-series
models, can be cast as state-space models and fit by sspace.
Diagnostic tools
Before fitting a multivariate time-series model, you must specify the number of lags to include.
varsoc produces statistics for determining the order of a VAR or VECM.
Several postestimation commands perform the most common specification analysis on a previously
fitted VAR or SVAR. You can use varlmar to check for serial correlation in the residuals, varnorm
to test the null hypothesis that the disturbances come from a multivariate normal distribution, and
varstable to see if the fitted VAR or SVAR is stable. Two common types of inference about VAR
models are whether one variable Granger-causes another and whether a set of lags can be excluded
from the model. vargranger reports Wald tests of Granger causation, and varwle reports Wald lag
exclusion tests.
time series — Introduction to time-series commands 9
Similarly, several postestimation commands perform the most common specification analysis on a
previously fitted VECM. You can use veclmar to check for serial correlation in the residuals, vecnorm
to test the null hypothesis that the disturbances come from a multivariate normal distribution, and
vecstable to analyze the stability of the previously fitted VECM.
VARs and VECMs are often fit to produce baseline forecasts. fcast produces dynamic forecasts
from previously fitted VARs and VECMs.
Many researchers fit VARs, SVARs, and VECMs because they want to analyze how unexpected
shocks affect the dynamic paths of the variables. Stata has a suite of irf commands for estimating
IRF functions and interpreting, presenting, and managing these estimates; see [TS] irf.
References
Baum, C. F. 2005. Stata: The language of choice for time-series analysis? Stata Journal 5: 46–63.
Hamilton, J. D. 1994. Time Series Analysis. Princeton: Princeton University Press.
Lütkepohl, H. 1993. Introduction to Multiple Time Series Analysis. 2nd ed. New York: Springer.
. 2005. New Introduction to Multiple Time Series Analysis. New York: Springer.
Pisati, M. 2001. sg162: Tools for spatial data analysis. Stata Technical Bulletin 60: 21–37. Reprinted in Stata Technical
Bulletin Reprints, vol. 10, pp. 277–298. College Station, TX: Stata Press.
Stock, J. H., and M. W. Watson. 2001. Vector autoregressions. Journal of Economic Perspectives 15: 101–115.
Also see
[U] 1.3 What’s new
[R] intro — Introduction to base reference manual