How to test and diagnose VECM in STATA?

By Divya Dhuria & Priya Chetty on October 4, 2018

The previous article estimated Vector Error Correction (VECM) for time series Gross Domestic Product (GDP), Gross Fixed Capital Formation (GFC)Private Final Consumption (PFC ). This article explains testing and diagnosing VECM in STATA to ascertain whether this model is correct or not. Among diagnostic tests, common ones are tested for autocorrelation and test for normality.

LM test for residual autocorrelation and diagnosing VECM

To start with the test for autocorrelation, follow these steps:

  1. Click on ‘Statistics’ on the main tab.
  2. Select ‘Multivariate Time Series’.
  3. Select ‘VEC diagnostics and test’.
  4. Click on ‘LM test for residual autocorrelation’.

The below figure will appear.

Figure 1: Pathway for testing and diagnosing VECM in STATA
Figure 1: Pathway for testing and diagnosing VECM in STATA

‘Veclmar’ window will appear as shown in the figure below. Select the maximum order of autocorrelation and specify vec model, for instance, 2. It is important to perform LM diagnostic tests after VECM such to use the active vec model.

Figure 2: LM test for residual autocorrelation window for testing diagnosing VECM in STATA
Figure 2: LM test for residual autocorrelation window for testing and diagnosing VECM in STATA

The result for auto-correlation will appear as shown in the figure below. The command for autocorrelation after VECM also appears in the result window. Alternatively, use the below command to derive results:

veclmar
Figure 3: LM test for residual autocorrelation results for diagnosing and testing VECM in STATA
Figure 3: LM test for residual autocorrelation results for testing and diagnosing VECM in STATA

The null hypothesis states that no autocorrelation is present at lag order. Although at lag 1, p values are significant, indicating the presence of autocorrelation, at lag 2, the p values are again insignificant. Therefore accept the null hypothesis. Hence it means at lag 2, the VECM model is free of the problem of autocorrelation.

Normality test for VECM

Perform the normality test for  VECM using the Jarque-Bera test following the below steps :

  • Click on ‘Statistics’ on the main bar.
  • Select ‘Multivariate Time Series’.
  • Select ‘VEC diagnostics and test’.
  • Click on ‘Test for normally distributed disturbance’.
Figure 4: Pathway for normality test for VECM in STATA
Figure 4: Pathway for normality test for VECM in STATA

‘vecnorm’ window will appear as shown in the figure below.  Only choose ‘Jarque–Bera test’ and click on ‘OK’.

Figure 5: 'vecnorm' indow for normality of VECM in STATA
Figure 5: ‘vecnorm’ window for normality of VECM in STATA

The result for normality will appear. The command for normality after VECM appears in the result window. Alternatively, use the below command to derive results:

vecnorm, jbera
Figure 6: Normality results for VECM in STATA
Figure 6: Normality results for VECM in STATA

The null hypothesis states that the residuals of variables are normally distributed. Apart from GFC, p values all other variables are significant, indicating the null hypothesis is rejected. Therefore residuals of these variables are not normally distributed. Therefore, this VECM model carries the problem of normality.

Forecasting using VECM in STATA

Further, to forecast the values of GDP, GFC and PFC using VECM results, follow these steps as shown in the figure below:

  • Click on ‘Statistics’ on the main bar.
  • Select ‘Multivariate Time Series’.
  • Select ‘Dynamic Forecasts’.
  • Click on ‘Compute Forecasts’.
Figure 7: Pathway for generating forecasts using VECM in STATA
Figure 7: Pathway for generating forecasts using VECM in STATA

‘fcast’ window will appear (figure below). Choose a prefix (in this case, “bcd”). Then select the period to be forecast. In this case, the values of the time series till four quarters, therefore select ‘4’.

Figure 8: Window for forecasting using VECM in STATA
Figure 8: Window for forecasting using VECM in STATA

The window does not reveal the results of the forecast. Rather, they appear in the data editor window as newly created variables. The table below shows the forecast for the case.

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

Forecasts for GDP, GFC and PFC

bcdgdp
bcdgdp_SE
bcdgdp_LB
bcdgdp_UB
39167.623201.2207338773.23839562.009
39974.993336.6163839315.23740634.749
40698.917420.8510639874.06441523.77
41558.835481.1928340615.71542501.956
bcdgfc
bcdgfc_SE
bcdgfc_LB
bcdgfc_UB
10522.74184.9349910160.27410885.206
10587.456249.0572910099.31311075.599
10291.868303.425199697.165510886.57
10896.363342.2383810225.58811567.138
bcdpfc
bcdpfc_SE
bcdpfc_LB
bcdpfc_UB
22982.765187.4508322615.36823350.162
22858.882216.8620622433.8423283.924
23486.921241.5124823013.56523960.277
24138.938261.0874223627.21624650.66

Table 1: Forecasts for GDP, GFC and PFC

Therefore the analysis of Vector Auto Correlation (VAR) and VECM assumes a short run or long run causality among the variables. The next article will extend this analysis by incorporating the effects of volatility in time series. More specifically, it will focus upon the Autoregressive Conditionally Heteroskedastic (ARCH) Model.

Discuss

4 thoughts on “How to test and diagnose VECM in STATA?”