# Lag selection and cointegration test in VAR with two variables

By Divya Dhuria and Priya Chetty on September 27, 2018

The previous article showed that the three-time series values Gross Domestic Product (GDP), Gross Fixed Capital Formation (GFC), and Private Final Consumption (PFC) are non-stationary. Therefore they may have long-term causality. The general assumption, in this case, is that consumption PFC affects GDP, therefore these variables might be cointegrated. Resultantly, they may lead to an estimation of a stationary variable. Johansen cointegration test in Vector Auto Regression (VAR) with two variables will help check the same.

1. Click on ‘Statistics’ on the result window
2. Choose ‘Multi-variate Time Series’
3. Click on ‘VAR Diagnostic and Test’
4. Select ‘Lag-order selection statistics’.

The below screen will appear. Figure 1: Steps for lag selection parameters to perform cointegration test in VAR using two variables in STATA

When clicked on ‘lag-order selection statistics’, a varsoc window will open in STATA as shown in figure 2. In the varsoc window, select two components on the main page: the list of dependent variables (GDP and PFC), and the maximum lag order. Here the maximum lag order refers to the maximum lag you want to check for the results.

In ‘Dependent variables’, select the main variables GDP and PFC. After selection for both dropdowns, click on ‘OK’.

After clicking on ‘OK’, the results will appear in the output window (figure 4). Here the STATA command for lag selection parameters is also visible. Use this command alternatively to generate the result.

##### Command
`varsoc gdp pfc, max lag (8)`

The results table will show the number of lags in the first column and a number of parameters. Select the optimal lags, like, Final Prediction Error (FPE), Akaike Information Criterion (AIC), Hannan Quinn Information Parameters (HQIC), and Schwartz Information Parameters (SBIC). STATA will compute four information parameters as well as a sequence of likelihood ratio tests.

## Identify the number of lags

To identify the number of lags, select the values showing.

For instance, in the values for FPE, value at lag 3 carries the sign.

Therefore, the lag as per FPE parameters is 3. Following the same rule, the lag as per AIC is also 3, and as per HQIC and SBIC is 2. To select parameters with optimal lags for VAR, follow the majority. That means if three or four out of four parameters show the same number of lags (let’s say 3), then take 3 lags. However, in this case, a majority cannot be followed since two parameters show ‘2’ and the other two others show ‘3’. Hence, since the number of observations, in this case, is more than 60, follow AIC and FPE parameters. Therefore, the number of lags selected for the present case is 3.

Use 5E25A5EE63214 to save 5000 on 15001 - 20000 words standard order of literature survey service.

## Johansen cointegration test

Johansen cointegration test, also known as the eigenvalue test or trace test, is a likelihood ratio test. There are two tests under Johansen cointegration; maximum eigenvalue test, and trace test. For both test statistics, the initial Johansen test is a test of the null hypothesis of no cointegration against the alternative of cointegration. The null hypothesis for this test differs in the case of differing ranks. For clarity, the Johansen cointegration test is performed for variables GDP and PFC. Follow these steps to start (figure below):

1. Click on ‘Statistics’ on ‘Result’ window
2. Select ‘Multivariate Time-series’
3. Select ‘Co-integrating rank of a VECM’.

‘Vecrank’ window will open in STATA (figure below). In this window, select values for two drop-down options; dependent variables and maximum lags for underlining VAR Model.

In the ‘Dependent variables’ option, select two-time series variables GDP and PFC. Since co-integration analysis takes the case of non-stationary variables to check for causality, take GDP and PFC instead of their first differences. Then select the number of lags. In this case, the lag selected parameters were conducted in a previous analysis, therefore, the number of lags here is 3.

After selecting for lag, click on the ‘Reporting’ tab of the vecrank window and click on ‘Report maximum-eigenvalue statistic’ (figure below). Click on ‘OK’. Figure 7: Reporting page of vecrank window on STATA for Johansen cointegration test in VAR with two variables

The results for the Johansen cointegration test will appear in the window (figure below). Here the STATA command of Johansen cointegration test will also appear.

##### Command
`vecrank gdp pfc, trend(constant) max`

The result of the Johansen co-integration test can be interpreted in parts. Converge the focus towards three columns; maximum rank, trace statistics or max statistics, and critical values.

### Maximum rank zero

Starting from maximum rank zero, the null and alternative hypotheses are as follows:

• Null Hypothesis: There is no cointegration
• Alternative Hypothesis: There is cointegration

As the figure above shows, at maximum rank zero, the trace statistic (5.8121) do not exceed critical values (15.41). Therefore the null hypothesis cannot be rejected. Also, this suggests that the time series variables GDP and PFC are not cointegrated. Similarly, for max statistics, the value 3.5250 does not exceed the critical value of 14.07, thus suggesting a similar result that the null hypothesis cannot be rejected. Thus, as per maximum rank 0, GDP and PFC are not cointegrated. Following the above results, apply unrestricted VAR to time series GDP and PFC.

## VAR Model

1. Click on ‘Statistics’
2. Select ‘Multivariate Time Series’
3. Select ‘VAR’

The figure below will appear.

In the ‘Dependent variables’ option, select the two-time series variables GDP and PFC. Next, select the number of lags (figure below). The number of lags for this case is the same as the previous analysis, i.e. 3.

The figure below shows the results of the VAR test. The results are in two parts. While the first one assumes GDP as a dependent variable, the second one assumes PFC as a dependent variable. Since the aim is to verify the effect of PFC on GDP, the first part is more relevant. As per the results:

1. Only lag 1 of PFC is significantly identified having an effect on GDP.
2. R square for GDP model is also 99% verifying the goodness of fit.
3. Log-likelihood value 1064 is also highest, further indicating consistency.
4. The constant identified in GDP model is also significant with 0 p-values.