5qqmn938 - Week 1
5qqmn938 - Week 1
to Time Series
Intermediate Econometrics - 5QQMN938
Dr Jack Fosten
This Week
Covered this Week
• Introducing time series using lots of real world examples of time series data
• Look at U.S. and U.K. data as well as a wider global perspective and the effects of COVID
• Time series concepts: transformations (differences, growth rates), charting, autocorrelation
• Time series regression: stationarity, outliers and outlier detection
• Real world example of U.S. CPI inflation versus employment growth
Tutorial
• Importing, transforming and charting time series in Stata, and running simple regressions
Reading
• S&W: 14 Intro, 14.1, 14.2
Looking Ahead
• We will look at the autoregressive model for making forecasts of time series variables
Kick off with the United States, the largest global economy, and these important variables:
1. Does U.S. real GDP look the same across all subcomponents (consumption, investment,
government spending, imports, exports)?
2. Closer to home, what has happened to the same series in the U.K.?
3. What about a global perspective? Let’s look at GDP growth in the largest economies of
each continent: China, Germany, Brazil, Nigeria, Australia
China GDP
to other GDP series
We will practice charting in the Nicer graphs use package called “blindschemes”
and a scheme called plottig
next tutorial
ssc install blindschemes, replace
• The line graph is the most common TS
chart tsline y, ytitle(“Level of y")
xtitle(Time) title(Plot of y)
• In Stata you can access all graphing on scheme(plottig)
the menu Graphics->Twoway graph ->
Create
• Once you have done this, you will see the
code appear and you can edit it using
various options for titles
• Autocorrelation, or “serial correlation” Can only sum from 𝑗 + 1 to 𝑇 as data starts from 𝑡 = 1
𝑢ො 𝑡 = 𝑌𝑡 − 𝛽መ0 − 𝛽መ1 𝑋𝑡
------------------------------------------------------------------------------
| Robust
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .1557925 .1080369 1.44 0.151 -.0572582 .3688433
_cons | 1.44982 .1687845 8.59 0.000 1.116974 1.782666
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Robust
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .3495791 .0328697 10.64 0.000 .2847573 .4144008
outlier | -10.00234 .7794427 -12.83 0.000 -11.53946 -8.465214
_cons | 1.174125 .0783479 14.99 0.000 1.019617 1.328633
------------------------------------------------------------------------------
.
63 KING’S BUSINESS SCHOOL | kcl.ac.uk/business
Regression without Outlier
. reg y x if t!=100, robust
------------------------------------------------------------------------------
| Robust
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .3495791 .0327875 10.66 0.000 .2849196 .4142385
_cons | 1.174125 .0781518 15.02 0.000 1.020003 1.328246
------------------------------------------------------------------------------
Equation:
Δ ln 𝐶𝑃𝐼𝑡 = 𝛽0 + 𝛽1 Δ ln 𝐸𝑚𝑝𝑡 + 𝑢𝑡
• This is related to Phillips curve which
relates inflation to unemployment
• Remember the issues with employment
growth outliers. We will look at this now
• Do these look stationary? Do they fulfil
the assumptions?
• What are the drawbacks of this
equation?
• Can we forecast using this equation?
This is
VERY
weird and
likely
caused by
the
pandemic
periods
dEmp
-------------------------------------------------------------
Percentiles Smallest
1% -.6119031 -15.45299
5% -.2991179 -2.077889
10% -.1914789 -.8524818 Obs 466
25% -.0366181 -.6608913 Sum of wgt. 466
. gen distance=abs(dEmp-med)
. gen outlier=0
. replace outlier=1 if distance>10*(.2479633 +.0366181)
This looks
much
more like
a regular
stationary
time series
------------------------------------------------------------------------------
| Robust
dCPI | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
dEmp | .0749521 .010653 7.04 0.000 .054018 .0958862
_cons | .2232114 .0123352 18.10 0.000 .1989717 .2474511
------------------------------------------------------------------------------
N.B. dEmp is significant at the 1% level as the p-value<0.01. Alternatively, using the t-statistic, since |t|>z0.01 where z0.01=2.58
------------------------------------------------------------------------------
| Robust
dCPI | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
dEmp | .1168101 .0552788 2.11 0.035 .008181 .2254391
_cons | .2179885 .0146456 14.88 0.000 .1892082 .2467687
------------------------------------------------------------------------------
Next Time
• We will look at the autoregressive model for making forecasts
• We will make an actual forecast for CPI inflation!