You are on page 1of 129

STATA: Data Analysis Software

STATA

Time Series Analysis
www.STATA.org.uk
Step-by Step Screenshot Guides
to help you use STATA
Not affiliated with Stata Corp.

Datasets Used in Tutorial

– Datasets in these tutorials are based on examples in:
Stock and Watson (2006)
“Introduction to Econometrics”
– You can obtain all of the datasets used in these tutorials
by downloading a STATA command file from
http://www.stata.org.uk/download-examples.html

Outline

– Statistical Analysis
• Time Series
– Managing Time Series Data
– Dickey-Fuller Test
– ARIMA
– VAR
– ARCH

Outline – Statistical Analysis • Time Series – Managing Time Series Data » Open Dataset » Set Time Variable » Graph Data » Create Lags » Create Leads » Create Differences .

.

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data » Open Dataset » Set Time Variable » Graph Data » Create Lags » Create Leads » Create Differences .

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data » Open Dataset » Set Time Variable » Graph Data » Create Lags » Create Leads » Create Differences .

.

.

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data » Open Dataset » Set Time Variable » Graph Data » Create Lags » Create Leads » Create Differences .

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data » Open Dataset » Set Time Variable » Graph Data » Create Lags » Create Leads » Create Differences .

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data » Open Dataset » Set Time Variable » Graph Data » Create Lags » Create Leads » Create Differences .

.

.

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data – Dickey-Fuller Test – ARIMA – VAR – ARCH .

Outline – Statistical Analysis • Time Series – Dickey-Fuller Test » DF Test on a variable » DF Test on differenced variable .

.

.

.

Outline – Statistical Analysis • Time Series – Dickey-Fuller Test » DF Test on a variable » DF Test on differenced variable .

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data – Dickey-Fuller Test – ARIMA – VAR – ARCH .

Outline – Statistical Analysis • Time Series – ARIMA » ARIMA Estimation » Partial Correlogram (PAC) » Correlogram (AC) » Info Criteria (AIC and BIC) » Challenge .

.

.

Outline

– Statistical Analysis
• Time Series
– ARIMA
» ARIMA Estimation
» Partial Correlogram (PAC)
» Correlogram (AC)
» Info Criteria (AIC and BIC)
» Challenge

.

.

Outline – Statistical Analysis • Time Series – ARIMA » ARIMA Estimation » Partial Correlogram (PAC) » Correlogram (AC) » Info Criteria (AIC and BIC) » Challenge .

.

.

.

Outline – Statistical Analysis • Time Series – ARIMA » ARIMA Estimation » Partial Correlogram (PAC) » Correlogram (AC) » Info Criteria (AIC and BIC) » Challenge .

.

.

.

.

.

.

.

Outline – Statistical Analysis • Time Series – ARIMA » ARIMA Estimation » Partial Correlogram (PAC) » Correlogram (AC) » Info Criteria (AIC and BIC) » Challenge .

0.2) .2) – Compare to AIC and BIC on ARIMA(2.ARIMA: Challenge Challenge – Estimate ARIMA(2.2) for inflation Method – Use current data – Generate inflation = (punew-L1.punew – Run Dickey-Fuller on inflation – Use PAC and AC graphs – Use AIC and BIC tests on ARIMA(3.punew)/L1.0.0.

.

.

.

.

.

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data – Dickey-Fuller Test – ARIMA – VAR – ARCH .

Outline – Statistical Analysis • Time Series – VAR » Declare Time Variable » VAR Regression (Dinflation vs Unemployment) » Joint Significance Test » VAR Forecast Calculations » VAR Forecast Graphs » Challenge .

.

.

Outline – Statistical Analysis • Time Series – VAR » Declare Time Variable » VAR Regression (Dinflation vs Unemployment) » Joint Significance Test » VAR Forecast Calculations » VAR Forecast Graphs » Challenge .

.

.

.

.

.

.

.

.

Outline – Statistical Analysis • Time Series – VAR » Declare Time Variable » VAR Regression (Dinflation vs Unemployment) » Joint Significance Test » VAR Forecast Calculations » VAR Forecast Graphs » Challenge .

.

.

.

Outline – Statistical Analysis • Time Series – VAR » Declare Time Variable » VAR Regression (Dinflation vs Unemployment) » Joint Significance Test » VAR Forecast Calculations » VAR Forecast Graphs » Challenge .

.

.

.

.

.

Outline – Statistical Analysis • Time Series – VAR » Declare Time Variable » VAR Regression (Dinflation vs Unemployment) » Joint Significance Test » VAR Forecast Calculations » VAR Forecast Graphs » Challenge .

.

.

.

.

Outline
– Statistical Analysis
• Time Series
– VAR
» Declare Time Variable
» VAR Regression (Dinflation vs Unemployment)
» Joint Significance Test
» VAR Forecast Calculations
» VAR Forecast Graphs
» Challenge

VAR: Challenge

Challenge
– Forecast unemployment using VAR with 4 lags

Method
– Use current data
– Run VAR with 4 lags
– Forecast 20 steps ahead

.

.

.

Outline – Statistical Analysis • Time Series – Managing Time Series Data – Dickey-Fuller Test – ARIMA – VAR – ARCH .

Deviation » Challenge .Outline – Statistical Analysis • Time Series – ARCH » ARCH Estimation » Conditional Variance » Conditional St.

Outline – Statistical Analysis • Time Series – ARCH » ARCH Estimation » Conditional Variance » Conditional St. Deviation » Challenge .

.

.

.

Deviation » Challenge .Outline – Statistical Analysis • Time Series – ARCH » ARCH Estimation » Conditional Variance » Conditional St.

.

.

.

.

.

Outline – Statistical Analysis • Time Series – ARCH » ARCH Estimation » Conditional Variance » Conditional St. Deviation » Challenge .

2) – Save conditional variance .GARCH: Challenge Challenge – Estimate a GARCH(2.2) model Method – Use current data – Run GARCH(2.

.

.

.

.

.

.

.

org.STATA.STATA.uk you can download tutorials on these other topics: Data Management Statistical Analysis Importing Data Summary Statistics Graphs Linear Regressions Presenting Output Panel Regressions Merge or Drop Data Time Series Analysis Instrumental Variables Probit Analysis .uk – If you visit www.www.org.