The outcome of
unit root testing matters for the empirical model to be estimated. The
following scenarios explain the implications of unit root testing for further
analysis. Still drawing on the previous tutorials
(see here for EViews, Stata and Excel) on unit root testing with the augmented
Dickey-Fuller procedure (see videos), we are using the same data from Gujarati and Porter Table 21.1 quarterly data of 1970q1 to 1991q4. The variables in
question are pce, pdi and gdp in natural logarithms.
Scenario
1: When series under scrutiny are
stationary in levels.
In this scenario, it is assumed that lnpce, lnpdi and lngdp are
stationary in levels, that is, they are I(0)
series (integrated of order zero). In
this situation, performing a cointegration test is not
necessary. This is because any shock to the system in the short run quickly
adjusts to the long-run. Consequently, only the long
run model should be estimated using OLS (where variables are neither
lagged nor differenced). It is the static form of the model. In essence, the
estimation of short run model is not necessary if series are I(0).
Scenario
2: When series are stationary in first differences.
1.Under this scenario, the series are
assumed to be non-stationary but became stationary after first difference
2.One special feature of this is that they
are of the same order of integration.
3.Under this scenario, the model in
question is not entirely useless although the variables are unpredictable. To
verify further the relevance of the model, there is need to test for cointegration. That is, can we assume a long run
relationship in the model despite the fact that the series are drifting apart
or trending either upward or downward?
4.There are however, two prominent
cointegration tests for I(I) series
in the literature. They are Engle-Granger cointegration test and Johansen
Cointegration test.
5.The Engle-Granger test is meant for
single equation model while Johansen cointegration test is considered when
dealing with multiple equations.
If there is cointegration:
1.Implies that the series in question are
related and therefore can be combined in a linear fashion.
2.That is, even if there are shocks in the
short run, which may affect movement in the individual series, they would
converge with time (in the long run).
3.Estimate both long-run and short-run
models.
4.The estimation will require the use of
vector autoregressive (VAR) model and vector error correction model (VECM)
analysis.
If
there is no cointegration:
1.Estimate only the short-run model, which
is VAR and not VECM.
Johansen
Cointegration Test in EViews
The hypothesis
is stated as:
H0:
no cointegrating equation
H1: H0
is not true
Rejection of the null hypothesis is at the 5% level.
Note: Cointegration test should be performed on the level
form of the variables and not on their first difference. It is okay to also use
the log-transformation of the raw variables, as I have done in this example.
Steps:
1.Load data into EViews (see video on how
to do this)
2.Open as Group data (see video on how to
do this)
3.Go to Quick >> Group Statistics >> Johansen Cointegration
>> dialog box opens >> list the variables >> Click OK
>> Select option 3 [Intercept (no trend)] >> Click OK
Here is the
EViews result on the Johansen Cointegration test of lnpce, lnpdi and lngdp:
EViews - Johansen Cointegration Test
Source: CrucnhEconometrix
Interpreting
Johansen Cointegration Test Results
1.The EViews output releases two
statistics, Trace Statistic and Max-Eigen Statistic
2.Rejection criteria is at 0.05 level
3.Rejection of the null hypothesis is
indicated by an asterisk sign (*)
4.Reject the null hypothesis if the
probability value is less than or equal to 0.05
5.Reject the null hypothesis if the Trace
or Max-Eigen statistic is higher than the 0.05 critical value
Decision: Given the results generated,
the null hypothesis of no cointegrating equation is rejected at the 5% level.
Hence, it is concluded that a long-run relationship exist among the three
variables.
[Watch video on how to conduct Johansen cointegration test in EViews]
However, if the
null hypothesis cannot be rejected, it evidences no cointegration and hence
there is no long-run relationship among the series. This implies that, if there
are shocks to the system, the model is not likely to converge in the long-run. In
addition, if there is no cointegration, only the short run model should be estimated. That is, estimates
only VAR do not estimate a VECM!
If there are comments
or areas requiring further clarification, kindly post them below….
The panel data approach pools time series data with
cross-sectional data. Depending on the application, it can comprise a sample of
individuals, firms, countries, or regions over a specific time period. The
general structure of such a model could be expressed as follows:
Yit =
ao + bXit + uit
where uit ~ IID(0, 𝜎2)
and i = 1, 2, ..., N individual-level
observations, and t = 1, 2, ...,T time series
observations.
In this application, it is assumed
that Yit is a continuous variable. In this model,
the observations of each individual, firm or country are simply stacked over
time on top of each another. This is the standard pooled model where intercepts
and slope coefficients are homogeneous across all N cross-sections
and through all T time periods. The application of OLS to this
model ignores the temporal and spatial dimension inherent in
the data and thus throws away useful information. It is important to note that
the temporal dimension captures the ‘within’ variation in the data while the
spatial dimension captures the ‘between’ variation in the data. The pooled OLS
estimator exploits both ‘between’ and ‘within’ dimensions of the data but does
not do so efficiently. Thus, in this procedure each observation is given equal
weight in estimation. In addition, the unbiasedness and consistency of the
estimator requires that the explanatory variables are uncorrelated with any
omitted factors. The limitations of OLS in such an application prompted
interest in alternative procedures. There are a number of different panel
estimators but the most popular is the fixed effects (or ‘within’) estimator.
Fixed Effects or Random Effects?
The question is usually asked which
econometric model an investigator should use when modelling with panel data.
The different models can generate considerably different results and this has
been documented in many empirical studies. In terms of a model where time
effects are assumed absent for simplicity, the model to be estimated may be
given by:
Yit = ai+ bXit +
uit
The question, therefore, is do we
treat aias fixed or random? The following points
are worth noting.
·1) The
estimation of the fixed effects model is costly in terms of degrees of freedom.
This is a statistical and not a computing cost. It is particularly problematic
when N is large and T is small. The
occurrence of large N and small T currently
tends to characterize most panel data applications encountered.
·2) The aiterms
are taken to characterize (for want of a better expression) investigator
ignorance. In the fixed effects model does it make sense to treat one type of
investigator ignorance (ai) as fixed but another as random (uit)?
·3) The fixed effects formulation is viewed as one
where investigators make inferences conditional on the fixed effects in the
sample.
4)The
random effects formulation is viewed as one where investigators make
unconditional inferences with respect to the population of all effects.
·5) The
random effects formulation treats the random effects as independent of the
explanatory variables (i.e. E(aiXit)
= 0). Violation of this assumption leads to bias and inconsistency in the b vector.
Advantage and disadvantage of the fixed
effects model
The main advantage of the fixed effects
model is its relative ease of estimation and the fact that it does not require
independence of the fixed effects from the other included explanatory
variables. The main disadvantage is that it requires estimation of N separate
intercepts. This causes problems because much of the variation that exists in
the data may be used up in estimating these different intercept terms. As a
consequence, the estimated effects (the bs) for other explanatory variables in the
regression model may be imprecisely estimated. These might represent the more
important parameters of interest from the perspective of policy. As noted above
the fixed effects estimator is derived using the deviations between the cross-sectional
observations and the long-run average value for the cross-sectional unit. This
problem is most acute, therefore, when there is little variation or movement in
the characteristics over time, that is when the variables are
rarely-changing or they are time-invariant. In essence, the effects of
these variables are eliminated from the analysis.
Advantage and disadvantage of the random effects model
The main advantage of the random
effects estimator is that it uses up fewer degrees of freedom in estimation
and allows for the inclusion of time invariant covariates. The main
disadvantage of the model is the assumption that the random effects are independent
of the included explanatory variables. It is fairly plausible that there may be
unobservable attributes not included in the regression model that are
correlated with the observable characteristics. This procedure, unlike fixed
effects, does not allow for the elimination of the omitted heterogeneous
effects.
The Hausman Test
In determining which model is the more
appropriate to use, a statistical test can be implemented. The Hausman test
compares the random effects estimator to the ‘within’ estimator. If the null is
rejected, this favours the ‘within’ estimator’s treatment of the omitted
effects (i.e., it favours the fixed effects but only relative to the random
effects). The use of the test in this case is to discriminate between a model
where the omitted heterogeneity is treated as fixed and correlated with the
explanatory variables, and a model where the omitted heterogeneity is treated
as random and independent of the explanatory variables.
·If the omitted effects are uncorrelated with the explanatory
variables, the random effects estimator is consistent and efficient. However,
the fixed effects estimator is consistent but not efficient given the
estimation of a large number of additional parameters (i.e., the fixed
effects).
·If the effects are correlated with the explanatory
variables, the fixed effects estimator is consistent but the random effects
estimator is inconsistent. The Hausman test provides the basis for
discriminating between these two models and the matrix version of the Hausman
test is expressed as:
[bRE– bFE][V(bFE) – V(bRE)]-1[bRE – bFE]′
~ 𝝌²k
where k is the number
of covariates (excluding the constant) in the specification. If the random
effects are correlated with the explanatory variables, then there will be a
statistically significant difference between the random effects and the fixed
effects estimates. Thus, the null and alternative hypotheses are expressed as:
H0: Random effects are
independent of explanatory variables
H1: H0 is
not true.
The null hypothesis is the random
effects model and if the test statistic exceeds the relevant critical value,
the random effects model is rejected in favour of the fixed effects model. In
finite samples the inversion of the matrix incorporating the difference in the
variance-covariance matrices may be negative-definite (or negative
semi-definite) thus yielding non-interpretable values for the chi-squared.
The selection of one model over the
other might be dictated by the nature of the application. For example, if the
cross-sectional units were countries and states, it may be plausible to assume
that the omitted effects are fixed in nature and not the outcome of a random
draw. However, if we are dealing with a sample of individuals or firms drawn
from a population, the assumption of a random effects model has greater appeal.
However, the choice of which model to choose is ultimately dictated
empirically. If it does not prove possible to discriminate between the two
models on the basis of the Hausman test, it may be safest to use the fixed
effects model, where the consequences of a correlation between the fixed effects
and the explanatory variables are less devastating than is the case with the
random effects model where the consequences of failure result in inconsistent
estimates. Of course, if the random effects are found to be independent of the
covariates, the random effects model is the most appropriate because it
provides a more efficient estimator than the
fixed effects estimator.
**This tutorial is
culled from my lecture note as given by Prof. Barry Reilly (Professor of
Econometrics, University of Sussex, UK).
How
to Perform the Hausman Test in EViews
First: Load
file into EViews and create Group
data (see video on how to do this)
Third:
Perform random effects estimation: Quick
>> Estimate Equation >> Panel Options >> Random >> OK
Fourth: Perform
the Hausman test: View >> Fixed/Random
Effects testing >> Correlated Random Effects – Hausman Test
Fifth:
Interpret results:
Reject the null
hypothesis if the prob-value is statistically significant at 5% level. It
implies that the individual effects (ai)
correlate with the explanatory variables. Therefore use the fixed effect
estimator to run the analysis. Otherwise, use the random effects estimator.
[Watch video tutorial on performing the
Hausman test in EViews]
If you still
have comments or questions regarding how to perform the Hausman test, kindly
post them in the comments section below…..
The panel data
approach pools time series data with cross-sectional data. Depending on the
application, it can comprise a sample of individuals, firms, countries, or
regions over a specific time period. The general structure of such a model
could be expressed as follows:
Yit = ao
+ bXit + uit
where uit
~ IID(0, 𝜎2) and i = 1, 2,
..., N individual-level observations,
and t = 1, 2, ...,T time series observations.
In this
application, it is assumed that Yit
is a continuous variable. In this model, the observations of each individual,
firm or country are simply stacked over time on top of each another. This is
the standard pooled model where intercepts and slope coefficients are homogeneous across all N cross-sections and through all T time periods. The application of OLS
to this model ignores the temporal
and spatial dimension inherent in the data and thus throws away useful
information. It is important to note that the temporal dimension captures the
‘within’ variation in the data while the spatial dimension captures the
‘between’ variation in the data. The pooled OLS estimator exploits both
‘between’ and ‘within’ dimensions of the data but does not do so efficiently.
Thus, in this procedure each observation is given equal weight in estimation.
In addition, the unbiasedness and consistency of the estimator requires that
the explanatory variables are uncorrelated with any omitted factors. The
limitations of OLS in such an application prompted interest in alternative
procedures. There are a number of different panel estimators but the most popular
is the fixed effects (or ‘within’) estimator.
Fixed
Effects or Random Effects?
The question is
usually asked which econometric model an investigator should use when modelling
with panel data. The different models can generate considerably different results
and this has been documented in many empirical studies. In terms of a model
where time effects are assumed absent for simplicity, the model to be estimated
may be given by:
Yit = ai+ bXit + uit
The question,
therefore, is do we treat aias
fixed or random? The following points are worth noting.
·The
estimation of the fixed effects model is costly in terms of degrees of freedom.
This is a statistical and not a computing cost. It is particularly problematic
when N is large and T is small. The occurrence of large N and small T currently tends to characterize most panel data applications
encountered.
·The aiterms are taken to
characterize (for want of a better expression) investigator ignorance. In the
fixed effects model does it make sense to treat one type of investigator
ignorance (ai) as fixed
but another as random (uit)?
·The
fixed effects formulation is viewed as one where investigators make inferences
conditional on the fixed effects in the sample.
·The
random effects formulation is viewed as one where investigators make
unconditional inferences with respect to the population of all effects.
·The
random effects formulation treats the random effects as independent of the
explanatory variables (i.e. E(aiXit) = 0). Violation of this assumption leads to bias
and inconsistency in the b
vector.
Advantage
and disadvantage of the fixed effects model
The main
advantage of the fixed effects model is its relative ease of estimation and the
fact that it does not require independence of the fixed effects from the other
included explanatory variables. The main disadvantage is that it requires
estimation of N separate intercepts.
This causes problems because much of the variation that exists in the data may
be used up in estimating these different intercept terms. As a consequence, the
estimated effects (the bs)
for other explanatory variables in the regression model may be imprecisely
estimated. These might represent the more important parameters of interest from
the perspective of policy. As noted above the fixed effects estimator is
derived using the deviations between the cross-sectional observations and the
long-run average value for the cross-sectional unit. This problem is most
acute, therefore, when there is little variation or movement in the
characteristics over time, that is when
the variables are rarely-changing or they are time-invariant. In essence,
the effects of these variables are eliminated from the analysis.
Advantage
and disadvantage of the random effects model
The main
advantage of the random effects estimator is that it uses up fewer degrees of
freedom in estimation and allows for the inclusion
of time invariant covariates. The main disadvantage of the model is the
assumption that the random effects are independent of the included explanatory
variables. It is fairly plausible that there may be unobservable attributes not
included in the regression model that are correlated with the observable
characteristics. This procedure, unlike fixed effects, does not allow for the
elimination of the omitted heterogeneous effects.
The
Hausman Test
In determining
which model is the more appropriate to use, a statistical test can be
implemented. The Hausman test compares the random effects estimator to the
‘within’ estimator. If the null is rejected, this favours the ‘within’
estimator’s treatment of the omitted effects (i.e., it favours the fixed effects
but only relative to the random effects). The use of the test in this case is
to discriminate between a model where the omitted heterogeneity is treated as
fixed and correlated with the explanatory variables, and a model where the
omitted heterogeneity is treated as random and independent of the explanatory
variables.
·If
the omitted effects are uncorrelated with the explanatory variables, the random
effects estimator is consistent and efficient. However, the fixed effects
estimator is consistent but not efficient given the estimation of a large
number of additional parameters (i.e., the fixed effects).
·If
the effects are correlated with the explanatory variables, the fixed effects
estimator is consistent but the random effects estimator is inconsistent. The
Hausman test provides the basis for discriminating between these two models and
the matrix version of the Hausman test is expressed as:
[bRE– bFE][V(bFE) – V(bRE)]-1[bRE – bFE]′ ~ 𝝌²k
where k is the number of covariates (excluding
the constant) in the specification. If the random effects are correlated with
the explanatory variables, then there will be a statistically significant
difference between the random effects and the fixed effects estimates. Thus,
the null and alternative hypotheses are expressed as:
H0:
Random effects are independent of explanatory variables
H1: H0 is not
true.
The null
hypothesis is the random effects model and if the test statistic exceeds the
relevant critical value, the random effects model is rejected in favour of the
fixed effects model. In finite samples the inversion of the matrix
incorporating the difference in the variance-covariance matrices may be
negative-definite (or negative semi-definite) thus yielding non-interpretable
values for the chi-squared.
The selection of
one model over the other might be dictated by the nature of the application.
For example, if the cross-sectional units were countries and states, it may be
plausible to assume that the omitted effects are fixed in nature and not the
outcome of a random draw. However, if we are dealing with a sample of
individuals or firms drawn from a population, the assumption of a random
effects model has greater appeal. However, the choice of which model to choose
is ultimately dictated empirically. If it does not prove possible to
discriminate between the two models on the basis of the Hausman test, it may be
safest to use the fixed effects model, where the consequences of a correlation
between the fixed effects and the explanatory variables are less devastating
than is the case with the random effects model where the consequences of
failure result in inconsistent estimates. Of course, if the random effects are
found to be independent of the covariates, the random effects model is the most
appropriate because it provides a more efficient estimator than the
fixed effects estimator.
**This tutorial is culled from my lecture
note as given by Prof. Barry Reilly (Professor of Econometrics, University of
Sussex, UK).
How
to Perform the Hausman Test in Stata
First: Open
a log file, load data into Stata, use a do-file (to replicate your research)
Second: Inform
Stata that you are using a panel with ‘id’
the cross-sectional indicator and 'year'
the time period indicator to prepare for panel data analysis.
xtset
id year
Third:
Create year dummies (to capture time variations in the data)
tab
year, gen(yr)
Fourth: Run
the fixed effects model and store the results
eststo
fixed: xtreg y x1 x2 x3 x4 yr2 –
yr..., fe i(c_id)
Fifth: Run
the random effects model and store the results
eststo
random: xtreg y x1 x2 x3 x4 yr2 –
yr..., re i(c_id)
Sixth: Run
the Hausman test
hausman
fixed random
Seventh:
Interpret results: Reject the null
hypothesis if the prob-value is statistically significant at 5% level. It
implies that the individual effects (ai)
correlate with the explanatory variables. Therefore use the fixed effect
estimator to run the analysis. Otherwise, use the random effects estimator.
[Watch video tutorial on performing the
Hausman test in Stata]
If you still have
comments or questions regarding how to perform the Hausman test, kindly post
them in the comments section below…..
In econometrics, time series data are frequently used and they
often pose distinct problems for econometricians. As it will be discussed with
examples, most empirical work based on time series data assumes that the
underlying series is stationary. Stationarity of a series (that is, a variable)
implies that its mean, variance and covariance are constant over time. That is,
these do not vary systematically over time. In order words, they are timeinvariant.
However, if that is not the case, then the series is nonstationary. We will
discuss some possible scenarios where two series, Y and X,
are nonstationary and the error term, u, is also nonstationary. In
that case, the error term will exhibit autocorrelation. Another likely scenario
is where Y and X are nonstationary, but u is
stationary. The implications of this will also be explored. In time series
analysis, the words nonstationary, unit root or random
walkmodel are used synonymously. In essence, of a series
is considered to be nonstationary, it implies that such exhibit a unit root and
exemplifies a random walk series.
Regressing two series that
are nonstationary, likewise, yields a spurious (or nonsense) regression. That
is, a regression whose outcome cannot be used for inferences or forecasting. In
short, such results should not be taken seriously and must be discarded. A
stationary series will tend to return to its mean (called mean
reversion) and fluctuations around this mean (measured by its variance) will
have a broadly constant breadth. But if a time series is not stationary in the
sense just explained, it is called a nonstationary time series such will have a
time-varying mean or a time-varying variance or both. In summary, a stationary
time series is important because if such is nonstationary, its behaviour can be
studied only for the time period under consideration. That is, each set of time
series data will therefore be for a particular episode. As a result, it is not
possible to generalise its relevance to other time periods. Therefore, for the
purpose of forecasting, such (nonstationary) time series may be of little
practical value
How to detect unit
root in a series?
In a bivariate (2 variables)
model or that involving multiple variables (called a multiple regression
model), it is assumed that all the variables are stationary at level (that is,
the order of integration of each of the variable is zero, I(0). It
is important to state at this point, that the order of integration of a series
in a regression model is determined by the outcome of a unit root test (or
stationarity test). If the series is stationary at level after performing unit
root test, then it is I(0), otherwise it is I(d)
where d represents the number of times the series is
differenced before it becomes stationary. But what if the assumption of stationarity
at level of the series in a bivariate or multiple regression model is
relaxed and we consequently allow for a unit root in each of the variables in
the model, how can this be corrected? In general, this would require a
different treatment from a conventional regression with stationary variables
at I(0).
In particular, we focus on a
class of linear combination of unit root processes known as cointegrated
process. The generic representation for the order of integration of series
is I(d) where d is the number of
differencing to render the series stationary. Hence, a stationary series at
level, d = 0 is a series with an I(0) process.
Although, for any non-stationary series, ‘d’ can assume any
value greater than zero, however, in applied research, only the unit root
process of I(1) process is allowed, otherwise such series with
higher order of integration (d > 1) should be excluded in the
model as no meaningful policy implications or relevance can be drawn from such
series.
Here is an example of a
bivariate linear regression model:
Yt = 𝛂₀ + bXt + ut
[1]
Assume Ytand Xt
are two random walk models that are I(1) processes and are
independently distributed as:
Yt = ρYt-1 + vt,
-1
≤ ρ ≤ 1
[2]
Xt = ղXt-1 + et,
-1 ≤ ղ ≤
1
[3]
and vt and et have
zero mean, a constant variance and are orthogonal (these are white
noise error terms).
We also assumed that vt and et are
serially uncorrelated as well as mutually uncorrelated. As stated in [2] and
[3], both these time series are nonstationary; that is, they are I(1)
or exhibit stochastic trends. Suppose we regress Yton Xt.
Since Yton Xt are
uncorrelated I(1) processes, the R2 from
the regression of Y on X should tend to zero;
that is, there should not be any relationship between the two variables.
Equations [2] and [3] resemble the Markov first-order autoregressive model. If ρ
and ղ = 1, the equations become a random walk model without drift. If
ρ and ղ are in fact 1, then a unit root problem surfaces, that is, a
situation of nonstationarity; because we already know that in this case the
variance of Yt is not stationary. The name unit
root is due to the fact that ρ = 1. Again, the terms nonstationary, random
walk, and unit root can be treated as synonymous. If, however, |ρ| ≤ 1, and
|ղ| ≤ 1, that is if their absolute values are less than one, then it can
be shown that both series Yt and Xt are
stationary. In practice, then, it is important to find out if a time series
possesses a unit root.
Given equations [2] and [3],
there should be no systematic relationship between Yt and Xt as
they both drift away from equilibrium (i.e. they do not converge), and
therefore, we should expect that an ordinary least squares (OLS) estimate
of b should be close to zero, or insignificantly different
from zero, at least as the sample size increases. But this is not usually the
case. The fitted coefficients in this case may be statistically significant
even when there is no true relationship between the dependent variable and the
regressors. This is regarded as a spurious regression or correlation where, in
the case of our example, b takes any value randomly, and
its t-statistic indicates significance of the estimate.
But how can unit root
be detected? There are some clues that tell you if a series is
nonstationary and if the regression of bivariate or multivariate relationships
are spurious. Some of these are:
1. Do a graphical plot of the series to visualise
the nature. Is it trending upwards or downwards? Does it exhibit a
mean-reversion or not? Or are there fluctuations around its mean?
2. Or carry out a regression analysis on two series
and observe the R2. If it is above 0.9, it may suggest
that the variables are nonstationary.
3. The rule-of-thumb: if the R2 obtained
from the regression is higher than the Durbin Watson (DW) statistic. The low DW
statistic evidences positive first order auto-correlation of the error terms.
Using Gujarati and Porter Table 21.1 quarterly data of 1970q1 to 1991q4, examples of
nonstationary series and spurious regression can be seen from the pce, pdi and gdp relationship.
Since the series are measured in billions of US dollars, the natural logarithms
of the variables will be used in analysing their essential features.
Nonstationary series: the
graphical plot of the three variables shows an upward trend and none of the
variables revert to their means. That is, all three variables do not exhibit
mean reversions. That clearly tells us that the series are nonstationary.
Stata: Plot of nonstationary series
Source: CrunchEconometrix
Note: Use
this syntax to generate the graph: line
lnpce lnpdi lngdp qtrly, legend(size(medsmall))
What is a spurious
regression? Sometimes we expect to find no relationship between two variables,
yet a regression of one on the other variable often shows a significant
relationship. This situation exemplifies the problem of spurious, or nonsense,
regression. The regression of lnpce on lnpdi shows
how spurious regressions can arise if time series are not stationary. As
expected, because both variables are nonstationary, the result evidences that a
spurious regression has been undertaken.
But how do we know this? Take
a look at the R2 the value of 0.9944 is
higher than the Durbin Watson statistic of 0.57. So, whenever
the R2 > DW, a spurious regression has occurred
because the variables are nonstationary.
Stata syntax: regress lnpce lnpdi
Stata: Example of a spurious regression
Source: CrunchEconometrix
As you can see, the coefficient
of lnpdi is highly statistically significant, and the R2 value
is statistically significantly different from zero. From these results, you may
be tempted to conclude that there is a significant statistical relationship
between both variables, whereas a priori there may or
may not be none. This is simply the phenomenon of spurious
or nonsense regression, first discovered by Yule (1926). He showed that
(spurious) correlation could persist in nonstationary time series even if the
sample is very large. That there is something wrong in the preceding regression
is suggested by the extremely low Durbin–Watson value, which suggests very
strong first-order autocorrelation. According to Granger and Newbold, R2 >
DW is a good rule of thumb to suspect that the estimated regression is
spurious, as in the given example.
Why is it important
to test for stationarity?
We usually consider a
nonstationary series for the following reasons:
1.To evaluate the behaviour of series over time. Is the series
trending upward or downward? This can be verified from performing a
stationarity test. In other words, the test can be used to evaluate the
stability or predictability of time series. If a series is nonstationary, that
means the series is unstable or unpredictable and therefore may not be valid
for inferences, prediction or forecasting.
2.To know how a series responds to shocks requires carrying out a
stationarity test. If such series is nonstationary, the impact of shocks to the
series are more likely to be permanent. Consequently, if a series is
stationary, impact of shocks will be temporary or brief.
How to correct for
nonstationarity?
What can be done with
nonstationarity in a time series knowing that performing OLS on such a model
yields spurious regression?
The Unit Root Test
We begin with equations [2]
and [3] which are unit root (stochastic) processes with white noise error
terms. If the parameters of the models are equal to 1, that is, in the case of
the unit root, both equations become random walk models without drift, which we
know is a nonstationary stochastic process. So, what can be done to correct
this? For instance, for equation [2], simply regress Yt on
its (one-period) lagged value Yt−1 and find out if
the estimated ρ is statistically equal to 1? If it is, then Yt is
nonstationary. Repeat same for the Xt series. This
is the general idea behind the unit root test of stationarity.
For theoretical reasons,
equation [2] is manipulated as follows: Subtract Yt−1 from
both sides of [2] to obtain:
Yt - Yt-1 = ρYt-1 - Yt-1 + vt
[4]
= (ρ - 1)Yt-1 + vt
and this can be stated
alternatively as:
⃤ Yt = δYt-1 + vt
[5]
where δ = (ρ − 1)
and ⃤, as usual, is the first-difference operator. In practice, therefore,
instead of estimating [2], we estimate [5] and test the null hypothesis
that δ = 0. If δ = 0, then ρ = 1, that is we have a unit
root, meaning the time series under consideration is nonstationary.
Before we proceed to
estimate [5], it may be noted that if δ = 0, [5] will become:
⃤ Yt = Yt-1 - Yt-1 = vt
[6]
(Remember to do the same
for Xt series)
Since vt is
a white noise error term, it is stationary, which means that the first
difference of a random walk time series is stationary.
Stata: Example of a stationary series
Source: CrunchEconometrix
Visual observation of the
differenced series shows that the three variables are stationary around the mean.
They all exhibit constant mean-reversions. That is, they fluctuate around 0. If
we are to draw a trend line, such a line will be horizontal at 0.01.
Okay, having said all that.
Let us return to estimating equation [5]. This is quite simple, all that is
required is to take the first differences of Yt and
regress on Yt−1 and see if the estimated slope
coefficient in this regression is statistically different from is zero or not.
If it is zero, we conclude that Yt is
nonstationary. But if it is negative, we conclude that Yt is
stationary.
Note: Since
δ = (ρ − 1), for stationarity ρ must be less than one. For this to happen δ
must be negative!
The only question is which
test do we use to find out if the estimated coefficient of Yt−1 in
[5] is zero or not? You might be tempted to say, why not use the usual t test?
Unfortunately, under the null hypothesis that δ = 0 (i.e., ρ = 1), the t value
of the estimated coefficient of Yt−1 does not follow
the t distribution even in large samples; that is, it does not
have an asymptotic normal distribution.
What is the alternative?
Dickey and Fuller (DF) have shown that under the null hypothesis that δ = 0,
the estimated t value of the coefficient of Yt−1 in
[5] follows the τ (tau) statistic. These authors have
computed the critical values of the tau statistic on the basis
of Monte Carlo simulations.
Note: Interestingly,
if the hypothesis that δ = 0 is rejected (i.e., the time series is stationary),
we can use the usual (Student’s) t test.
The unit root test can be
computed under three (3) different null hypotheses. That is, under different
model specifications such as if the series is a:
1. random walk (that is, model has no
constant, no trend)
2. random walk with drift (that is, model
has a constant)
3. random walk with drift and a trend (that
is, model has a constant and trend)
In all cases, the null
hypothesis is that δ = 0; that is, there is a unit root and the alternative
hypothesis is that δ is less than zero; that is, the time series is stationary.
If the null hypothesis is rejected, it means that Yt is
a stationary time series with zero mean in the case of [5], that Yt is
stationary with a nonzero mean in the case of a random walk with drift model,
and that Yt is stationary around a deterministic
trend in the case of random walk with drift around a trend.
It is extremely important to
note that the critical values of the tau test to test the
hypothesis that δ = 0, are different for each of the preceding three
specifications of the DF test, which are now computed by all econometric
packages. In each case, if the computed absolute value of the tau
statistic (|τ|) exceeds the DF or MacKinnon critical tau
values, the null hypothesis of a unit root is rejected, in order words the
time series is stationary. On the other hand, if the computed |τ| does not
exceed the critical tau value, we fail to reject the null
hypothesis, in which case the time series is nonstationary.
Note: Students
often get confused in interpreting the outcome of a unit root test. For
instance, if the calculated tau statistic is -2.0872 and the
MacKinnon tau statistic is -3.672, you cannot reject the null
hypothesis. Hence, the conclusion is that the series is nonstationary. But if
the calculated tau statistic is -5.278 and the MacKinnon tau statistic
is -3.482, you reject the null hypothesis in favour of the alternative. Hence,
the conclusion is that the series is stationary.
*Always use the appropriate critical τ values
for the indicated model specification.
How to Perform Unit
Root Test in Stata (see here for EViews)
Several tests have
been developed in the literature to test for unit root. Prominent among these
tests are Augmented Dickey-Fuller, Phillips-Perron, Dickey-Fuller Generalised
Least Squares (DF-GLS) and so on. But this tutorials limits testing to the use
of ADF and PP tests. Once the reader has good basic knowledge of these two
techniques, they can progress to conducting other stationarity test on their
time series variables.
How to Perform the
Augmented Dickey-Fuller (ADF) Test
An important assumption of
the DF test is that the error terms are independently and identically
distributed. The ADF test adjusts the DF test to take care of possible serial
correlation in the error terms by adding the lagged difference terms of the
outcome (dependent) variable. For Yt series, in
conducting the DF test, it is assumed that the error term vt is
uncorrelated. But in case where it is correlated, Dickey and Fuller have
developed a test, known as the augmented Dickey–Fuller (ADF) test. This test is
conducted by “augmenting” the preceding three model specifications stated above
by adding the lagged values of the dependent variable.
As mentioned earlier,
approaches will be limited to using the ADF and PP tests. Either of these tests
can be used and when both are used, the reader can compare the outcomes to see
if there are similarities or differences in the results.
1.Using Gujarati and Porter Table 21.1 quarterly data on pce, pdi and gdp
2.Load data into Stata
3.We are considering the pair of lnpce and lnpdi in
natural logarithms (because variables are measured in US$ billions)
4.Inform Stata that you are about to perform a time series
analysis by typing this code into the Command
box: tsset qtrly
and
you will obtain this:
Stata: tsset command
Source: CrunchEconometrix
Stata now recognises
that you are about conducting a time series analysis using quarterly data from
1st quarter of 1970 to the 4th quarter of 1991. If you
don’t issue this command, Stata will not run your analysis.
Note: if you
are using a yearly data, type the syntax tsset
year and if it is a monthly data type tsset
month.
The Augmented Dickey-Fuller
(ADF) Test
Unit root test for lnpce:
·Go
to Statistics >> Time series >> Tests >> Augmented Dickey-Fuller unit
root test >> dialog box opens
·Under Options, the
choice of model is very important since the distribution statistic under the
null hypothesis differs across these three cases. Therefore, specify whether to
“suppress constant term”, “include trend
term”, or “include drift term”. Thus,
our demonstration will involve these options.
·If the “display regression
table” box is checked, Stata reports the test statistic together with the
estimated test regression.
·Depending on the structure of your data, include the number of “lagged differences”
Decision: The null hypothesis of a unit root is rejected
against the one-sided alternative hypothesis if the computed absolute value of
the tau statistic exceeds the DF or MacKinnon critical tau
values and we conclude that the series is stationary; otherwise (that is, if it
is lower), then the series is non-stationary.
Decision: Another way of stating this is that in failing to
reject the null hypothesis of a unit root, the computed τ value should be more negative
than the critical τ value. Since in general δ is expected to be negative, the
estimated τ statistic will have a negative sign. Therefore, a large negative τ
value is generally an indication of stationarity.
Decision: On the other hand, using the probability value, we
reject the null hypothesis of unit root if the computed probability value is
less than the chosen level of statistical significance.
Having specified the “suppress constant term” and
checked the “display regression table”
box, the ADF result is given as:
Note: the null hypothesis for the three ADF specifications cannotbe rejected at the 5% level, confirming that lnpce is nonstationary which is a confirmation of the graphical plot. Notice that the interpolated Dickey-Fuller tau statistic differ across all specifications.
Do same for the lnpdi series.
Having confirmed that lnpce is nonstationary, we need to run
the tests again using its first difference. So, the next thing to do is to
generate the first difference of lnpce
and run the test across the three specifications.
To generate the difference
variable, the syntax is:
generate dlnpce=d.lnpce
·1st difference with “suppress constant” option
result:
Having done the
first-difference analysis, and the trend term is not statistically significant,
we conclude that the null hypotheses of a unit root is rejected and that lnpce series is difference-stationary.
That is, lnpce is stationary at 1st difference with
a constant hence, carrying out a “2nd difference” test
is unnecessary.
Again, do same for the dlnpdi series.
How to Perform the
Phillips-Perron (PP) Test
Phillips and Perron use
nonparametric statistical methods to take care of the serial correlation in the
error terms without adding lagged difference
terms. Procedures for testing for unit root using the PP test differs a bit
from that of ADF.
·Go to Statistics >> Time series >>
Tests >> Phillips-Perron unit root
test >> dialog box opens
Fill the details of the
variables in the “Variable” box and
indicate which specification to run, then click OK. Or, you can use the following codes for the different
specifications:
For the “level” specification, the syntax is:
(For “Suppress constant term in regression”)
pperron lnpce, noconstant regress
(For “include trend term in regression”)
pperron lnpce, trend regress
For the “1st difference” specification, the syntax is:
(For “Suppress constant term in regression”)
pperron dlnpce, noconstant regress
(For “include trend term in regression”)
pperron dlnpce, trend regress
In comparing the results from both procedures, the same conclusion is arrived at. That is, lnpce is difference-stationary.
Note: The asymptotic distribution of the PP test is the
same as the ADF test statistic.
After unit root
testing, what next?
The outcome of unit root
testing matters for the empirical model to be estimated. The following
scenarios explain the implications of unit root testing for further
analysis.
Scenario 1:
When series under scrutiny are stationary in levels?
If pce and pdi are
stationary in levels, that is, they are I(0) series (integrated of
order zero). In this situation, performing a cointegration test is not necessary.
This is because any shock to the system in the short run quickly adjusts to the
long run. Consequently, only the long run model should be estimated. That
is, the model should be specified as:
pcet =
𝛂₀ + bpdit + ut
In essence, the estimation
of short run model is not necessary if series are I(0).
Scenario 2: When
series are stationary in first differences?
·Under this scenario, the series are assumed to be non-stationary.
·One special feature of these series is that they are of the same
order of integration.
·Under this scenario, the model in question is not entirely useless
although the variables are unpredictable. To verify further the relevance of
the model, there is need to test for cointegration. That is, can we
assume a long run relationship in the model despite the fact that the series
are drifting apart or trending either upward or downward?
·If there is cointegration, that means the series in question are
related and therefore can be combined in a linear fashion. This implies that,
even if there are shocks in the short run, which may affect movement in the
individual series, they would converge with time (in the long run).
·However, there is no long run if series are not cointegrated. This
implies that, if there are shocks to the system, the model is not likely to
converge in the long run.
·Note that both long run and short run models must be estimated
when there is cointegration.
·The estimation will require the use of vector autoregressive (VAR)
model analysis and VECM models.
·If there is no cointegration, there is no long run and therefore,
only the short run model will be estimated. That is, run only VAR no VECM
analysis!
·There are however, two prominent cointegration tests for I(I)
series in the literature. They are Engle-Granger cointegration test and
Johansen cointegration test.
·The Engle-Granger test is meant for single equation model while
Johansen is considered when dealing with multiple equations.
Scenario 3: The
series are integrated of different orders?
·Should in case lnpce and lnpdi are
integrated of different orders, like the second scenario, cointegration test is
also required but the use of either Engle-Granger or Johansen cointegration are
no longer valid.
·The appropriate cointegration test to apply is the Bounds test for
cointegration and the estimation technique is the autoregressive distributed
lag (ARDL) model.
·Similar to case 2, if series are not cointegrated based on Bounds
test, we are expected to estimate only the short run. That is run only the ARDL
model.
·However, both the long run and short run models are valid if there
is cointegration. That is run both ARDL and ECM models.
In addition, there are
formal tests that can be carried out to see if despite the behaviour of the
series, there can still be a linear combination or long run relationship or
equilibrium among the series. The existence of the linear combination is what
is known as cointegration. Thus, the regression with I(1) series
can either be spurious or cointegrated. The basic single equation cointegration
tests are Johansen, Engle-Granger and Bounds cointegration tests. These will be
discussed in detail in subsequent tutorials.
[Watch video clip on performing the ADF unit root test in Stata]
In conclusion, I have
discussed what is meant by nonstationary series, how can a series with a unit
root be detected, and how can such series be made useful for empirical
research? You are encouraged to use your data or the sample datasets uploaded
to this bog to practise in order to get more hands-on knowledge.