Click here to load reader
Upload
kai-shen-lim
View
216
Download
0
Embed Size (px)
Citation preview
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 1/14
Computer Class 3: Non-stationarity and Spurious Regression
1
Economic Data Analysis (L1D009)
Computer Class 3: Non-stationarity and Spurious Regression
In the last twenty years or so, the properties that characterise time series data have been the focus of much
theoretical and empirical research. The reason for this is that the properties of time series often contrast starklywith those of cross section data giving rise to problems (and opportunities) that need to be taken account of. In
today’s lecture we will cover the key concepts of what has become known as the ‘unit root revolution’, and the
implications of ‘unit roots’ (which give rise to the trending data so common in economics) in empirical modelling.
Today we will . . .
1. Learn that unlike cross section data, most economic times series do not satisfy the requirements of OLS
(stationarity) and this leads to the spurious regression problem.
2. Generate data with properties of both stationary and non-stationary processes to understand these
properties more clearly.
3. Apply the Augmented Dickey-Fuller (ADF) Test for unit roots
Stationary and Non-Stationary Data
In order for the classical linear regression model to deliver best linear unbiased estimators the data must be
(covariance or weakly) stationary. A stationary series is one whose mean, variance and auto-covariances are
invariant to time. A stationary series has:
1. a mean around which fluctuations revert (constant mean)
2. a variation that is constant over time (constant variance)
3. auto-covariances that depend only the distance apart in time (constant covariance)
In other words, stationarity requires that these quantities are the same whether they are based on any sample of n
observations. Data of this sort typifies the cross-section data that you have been working with. But what about time
series data?
The Spurious Regression Problem
Unlike cross section data in economics and time series data in the physical sciences, economic time series are
commonly characterised by strong ‘trend-like’ behaviour. As a result, they do not satisfy the requirements of
stationary time series since their mean, variance and covariance will depend on time, violating the conditions
above.1 Such series are called non-stationary. If no account is made of this trend-like behaviour (called non
stationarity ) then the OLS estimator can give rise to highly misleading results, what Granger and Newbold (1974)
coined spurious regression.2 The intuition is straightforward: estimators use the correlation between two variables
to determine the existence and size of a (causal) relationship between them. When the variables are stationary, the
1 For a clear textbook treatment of stationarity and non-stationarity see (among others ) Patterson, K. An Introduction to
Applied Econometrics: A Time Series Approach. Chapter 8, Macmillan Press 2000.2 Granger, C.W.J. and P. Newbold (1974) ‘Spurious Regressions in Econometrics’, Journal of Econometrics, 2, pp.111-120.
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 2/14
Computer Class 3: Non-stationarity and Spurious Regression
2
existence of a correlation between them is good evidence of a statistically significant (causal) relationship.
However, because non-stationary variables tend to drift upwards (or downwards) over long periods of time, they
will be highly correlated with one another even if they are not causally related (think . . . US GDP per capita and the
number of streetlights in Nottingham). Thus estimators such as OLS will ascribe this correlation to the existence o
a ‘statistically significant’ relationship. Correlation is not causation, and because of the trend-like behaviour that is
characteristic of non-stationary data, everything appears correlated with everything else. In fact, virtually any
regression between two non-stationary variables will suggest evidence of a relationship (significant t ratios, high
R2), hence the spurious (or ‘nonsense’) regression problem is common. It arises in time series because most
economic time series are non-stationary. Another way of looking at the spurious regression problem is to
recognise that when the variables in a regression are stationary, then in general any linear combination of them
will also be stationary. One such, linear combination is the equation error say,
However, when the data are non-stationary then as a general rule (although as we will see there is one exception)
any linear combination of them, such as the error term, is also non-stationary. If that is the case, the assumptions of
the classical linear regression model (which essentially require the errors to be white noise) are violated
Therefore, it is no surprise that any t test, F test or R2 value that we routinely use to test for the existence of a
relationship using cross section data, can give misleading (spurious) results when the data is non-stationary.
The Autoregressive Process
In order to gain a sound understanding of stationary and non-stationary processes, consider the simplest case, the
first order autoregressive [AR1] model,
(1)
where t is a normally distributed independent random variable with a zero mean and constant variance, denoted
),0.(..~ 2 d int , often called ‘white noise’. This simple model embodies a wide range of processes, some of which
exhibit trend-like behaviour, some that do not. If we assume that then is devoid of any
‘structure’ (i.e. t y is a completely random –‘white noise’ - process), and thus clearly cannot have any trend-like
behaviour. For 0,0 21 cc the process has a non-zero mean, but still no trend. For 10 the series t y
has some structure (it is related to its previous value, so it is not ‘white noise’ but as we will see, it doesn’t exhibit
trend-like behaviour either). Such processes are called stationary or integrated of order zero, denoted I(0). One way
to generate ‘trend-like behaviour’ is to allow 02 c . Now, t y has a deterministic (linear trend) and is said to be
trend stationary or stationary [or I(0)] about trend (possibly with some autoregressive behaviour if 10 )
Note that series of this sort will always rise ( 02 c ) or fall ( 02 c ) albeit with some fluctuations given by the
stationary process. While such deterministic trend behaviour may approximate to many economic time series
there is another way to generate trend in (1) that offers a much more realistic approximation to the processes we
tend to find in the real world. These are called non-stationary series that are integrated of order one, denoted I(1)
They are said to contain a unit root because they occur when 1 in (1).
While not immediately obvious from (1) unit root (i.e. I(1)) processes exhibit trend-like behaviour too, however the
‘trend’ is stochastic (random) because it is generated through the accumulation of the random process . To see
this, examine the behaviour of as we roll through time. In period 1, we have
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 3/14
Computer Class 3: Non-stationarity and Spurious Regression
3
Assume for simplicity that so that in period 2, we have
And in some T periods later,
It may seem counter-intuitive, but as we will see, while the white noise process such has no trend, the
accumulation of white noise produces a series that has trend-like behaviour, described as a stochastic trend . Over
long periods of time the ‘trend’ may be positive and then become negative. The point at which the ‘trend’ switches
the magnitude of the ‘trend’ and the duration of the period in which a ‘trend’ is apparent is completely random
depending simply on the run of disturbances that make up the stochastic process . (The inverted commas are
used above since the behaviour is not actually due to the presence of a (deterministic linear) trend, it simply lookslike it). Asymptotically, (i.e. as the sample size approaches infinity) the clear distinction between stochastic and
deterministic trend is obvious, however even in samples of 100 observations, they can be easily confused, even
though the mechanisms generating the behaviours are poles apart (one is deterministic the other stochastic).
This next bit is also important. When 1 in (1) the interpretation of the other parameters changes dramatically
Consider the non-stationary process
In period 1 we have,
Assume for simplicity again that so that in period 2, we have
And in some T periods later,
The constant term, now generates a linear trend in the data (which we call drift – see below). Accordingly, if (1)
includes a time trend, actually generates quadratic trending in t y when contains a unit root. Since quadratic
behaviour is rarely seen in economics (save possibly for hyper-inflation) we may reasonably rule out this
possibility in this introduction. For the sample reason, the explosive behaviour implied by 1 is also
inadmissible.
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 4/14
Computer Class 3: Non-stationarity and Spurious Regression
4
Working with Data with known Properties in Eviews
Go to the Start menu and launch Eviews. Go to the file menu and upload the file unit root.wf1 (available from
Moodle). This workfile contains data that has been generated using the AR(1) model described in equation (1)
Click on the Details for a brief description. All series are based on the same set of random numbers (called ‘e’) that
have been generated from the standard normal distribution (see appendix for details). The dataset contains the
following variables:
ys: a stationary AR(1) process
yt a trend stationary process
yn: a non-stationary AR(1) process
ynd: a non-stationary AR(1) process with drift
yn2: a non-stationary AR(2) process
yx: an explosive AR(1) process.
Double click on the object in the workfile called e. Go to the View and graph it. Copy and paste it below.
Insert Graph of drawings of the standard normal distribution here
Now go to the Quick menu, select Graph and type the variable names:
e ys yt yn ynd yx
Select the multiple graph option and click OK and then copy the graph and paste it below.
Insert Graph of the artificial series here
Describe the characteristics of each series. Of course with 250 observations, it is clear that (and unlike what you
may have thought) using a linear trend model to approximate the ‘trend-like behaviour’ in empirical time series
data isn’t very satisfactory. In contrast, the non-stationary models look much more like the data we have seenalready in food consumption, and it is to these models that our attention now turns.
The Random Walk
The idea of stochastic trends is fundamental to modern times series analysis, not least because they seem to mimic
rather well the real world series we observe in economics. While central to the thinking underlying all modern
time series analysis, students often find it difficult to understand why we can generated (stochastic) trends from
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 5/14
Computer Class 3: Non-stationarity and Spurious Regression
5
(the accumulation) of observations in processes such as the white noise, that are devoid of such behaviour. To fix
the idea of the stochastic trend, consider the following analogy.
Imagine we are tracing the journey of a man who takes a step forward to the left if the toss of a coin is tails and a
step forward to the right when the coin comes up heads. Each step forward (whether to the left or the right) on the
path of his randomly selected footsteps will take him away from his starting point. Successive 'tails' will mean he
walks forward in a leftwards direction. Occasional 'heads' on this part of his journey will cause his path to deviatebut he will still be walking in an approximately leftward direction. Only when there are a number of successive
heads will he appear to change course and head off in the rightwards direction. Changes in direction are akin to
changes in trend and because they are caused by chance (successive flips of the coin that come out heads say), a
time series that contains a stochastic trends is often called a random walk . So, although each step is randomly to the
right or left, this does not mean that he stays put; far from it. Because his journey represents the accumulation of
his steps, some in the leftwards direction some in a rightwards direction, he meanders further away from his
starting point the more steps there are to his journey. Were the man always to stumble to his left (or to his right) as
he took his step then his journey would appear to drift persistently to the left (or right), as the accumulation of his
steps incorporate this stumble. Such a journey would appear to veer off in a clear direction albeit with the random
walk overlaid on top. Such clearly trending behaviour is gives rise to the random walk with drift .
Autoregressive Processes of Order (p)
Econometricians have discovered that non-stationary [I(1)] processes, are good approximations of many of the
time series we encounter in economics, such as GDP per capita, the stock price index, and so on. Stochastic trends
(i.e. ‘unit root processes’) seem to mimic the sort of behaviour we observe in the real world far more accurately
than deterministic trends.
In equation (1) the stochastic trend comes about because the coefficient on the lagged level is unity. However,
many economic processes, whilst sharing the stochastic trend have ‘longer memories’ i.e. are related to their past
at t-2 or t-3 or further. An AR(2) model is written as,
(2)
In general, the root of an AR(p) is the sum of the autoregressive parameters rather than the AR(1) parameter itself
So, in the AR(2) model above, if 121 , the process is stationary, if it equals unity, the process is non-
stationary and has a unit root. As for the AR(1), model, note that roots greater than unity in higher order models
121 are not considered since they imply the explosive behaviour rarely observed in economic time series
Plot the AR(2) process yn2 that is in the workfile and note that its behaviour is very similar to the AR1, but very
different to the other series. See how even modest coefficients in excess of unity create wildly explosive series.
Differencing and the Order of Integration
Some more jargon: A series integrated of order d [denoted I(d )] requires differencing d times to become stationary
If a series t y is I(1), differencing it once will render the series stationary, so that t y is I(0). A series that is
integrated of order one, I(1) may variously be called non-stationary, a unit root process or a random walk (possibly
with drift). In contrast a series that is integrated of order zero, I(0) will be called stationary, (possibly about trend
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 6/14
Computer Class 3: Non-stationarity and Spurious Regression
6
or mean). A ‘white noise’ process is I(0), but unlike other types of stationary process, is devoid of any
autoregressive structure at all. Consider the I(1) process with drift ,
Subtracting yields ,
And so the first difference of an I(1) process is I(0) by definition. To visualize what differencing does, let’s create
the first difference of our series. In Eviews, click on Genr and type:
dyn= yn-yn(-1)
Click Okay
Insert plot of dyn
Note that since yn was simply the accumulation (sum) of the variable e, taking the difference of yn (to produce
dyn) simply produces the variable e.
One implication of this is that the inclusion of a linear trend in regression models to take account of ‘trend-like
behaviour’ will not work if the data contains a unit root (specifically, it only works if the trend is linear). To see this
run a quick regression of yn (which contains a stochastic trend) on a constant and trend. While the t ratio of the
trend terms seems significant (seemingly indicating that the trend-like behaviour has been removed) take a look at
the residuals – which contain the same unit root behaviour as yn. Clearly, linear trend does not remove the unit
root behaviour, despite the fact linear trends are included in regression models to do just that.
Note that we do not need to create the first difference of variables because Eviews recognizes that d(yn)refers to
the first difference of yn, in the same way that it recognizes log(yn) as the log of the series yn.
Testing the order of Integration [I(1) vs I(0)] : The ADF Regression
Testing for the existence of trend is called testing for non-stationarity (or unit root testing) and this is now a
standard pre-test that is conducted prior to all regression analysis using time series data. Although the presence o
trend-like behaviour is apparent in time series data simply by plotting the data, as have seen the behaviour can be
generated in two distinct ways, and although they are distinct in large sample sizes, it can often be difficult to
distinguish one form the other in small (typical samples). To demonstrate this, close down the graph in Eviews and
click on Sample and select observations 1 to 50. Now go to the Quick menu, select Graph and type the variablenames as before:
Ys yt yn ynd
Select the multiple graph option and click Okay
Insert Graph with 50 observations here
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 7/14
Computer Class 3: Non-stationarity and Spurious Regression
7
As you can see, choosing between the trend stationary and unit root process is difficult. It can even be tricky to
distinguish stationary from non-stationary series in samples of this sort. Clearly, a formal test would be useful
Moreover, in order to be able to remove the trend in the data it is thus essential that we know what type of
mechanism is creating the trend in the first place. A formal and commonly used test of non-stationarity is the
Augmented Dickey-Fuller (ADF) test. This test is designed to distinguish between stationary (about mean or
trend) and non-stationary processes (with or without drift). Rather than estimating equation (1) directly, Dickey
and Fuller proposed subtracting1t y from both sides giving,
t t t ycT cc y 1321 (3)
where 13 c since testing for the presence of a unit root ( 1 ) can be evaluated with a simple t test of3
c
using the usual zero null as is customary in a t ratio. To allow for more general autoregressive [AR(p)] processes
the ADF regression takes the general form given by,
∑ (4)
To see this consider an AR(2),
Subtracting from both sides
Adding and subtracting to the RHS gives
with The key thing to note is that the algebraic manipulation allows us to use the same test on
3c
irrespective of the order of the AR(p) model, providing the equation is augmented by sufficient lags of the
dependent variable. Without this augmentation, the regression would be serially correlated and the estimator
biased and inconsistent.
Given that the order (p) of the autoregressive process being tested will not typically be known prior to unit root
testing (although it could be deduced from inspection of the autocorrelation and partial auto-correlation function)
in practice, lags are added until there is no evidence of autocorrelation.
Using the AR(1) model to illustrate the ADF test note that if:
1. 03 c then 1 implying that t y contains a unit root and integrated of order one, t y ~I(1)}
Note that if, in addition, 01 c (i.e. 00 31 cc and ) then we have the random walk with drift
model (which is also a I(1) process and thus non-stationary). Since differencing induces stationarity
(removes the stochastic trend) then the first difference of t y is stationary and is integrated of
order zero, i.e. t y ~I(1); t y ~I(0).
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 8/14
Computer Class 3: Non-stationarity and Spurious Regression
8
2. If 03 c then 1 . Since we can rule out explosive ( 1 ) behavior the only admissible outcome
is 03 c implying that 1 and that t y is stationary and thus integrated of order zero t y ~I(0)}
Since t y ~I(0); so must t y ~I(0). Note that if, in addition, 02 c then t y is stationary about a
linear trend and if it is not (i.e. 02 c ), t y is stationary about a constant mean (if 01 c ).
Since this issue boils down to whether3
c is statistically significant, attention focuses on the t ratio of the
coefficient on the lagged level term1t y . This t ratio is called the ADF statistic. Owing to the fact that we can rule
out explosive behavior, the ADF statistic is a one-sided t test. Nothing particularly special there, but the reason why
Dickey and Fuller were able to assign their names to what is a t ratio is that they discovered that the distribution o
the statistic is NOT distributed as the t distribution but a non-standard variant of it, that depends on whether a
constant and/or trend term are included in the ADF regression. As a result, the ADF test has different critical values
depending on whether a constant and/or a trend are included in the ADFR regression. To illustrate, consider Table
1, which reports the asymptotic critical values of the ADF statistic in the various simplification of (4).3
Asymptotic Critical Values of the ADF test
Model 1% 5% 10%
t t t yc y 13 -2.56 -1.94 -1.62
t t t ycc y 131 -3.34 -2.86 -2.57
t t t ycT cc y 1321 -3.96 -3.41 -3.13
Standard critical values -2.33 -1.65 -1.28
Dickey and Fuller also showed that not only is the distribution of the ADF statistic dependent on whether a
constant or trend term is included, but the t ratios of these deterministic terms (1
c and2
c ) are also non-standard
so that we can’t use the t distribution for them either. Fortunately, the only coefficient that you are likely to test the
significance of it either3
c or2
c . The distributions of the t statistics for these coefficients for equation (4) is given in
the appendix.
We do not consider the combination 00 32 cc and since the (explosive) behaviour it implies is inadmissible in
economics. To see this note that this combination of coefficients implies that t cc yt 21 i.e. the change in t y
gets ever-larger ( 02 c ) or smaller ( 02 c ). Moreover if t y is measured in natural logs this means that the rate
of change in trending. Such explosive behaviour is rarely observed. 4
Performing the ADF Test in Eviews
In principle, there is nothing preventing us from running regressions of the ADF type as if they were any other
regression. Make sure that you have returned the sample to full size (Click the sample tab and insert @all). Now go
to the Quick Menu and Estimate Equation. Type the variables:
3 Like the usual t statistics the critical values are also dependent on the degrees of freedom, complicating matters even further
so those reported in the table are for large samples.4 Note that such behaviour can also be modelled with I(2) series, which are occasionally found in economics, although we will
not consider them further. See the references for further details on I(2) series).
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 9/14
Computer Class 3: Non-stationarity and Spurious Regression
9
dyn c t yn(-1)
Click Okay
Insert ADF Regression of yn here
The ADF statistic is -1.98. If this statistic were distributed as t this value would be highly significant (given that it is
one-tailed test). However, as we can see from the table above the 5% critical value is actually -3.41 implying that it
is not statistically significant at this level implying that in actual fact, yn ~I(1) (which is the right answer) .
In practice, we will not write out the model as we have done above when testing for unit roots as there is an
automated procedure in Eviews. This is particularly attractive since not only do the critical values depend on
sample size and whether a constant and/or trend has been included but we will also need to test for significant lags
using the SC or similar, to ensure that our residuals are empirical white noise.5 The automated procedure simply
asks what model we want to estimate (constant & trend, constant or neither), the maximum number of lags it
should consider and the criterion by which lag length is selected. The summary results compares the ADF test
statistic with the correct critical value. The automated procedure makes things a lot easier.
Double click on yn click on View and select Unit Root Test . . . You will see something like, the screenshot below.
.
Specify an ADF model with trend and intercept and click OK What Eviews then presents on the screen are the
results from a consideration of 16 regressions; the ADF with 0, 1, 2, . . . ,15 lags. The preferred model is selected by
the Schwartz Information Criterion (and in this case is a model with no lags of the dependent variable) and isreproduced in the lower part of the results table. A table summarizing the ADF test statistic and the appropriate
critical values in given at the top.
Insert Unit Root Test Results for yn here
5 While information criteria do not directly test whether the residuals are ‘white noise’, they tend to select models that do not
have autocorrelation since these fit better than models with autocorrelated errors.
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 10/14
Computer Class 3: Non-stationarity and Spurious Regression
10
As we can see, the ADF test statistic is identical to that produced from our initial regression, however the p value
(and critical values that are supplied in the top part of the table are the correct – non-standard – ones, not those
from the t distribution. We infer from the test that we are unable to reject the null of a unit root hence, yn ~I(1)
The test gets it right!
A Word about I(2) Processes
Because we have been confining ourselves to processes that are either I(1) or I(0) we have used I(1) and non-
stationarity synonymously. However, some non-stationary processes require differencing more than once
(although typically no more than twice) to be made stationary. Such processes are called I(2) and, while they are
reasonably rare, it is useful to be able to show that our data is not I(2). To do so we repeat the ADF test on the first
difference which requires that we form the second difference of (i.e. ) as the new
dependent variable in the ADF regression (analogous to forming when testing the unit root in ).
If ~I(0) then ~I(1) so that if we find that ~I(1) this would actually imply that ~I(2) and requires
differencing twice to become stationary. When testing for a unit root in the first difference select a mode with
intercept only. What Eviews estimates for you is regressions of the form
∑
where is the autoregressive order of . Assessing whether has a unit root (implying that ~I(2)) is simply
the familiar ADF test evaluating . Note that we dropped the trend term in this model to exclude the
possibility of quadratic terms in (which would be implied by a trend under the null hypothesis in this model)
and so the critical value is also different.
Repeat the procedure for ynd, ys and yt and complete the table below.
Summary of ADF Test Results
(250 observations)
Levels ADF Regression First Difference ADF Regression
∑
∑
Series Optimal Lag Length (SC) ADF Statistic
H0: c3=0 (unit root)
Inference
yn I( . . .)
I( . . .)
ynd I( . . .)
I( . . .) ys I( . . .)
I( . . .)
yt I( . . .)
I( . . .) The 5% critical value of the ADF test is -3.41 in the levels regression and -2.93 in the first difference regression.
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 11/14
Computer Class 3: Non-stationarity and Spurious Regression
11
In your future empirical work, a table containing a summary of unit root test results and the model in which the
test was conducted should always be included. Also note that the ADF test is just one - albeit the most widely used
test that we could apply to evaluate unit roots. Details of the other test available in Eviews can be found in the Help
menu
Finally, repeat the tests for a sample size of 50.
Summary of ADF Test Results
(50 observations)
Levels ADF Regression First Difference ADF Regression
∑
∑
Series Optimal Lag Length (SC) ADF Statistic
H0: c3=0 (unit root)
Inference
yn I( . . .)
I( . . .)ynd I( . . .)
I( . . .)
ys I( . . .)
I( . . .)
yt I( . . .)
I( . . .) The 5% critical value of the ADF test is -3.41 in the levels regression and -2.93 in the first difference regression.
In the same way that we had difficulty correctly identifying the correct order of integration with 50 observations so
does the test. In fact, you will see that the ADF test incorrectly identifies the order of integration of both the trend
stationary model and the stationary AR1 model. This is a sobering thought and valuable lesson to acknowledge as
we return to our food data, as we will in the next class.
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 12/14
Computer Class 3: Non-stationarity and Spurious Regression
12
Appendix: Generating Data with known properties
The data have been generated by running a small program (called CC3 data.prg available on Moodle). To run the
program create a workfile in to which the program can generate the data. Go to the File Menu select New. At the
dialogue box, select the unstructured/undated option with 250 observations. Click OK
When the empty workfile appears go to the File Menu, select Open/Program/ and upload the program CC3
data.prg which looks like the following:
'Program to generate series with known properties
'Create a series of random numbers drawn from the standard normal distribution. Specifying the seed here ‘2’ ensure we all get the‘same set of ‘random numbers’
rndseed 2genr e=nrnd
'Starting values for the series smpl @first @first+1genr ys=2genr yn=10genr ynd=15genr yt=7genr yx=10genr yn2=6
'Generating the data smpl @first+1 @last'ys is the statioanry AR(1) process genr ys= 1+ 0.85*ys(-1) + e'yn is the non-stationary AR(1) process, often called the random walk or unit root process genr yn= yn(-1)+e'ynd is the non-stationary AR(1) process with driftgenr ynd= 0.2 + ynd(-1) + e'yt is the stationary about linear trend modelgenr yt= 7+ 0.1*@trend + e'yx is an explosive AR(1) yx=1.05*yx(-1)+e'yn2 is a non-stationary AR(2) yn2=0.75*yn2(-1)+0.25*yn2(-2)+e
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 13/14
Computer Class 3: Non-stationarity and Spurious Regression
13
'Returning to the complete sample smpl @all
Click Run and the data will be generated, as we had in class, although the variable labels need to be given. Why not
try generating other series (maybe with a different set of random numbers by specifying a seed other than ‘2’).
8/13/2019 EDA 3 Nonstationarity and Unit Roots (1)
http://slidepdf.com/reader/full/eda-3-nonstationarity-and-unit-roots-1 14/14
Computer Class 3: Non-stationarity and Spurious Regression
14
Summary Tabulations of Test Statistics in the (with constant and trend) ADF Regression
For a pth order autoregression oft
y , the ADF regression is given by,
t it
p
i
it t y ycT cc y
1
1
1321
Testing for the Presence of Stochastic Trend (‘ADF test’ is a one tailed test)
0: 30 c H i.e.t
y ~I(1) vs 0: 31 c H i.e.t
y ~I(0)
Empirical Distribution of the t -statistic ( ) of
3c if the 0: 30 c H is true
Sample SizeConfidence Level
0.90 0.95 0.99
25 -3.24 -3.60 -4.3850 -3.18 -3.50 -4.15
100 -3.15 -3.45 -4.04
250 -3.13 -3.43 -3.99500 -3.13 -3.42 -3.98
∞ -3.12 -3.41 -3.96Source: Fuller (1976, p373
Testing for the Presence of Deterministic Trend (is a two tailed test)
0: 20 c H i.e.t
y ~I(0) around mean vs 0: 21 c H i.e.t
y ~I(0) around linear trend
Empirical Distribution of the t -statistic ( ) of the coefficient2
c if the 0: 20 c H is true
Sample SizeConfidence Level
0.90 0.95 0.99
25 2.39 2.85 4.38
50 2.38 2.81 4.15
100 2.38 2.79 4.04250 2.38 2.79 3.99
500 2.38 2.78 3.98
∞ 2.38 2.78 3.96
Source : Dickey and Fuller(1981, p1062Notes:Lag length (p) is determined so that the residuals are empirical white noise. Critical values are invariant to the number of lags of th
dependent variable used in the ADF regression. Testing for the presence of deterministic trend only takes place when 0: 30 c H has bee
rejected, since 03 c and 02 c are inadmissible (implying explosive behaviour in t y ).
Tim Lloyd 07 –XI-13