Sie sind auf Seite 1von 10

Macroeconometrics sections

dr Piotr Wjcik
2010/2011

Lab 4. Non-stationarity and its testing, cointegration testing and Error Correction Model
4.1. Non-stationarity and its testing ADF, KPSS and PP tests
Non-stationarity of time series is an important problem as it tremendously impacts the way in which data should be treated. Non-stationary data cannot be analyzed with traditional econometric techniques as in case of non-stationarity some basic model assumptions are not met and correct reasoning on relationships between non-stationary time-series is impossible. Thats why it is so important to be able to test stationarity of the data. The easiest way is to draw a figure of the series and visually inspect it. Data DHSY.wf1. Lets start with a plot of variable cons.
CONS
450,000 400,000 350,000 300,000 250,000 200,000 150,000 100,000 50,000 80 82 84 86 88 90 92 94 96 98 00 02 04 06

From the above figure it is obvious that consumption series is not stationary since it is increased upward as time changes. However increasing pattern of the series is not always an indication of non-stationarity. The process might be stationary around the trend line - it is called deterministic non-stationarity. How can we transform the time series data from nonstationary to stationary? We need to work on differenced series. But will taking first differences be enough to obtain stationarity (for economic time series most of the time taking first differences is enough)? To answer that question we need to run a formal test. The most popular test of non-stationarity (unit root) is the (Augmented) Dickey-Fuller test with null hypothesis of non-stationarity. In Eviews You can get results for three different variants of the test: without constant and trend, with constant only and with constant and trend the middle variant is the most commonly used one. Whenever conducting any statistical test remember that what one really needs to know is the null hypothesis and the p-value (probability) of the test statistic. Tests are always done at some confidence level and whenever the p-value of the test statistic is lower than assumed confidence level the null hypothesis is rejected. When the opposite is true - pvalue is higher than , the null cannot be rejected (remember that in statistics one never accepts statistical hypothesis). Lets run ADF test for consumption series. 1

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

View Unit Root Test

One needs to choose from wide range of tests, select if it will be conducted for variable in levels, its first or second differences. Then one has to choose whether to include a constant and/or trend and if the number of lags in test augmentation should be chosen automatically (based on information criteria) or by user. Lets leave the default settings. Null Hypothesis: CONS has a unit root Exogenous: Constant Lag Length: 8 (Automatic - based on SIC, maxlag=12) t-Statistic Augmented Dickey-Fuller test statistic Test critical values: 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values. We cannot reject the null about non-stationarity. As ADF test does not have strong power, one can verify the decision by using for example KPSS or PP test. Please note that in case of KPSS test the null hypothesis is different: it assumes stationarity of the variable of interest. Philips-Perron test has the same null hypothesis as ADF. View Unit Root Test 0.751908 -3.498439 -2.891234 -2.582678 Prob.* 0.9927

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

Null Hypothesis: CONS is stationary Exogenous: Constant Bandwidth: 9 (Newey-West automatic) using Bartlett kernel LM-Stat. Kwiatkowski-Phillips-Schmidt-Shin test statistic Asymptotic critical values*: 1% level 5% level 10% level *Kwiatkowski-Phillips-Schmidt-Shin (1992, Table 1) The results differ from ADF test as KPSS does not provide a p-value, showing different critical values instead. In this case we compare the test statistic value with the critical value on desired significance level. If the test statistic is higher than the critical value, we reject the null hypothesis and when test statistic is lower than the critical value, we cannot reject the null hypothesis. Knowing that we can observe that KPSS test results for consumption series are in line with the above ADF test. We reject the null hypothesis, so consumption is not stationary. Philips-Perron test Null Hypothesis: CONS has a unit root Exogenous: Constant Bandwidth: 8 (Newey-West automatic) using Bartlett kernel Adj. t-Stat Phillips-Perron test statistic Test critical values: 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values. In PP test the null hypothesis is analogous to ADF. We cannot reject the null about nonstationarity of consumption. 3 0.978450 -3.493129 -2.888932 -2.581453 Prob.* 0.9962 1.116440 0.739000 0.463000 0.347000

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

