# Introduction to Time Series Using Stata

Introduction to Time Series Using Stata, by Sean Becketti, provides a practical guide to working with time-series data using Stata and will appeal to a broad range of users. The many examples, concise explanations that focus on intuition, and useful tips based on the author’s decades of experience using time-series methods make the book insightful not just for academic users but also for practitioners in industry and government.

The book is appropriate both for new Stata users and for experienced users who are new to time-series analysis.

Chapter 1 provides a mild yet fast-paced introduction to Stata, highlighting all the features a user needs to know to get started using Stata for time-series analysis. Chapter 2 is a quick refresher on regression and hypothesis testing, and it defines key concepts such as white noise, autocorrelation, and lag operators.

Chapter 3 begins the discussion of time series, using moving-average and Holt–Winters techniques to smooth and forecast the data. Becketti also introduces the concepts of trends, cyclicality, and seasonality and shows how they can be extracted from a series. Chapter 4 focuses on using these methods for forecasting and illustrates how the assumptions regarding trends and cycles underlying the various moving-average and Holt–Winters techniques affect the forecasts produced. Although these techniques are sometimes neglected in other time-series books, they are easy to implement, can be applied to many series quickly, often produce forecasts just as good as more complicated techniques, and as Becketti emphasizes, have the distinct advantage of being easily explained to colleagues and policy makers without backgrounds in statistics.

Chapters 5 through 8 encompass single-equation time-series models. Chapter 5 focuses on regression analysis in the presence of autocorrelated disturbances and details various approaches that can be used when all the regressors are strictly exogenous but the errors are autocorrelated, when the set of regressors includes a lagged dependent variable and independent errors, and when the set of regressors includes a lagged dependent variable and autocorrelated errors. Chapter 6 describes the ARIMA model and Box–Jenkins methodology, and chapter 7 applies those techniques to develop an ARIMA-based model of U.S. GDP. Chapter 7 in particular will appeal to practitioners because it goes step by step through a real-world example: here is my series, now how do I fit an ARIMA model to it? Chapter 8 is a self-contained summary of ARCH/GARCH modeling.

In the final portion of the book, Becketti discusses multiple-equation models, particularly VARs and VECs. Chapter 9 focuses on VAR models and illustrates all key concepts, including model specification, Granger causality, impulse-response analyses, and forecasting, using a simple model of the U.S. economy; structural VAR models are illustrated by imposing a Taylor rule on interest rates. Chapter 10 presents nonstationary time-series analysis. After describing nonstationarity and unit-root tests, Becketti masterfully navigates the reader through the often-confusing task of specifying a VEC model, using an example based on construction wages in Washington, DC, and surrounding states. Chapter 11 concludes.

Sean Becketti is a financial industry veteran with three decades of experience in academics, government, and private industry. He was a developer of Stata in its infancy, and he was Editor of the Stata Technical Bulletin, the precursor to the Stata Journal, between 1993 and 1996. He has been a regular Stata user since its inception, and he wrote many of the first time-series commands in Stata.

Introduction to Time Series Using Stata, by Sean Becketti, is a first-rate, example-based guide to time-series analysis and forecasting using Stata. It can serve as both a reference for practitioners and a supplemental textbook for students in applied statistics courses.

List of tables
List of figures
Preface
Acknowledgments

1. JUST ENOUGH STATA

Getting started

Action first, explanation later
Now some explanation
Navigating the interface
The gestalt of Stata

The parts of Stata speech

Looking at data
Statistics

Basics
Estimation

Odds and ends
Making a date

How to look good
Transformers

Typing dates and date variables

2. JUST ENOUGH STATISTICS

Random variables and their moments
Hypothesis tests
Linear regression

Ordinary least squares
Instrumental variables
FGLS

Multiple-equation models
Time series

White noise, autocorrelation, and stationarity
ARMA models

3. FILTERING TIME-SERIES DATA

Preparing to analyze a time series

Questions for all types of data

