# How to perform Granger causality test in STATA?

A previous article (Lag selection and cointegration test in VAR with two variables) in this module demonstrated the application of cointegration test in time series analysis. Applying Granger causality test in addition to cointegration test like *Vector Autoregression (VAR)* helps detect the direction of causality. It also helps to identify which variable acts as a determining factor for another variable. This article shows how to apply Granger causality test in STATA.

*VAR* model includes past values of other series to the series’ own history. Granger causality in a *VAR* model implies a correlation between current values of one variable and the past values of other variables. For example, consider two variables X and Y. If lagged values of X and Y can predict X, then Y will Granger-cause X. Conversely, if X influences Y, then X Granger-causes Y. This is called unidirectional causality because of one variable Granger-causes another variable. In some cases, both variables X and Y are found to be influenced by the other’s lagged values in addition to its own. This leads to a bidirectional causality.

## Declare time variable using *VAR* in STATA

Before performing the Granger causality test, declare the ‘time’ variable as follows. This article takes into consideration the same three variables as previous articles; **Gross Domestic Product (GDP)**, Private Final Consumption (PFC) and * GFC (Gross Fixed Capital Formation)* of India. The time period is 1997 to 2018.

To perform *VAR* in STATA, follow these steps:

- Go to ‘Statistics’ on Result window
- Go to ‘Multivariate time series’
- Click on ‘Vector autoregression (VAR)’.

The below figure will appear. Choose the dependent variables in the box, i.e. gdp, gfcf, pfce. Select number of lags, i.e. 2. Then click on ‘OK’.

Alternatively, use the following STATA command for *VAR*:

VAR pfcegfcfgdp, lags(1/2)

The below results will appear.

Next, perform the Granger causality test to examine the direction of causality between the variables.

**5E3BCCB908B47**to save

**6000**on

**6001 - 10000 words**standard order of

**research analysis**service.

^{}## Granger causality test

For executing the Granger causality test in STATA, follow these steps:

- Go to ‘Statistics’.
- Click on ’Multivariate time series’.
- Select ‘VAR diagnostics and tests’.
- Choose ‘Granger causality tests’.

The below figure will appear. Select ‘Use active or svar results’ and click on ‘OK’.

The null hypothesis for Granger causality test is:

- First equation: Lagged values of gfcf and gdp do not cause pfce.
- Second equation: Lagged values of pfce and gdp do not cause gfcf.
- Third equation: Lagged values of pfce and gfcf do not cause gdp.

## Results

The results of Granger causality test will appear.

### First row

The first row of the above figure shows that lagged values of gfcf cause pfce as p-value is equal to 0.05. However, because of the p value (0.436 > 0.05), lagged values of gdp do not cause pfce. Therefore the null cannot be rejected. The direction of causality is therefore from * GFC *to PFC.

### Second row

In the second row, p value for pfce is very small (0.0000 < 0.05). Therefore, the null hypothesis stating that that “lagged values of pfce do not cause gfcf” can be rejected at 5% level of significance. However, the null hypothesis that “lagged values of gdp do not cause gfcf” cannot be rejected as the corresponding p-value (0.588) is greater than 0.05. This implies that **GDP** does not Granger-cause ** GFC** and the direction of causality is from

__PFC__to

**.**

*GFC*### Third row

The results in the third row show that lagged values of both pfce and gfcf cause gdp. Since p values for both the variables are less than 0.05, accept the null hypothesis ‘lagged values of gfcf and pfce do not cause gdp’ at 5% level of significance. The direction of causality is from both ** GFC** and

__PFC__to

**GDP**.

Therefore the presence of Granger causality is as follows.

and*GFC*__PFC__– bidirectional Granger causality.__PFC__and– unidirectional Granger causality.*GFC*

These results are in accordance with existing theory, as ** GFC** and

__PFC__are both components of

**GDP**in the national income accounting identity. Therefore lagged values of

__PFC__and

**Granger-cause**

*GFC***GDP**, but

**GDP**does not Granger-cause

__PFC__and

**. The next article shows the testing of normality of time series data.**

*GFC*- Establishing a relationship between FDI and air pollution in India - November 4, 2018
- How to test normality in STATA? - October 31, 2018
- How to test time series multicollinearity in STATA? - October 24, 2018

## Discuss