Next we will check if first differences of consumption are a stationary process. We can do this simply by checking additional option in Unit Root test window: View Unit Root Test Lets select testing for first differences instead of levels. ADF test Null Hypothesis: D(CONS) has a unit root Exogenous: Constant Lag Length: 7 (Automatic - based on SIC, maxlag=12) t-Statistic Augmented Dickey-Fuller test statistic Test critical values: 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values. KPSS test Null Hypothesis: D(CONS) is stationary Exogenous: Constant Bandwidth: 8 (Newey-West automatic) using Bartlett kernel LM-Stat. Kwiatkowski-Phillips-Schmidt-Shin test statistic Asymptotic critical values*: 1% level 5% level 10% level *Kwiatkowski-Phillips-Schmidt-Shin (1992, Table 1) PP test Null Hypothesis: D(CONS) has a unit root Exogenous: Constant Bandwidth: 7 (Newey-West automatic) using Bartlett kernel Adj. t-Stat Prob.* 0.255785 0.739000 0.463000 0.347000 -2.753939 -3.498439 -2.891234 -2.582678 Prob.* 0.0688

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

Phillips-Perron test statistic Test critical values: 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values.

-11.33818 -3.493747 -2.889200 -2.581596

0.0000

The ADF test result shows that first differences of consumption are still nonstationary, but the p-value is close to 5%. The two remaining tests (with higher power) indicate that first differences of the series are already stationary. Lets plot these first differences. To do that we need to have differenced values stored as a new variable. Therefore we generate new series of first differences by writing: genr dcons = d(cons) in command window and then plot it.
Differenced CONS
30,000

20,000

10,000

-10,000

-20,000

-30,000 80 82 84 86 88 90 92 94 96 98 00 02 04 06

Exercises 4.1
Exercise 4.1.1 Plot a figure of income (inc) from DHSY.wf1. What conclusions about stationarity can You draw?

Exercise 4.1.2 Test formally (non)stationarity of income.

Exercise 4.1.3 Test formally (non)stationarity of first differences of income. What is the level of integration of that series?

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

4.2. modeling long run relationships; cointegration definition and testing


Dane DHSY.wf1 Cointegration means the long run relationship between non-stationary time series. If there are series (two or more) that are individually non-stationary (have to be integrated of the same order), but there exists their linear combination which is stationary - we call it cointegration. Visual inspection of the series expected to be cointegrated is always a good idea. Lets start with the plot of consumption and income on one graph.
500,000

400,000

300,000

200,000

100,000

0 80 82 84 86 88 90 92 94 96 INC 98 00 02 04 06

CONS

We will test cointegration by two-step Engle-Granger procedure. Both variables have to be integrated of the same order. So in the beginning we check the order of integration of consumption and income (ADF test) we already did it, both are I(1). Because both series are integrated of the same order, we can test cointegration between them, so lets start Engle-Granger procedure. First we run a simple regression of one variable on the other saving the residuals. Open variables as a group and select Proc Make Equation making a regression of one on the other (eg. cons on inc). Dependent Variable: CONS Method: Least Squares Date: XX/XX/XX Time: XX:XX Sample (adjusted): 1980Q1 2006Q2 Included observations: 106 after adjustments Variable Coefficient Std. Error t-Statistic Prob.

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

INC C

0.859174 -4527.759

0.003458 947.5534

248.4531 -4.778368

0.0000 0.0000

The coefficients of the regression are parameters of the potential cointegrating vector. Lets save model residuals (from regression results window select Proc Make Residual Series) under a default name resid01. Second step of testing cointegration is checking the stationarity of saved residuals. If residuals are stationary, there is a cointegrating relationship between analyzed variables. If residuals are non-stationary - cointegration does not exist. Lets use ADF and KPSS tests again. Null Hypothesis: RESID01 has a unit root Exogenous: Constant Lag Length: 4 (Automatic - based on SIC, maxlag=12) t-Statistic Augmented Dickey-Fuller test statistic Test critical values: 1% level 5% level 10% level -2.348439 -3.496346 -2.890327 -2.582196 Prob.* 0.1591