How are the variables defined?
What is the relationship between the data and the phenomenon of interest?
Who compiled the data?
What processes generated the data?

Questions specifically for time-series data

What is the frequency of measurement?
Are the data seasonally adjusted?
Are the data revised?

The four components of a time series

Trend
Cycle
Seasonal

Some simple filters

Smoothing a trend
Smoothing a cycle
Smoothing a seasonal pattern
Smoothing real data

ma: Weighted moving averages
EWMAs

exponential: EWMAs
dexponential: Double-exponential moving averages

Holt–Winters smoothers

hwinters: Holt–Winters smoothers without a seasonal component
shwinters: Holt–Winters smoothers including a seasonal component

Points to remember

4. A FIRST PASS AT FORECASTING

Forecast fundamentals

Types of forecasts
Measuring the quality of a forecast
Elements of a forecast

Filters that forecast

Forecasts based on EWMAs
Forecasting a trending series with a seasonal component

Points to remember

5. AUTOCORRELATED DISTURBANCES

Autocorrelation

Example: Mortgage rates

Regression models with autocorrelated disturbances

First-order autocorrelation
Example: Mortgage rates (cont.)

Testing for autocorrelation

Other tests

Estimation with first-order autocorrelated data

Model 1: Strictly exogenous regressors and autocorrelated disturbances

The OLS strategy
The transformation strategy
The FGLS strategy
Comparison of estimates of model

Model 2: A lagged dependent variable and i.i.d. errors
Model 3: A lagged dependent variable with AR(1) errors

The transformation strategy
The IV strategy

Estimating the mortgage rate equation
Points to remember

6. UNIVARIATE TIME-SERIES MODELS

The general linear process
Lag polynomials: Notation or prestidigitation?
The ARMA model
Stationarity and invertibility
What can ARMA models do?
Points to remember

7. MODELING A REAL-WORLD TIME SERIES

Getting ready to model a time series
The Box–Jenkins approach
Specifying an ARMA model

Step 1: Induce stationarity (ARMA becomes ARIMA)
Step 2: Mind your p’s and q’s

Estimation
Looking for trouble: Model diagnostic checking

Overfitting
Tests of the residuals

Forecasting with ARIMA models
Comparing forecasts
Points to remember
What have we learned so far?

8. TIME-VARYING VOLATILITY

Examples of time-varying volatility
ARCH: A model of time-varying volatility
Extensions to the ARCH model

GARCH: Limiting the order of the model
Other extensions

Asymmetric responses to “news”
Variations in volatility affect the mean of the observable series
Nonnormal errors
Odds and ends

Points to remember

9. MODELS OF MULTIPLE TIME SERIES

Vector autoregressions

Three types of VARs

A VAR of the U.S. macroeconomy

Using Stata to estimate a reduced-form VAR

Testing a VAR for stationarity

Other tests

Forecasting

Evaluating a VAR forecast

Who’s on first?

Cross correlations
Summarizing temporal relationships in a VAR

Granger causality
How to impose order
FEVDs
Using Stata to calculate IRFs and FEVDs

SVARs

Examples of a short-run SVAR
Examples of a long-run SVAR

Points to remember

10. MODELS OF NONSTATIONARY TIME SERIES

Trends and unit roots
Testing for unit roots
Cointegration: Looking for a long-term relationship
Cointegrating relationships and VECMs

Deterministic components in the VECM

From intuition to VECM: An example

Step 1: Confirm the unit root
Step 2: Identify the number of lags
Step 3: Identify the number of cointegrating relationships
Step 4: Fit a VECM
Step 5: Test for stability and white-noise residuals
Step 6: Review the model implications for reasonableness

Points to remember

11. CLOSING OBSERVATIONS

Making sense of it all
What did we miss?

Additional Stata time-series features

Data management tools and utilities
Univariate models
Multivariate models

Farewell

Author: Sean Becketti
ISBN-13: 978-1-59718-132-7