# How to test and diagnose VECM in STATA?

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:

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

The below figure will appear.

‘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.

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

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’.

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

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

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’.

‘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’.

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.

**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.623 | 201.22073 | 38773.238 | 39562.009 |

39974.993 | 336.61638 | 39315.237 | 40634.749 |

40698.917 | 420.85106 | 39874.064 | 41523.77 |

41558.835 | 481.19283 | 40615.715 | 42501.956 |

## bcdgfc |
## bcdgfc_SE |
## bcdgfc_LB |
## bcdgfc_UB |

10522.74 | 184.93499 | 10160.274 | 10885.206 |

10587.456 | 249.05729 | 10099.313 | 11075.599 |

10291.868 | 303.42519 | 9697.1655 | 10886.57 |

10896.363 | 342.23838 | 10225.588 | 11567.138 |

## bcdpfc |
## bcdpfc_SE |
## bcdpfc_LB |
## bcdpfc_UB |

22982.765 | 187.45083 | 22615.368 | 23350.162 |

22858.882 | 216.86206 | 22433.84 | 23283.924 |

23486.921 | 241.51248 | 23013.565 | 23960.277 |

24138.938 | 261.08742 | 23627.216 | 24650.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