Null Hypothesis: RESID01 is stationary Exogenous: Constant Bandwidth: 9 (Newey-West automatic) using Bartlett kernel LM-Stat. Kwiatkowski-Phillips-Schmidt-Shin test statistic Asymptotic critical values*: 1% level 5% level 10% level *Kwiatkowski-Phillips-Schmidt-Shin (1992, Table 1) The ADF test used here has the null hypothesis of non-stationarity, so lack of cointegration. The result indicates that we cannot reject the hypothesis, that there is no cointegration between consumption and income. However if we conduct KPSS test its test statistic is equal to 0.065520 and is lower than any of critical values provided, so we cannot reject the null hypothesis about stationarity of residuals. As KPSS test is more powerful finally we conclude that cointegration between consumption and income exists. 0.065520 0.739000 0.463000 0.347000

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

A note: the critical values of ADL test for cointegration (applied to residuals from regression) are different than those for an ADL test for data series. However often the latter are used as an approximation of the first. What is the cointegrating vector and how to interpret it?

Exercise 4.2
Test the existence of cointegration between lcons and linc series. Save the residuals from the cointegrating equation.

4.3. ECM model (Error Correction Mechanism)


After having found cointegration we can build an Error Correction Model including short term and long term relationships. For a relationship between consumption and income the simplest ECM model on quarterly data would take a form:

where 1 will be interpreted as short run reactions of consumption to changes in income and 2 will show the speed of return in direction of the long run relationship in case of shocks. Therefore 2 is expected to be negative. Parameter is a part of cointegrating vector and in fact instead of (const41inct4) we will use the residuals saved in the Engle-Granger cointegration testing procedure. Lets estimate the model. First we generate new variables using command window: genr d4cons=cons-cons(-4) genr d4inc=inc-inc(-4) And estimate the equation using resid01 (residuals from regression of consumption on income): Quick Es mate equa on d4cons d4inc resid01(-4) c Dependent Variable: D4CONS Method: Least Squares Date: XX/XX/XX Time: XX:XX Sample (adjusted): 1981Q1 2006Q2 Included observations: 102 after adjustments Variable D4INC Coefficient 0.809292 Std. Error 0.014721 t-Statistic 54.97558 Prob. 0.0000

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

RESID01(-4) C R-squared Adjusted R-squared S.E. of regression Sum squared resid Log likelihood F-statistic Prob(F-statistic)

-0.247943 794.4788 0.968726 0.968094 2718.707 7.32E+08 -949.8162 1533.269 0.000000

0.067714 342.9067

-3.661614 2.316895

0.0004 0.0226 12512.98 15220.38 18.68267 18.75988 18.71393 1.376130

Mean dependent var S.D. dependent var Akaike info criterion Schwarz criterion Hannan-Quinn criter. Durbin-Watson stat

The model seems to be correct as the coefficient at error correction term is negative and statistically significant. However, the value of Durbin Watson statistic is quite low (1.376130), suggesting positive first order autocorrelation of residuals. The easiest solution would be to add autoregression to the model, so include among independent variables the lagged value(s) of consumption differential or lagged error terms (assuming autoregressive residual structure). Lets estimate below model:

Quick Es mate equa on d4cons d4inc resid01(-4) ar(1) c Dependent Variable: D4CONS Method: Least Squares Date: XX/XX/XX Time: XX:XX Sample (adjusted): 1981Q2 2006Q2 Included observations: 101 after adjustments Convergence achieved after 6 iterations Variable D4INC RESID01(-4) C AR(1) R-squared Adjusted R-squared S.E. of regression Sum squared resid Log likelihood F-statistic Prob(F-statistic) Coefficient 0.799382 -0.159899 964.3709 0.367881 0.972255 0.971396 2582.178 6.47E+08 -934.7673 1133.022 0.000000 Std. Error 0.019522 0.061641 493.4736 0.099494 t-Statistic 40.94716 -2.594017 1.954250 3.697506 Prob. 0.0000 0.0110 0.0536 0.0004 12421.01 15267.78 18.58945 18.69302 18.63138 1.981408

Mean dependent var S.D. dependent var Akaike info criterion Schwarz criterion Hannan-Quinn criter. Durbin-Watson stat

Macroeconometrics sections
dr Piotr Wjcik
2010/2011

Inverted AR Roots

.37

How to interpret the results? Is AR(1) term enough to get rid of autocorrelation in residuals? Does the error correction mechanism exist?

Exercise 4.3
Estimate ECM model for log consumption and log income and interpret the results.

10

Das könnte Ihnen auch gefallen