You are on page 1of 3

Training Program: A Practitioners Guide to Econometrics with Stata

Handout 13: Time Series - An Introduction


Date: June 27th, 2013

1 Why use time series data?


To develop forecasting models

What will be the rate of inflation be next year?

To estimate dynamic causal effects

If BI increases interest rates today, what will be the effect on the rates of inflation and
unemployment in 3 months? in 12 months?
What is the effect over time on cigarette consumption of a hike in the cigarette tax?

2 New Technical Issues


Time lags

Correlation over time (serial correlation aka auto correlation)

Forecasting models built on regression methods:

autoregressive (AR) models


autoregressive distributed lag (ADL) models
need not (typically do not) have a causal interpretation

Conditions under which dynamic effects can be estimated, and how to estimate them

Calculation of standard errors when the errors are serially correlated

3 Stata Exercise
We want to examine the relationship between the general fertility rate and personal tax exemptions
for the US from 1913 to 1984. Specifically, we are looking to explain the general fertility rate, gfr
using personal tax exemption, pe, whether World War 2 was occuring and whether the contraceptive
pill was available.

1. Load FERTIL3.dta. Summarize/browse/examine the data to get a sense of the units that
are used in this dataset.

2. Declare the data to be time series using the tsset command. Type he tsset to see what
this command means.
Type: tsset year

1
3. Generate variables using the lag (L.), lead (F.) and first difference (D.) operators:
generate Lgfr = L.gfr
generate Fgfr = F.gfr
generate Dgfr = D.gfr
Now try to generate the first, second, third and fourth period lagged variables for pe.
Compare your created variables with pe 1, pe 2, pe 3, pe 4 to ensure that they match.

4. Run the simple regression model that ignores the time-series dimension of the data.

gf rt = 0 + 1 pet + 2 ww2t + 3 pillt + ut (1)

Are the coefficients statistically significant?

Interpret the coefficient on pe.

Is the fertility rate higher or lower during World War 2? By how much?

What is the impact of the introduction of the birth control pill on the fertility rate?

5. For the above regression to be valid, we require no serial correlation in the error terms. We
can test for this using the Durbin-Watson statistic.
estat dwatson
What can you conclude?

Stata can also implement two Lagrange Multiple tests for serial correlation, using estat

2
durbinalt and estat bgodfrey.

6. To deal with serial correlation of the error terms, we can add lags of the dependent variable.
Lets add two lags.
regress gfr L.gfr L2.gfr pe ww2 pill
Check if serial correlation is still a problem by typing
estat durbinalt
estat bgodfrey
Note that with a lagged dependent variable the standard Durbin-Watson statistics is not
appropriate.

7. Alternatively, to deal with serial correlation of the error terms, we could attempt to correct
the standard errors using newey. Here we must specify the order of serial correlation (the
number of lags over which to calculate the serial correlation in the errors).
newey gfr pe ww2 pill, lag(2)

8. Alternatively, it is possible to directly model the serial correlation in the error terms using
the arima command. For example, if we believe that the error terms are best modelled by a
first order autoregressive process, and so Equation 4 below should be estimated:

gf rt =Xt0 + ut (2)
ut =ut1 + t (3)
gf rt =Xt0 + (gf rt1 0
Xt1 ) + t (4)

Using arima with the option ar(1) achieves this. Extra autoregressive lags can be added, as
can moving average components using the option ma(i) where i is the order of the moving
average term.
arima gfr pe ww2 pill, ar(1)

You might also like