I am by far no expert on time-series but these are my thoughts for what it is worth.
Hopefully someone else could add to this to help you further on your way.
Does it make sense?
To me it doesn't really make a lot of sense.
When I do panel data analysis I base the choice of my variables on the results in the literature. There should be a theoretical basis for your model.
I would just use the Granger causality test as a method of analysis.
This paper might be of interest of you, where they use a Granger test in a panel data setting.
If the time series are non-stationary could I run the Granger CT or should I have to make time series stationary with some cointegration process before?
Yes you should make the time-series stationary as the VAR-model that you use to do the test assumes that the data is stationary.
If your time-series has a unit root, often first differencing will eliminate this unit root.
How can I do it with Stata?
First differencing can be done by using the D-command (don't forget to time-set your data first)
So if you have your time-series called gdp then you first difference it by:
gen gdpdiff=D.gdp
You can set up the VAR model by using the var-command.
For help on this simply type
help var
So the command for your VAR-model could be:
var fdi gdpdiff
Use varsoc to test the optimal length of the number of lags that need to be included. So in the command below I test the first 20 lags.
varsoc, lag(20)
The run your model with the desired number of lags, for instance
var fdi gdpdiff, lag(1/10)
After fitting the var-model you can do the Granger causality test using:
vargranger
How can I interpret the results?
I found this post quite useful on how to conduct and interpret a Granger causality test (it is done in R).
Be aware that the null hypothesis is one on non Granger causality.
One method would be to look at correlations, and, there are two cases to consider.
That, in turn, depends on whether or not we can assume independence. The worst case scenario is correlation of independent processes. In that case, we could be comparing for A & B, dollar values on the US Dow Jones market and the Canadian exchange in Toronto, to C & D representing temperatures in Osaka and Tokyo, Japan. The second case would be correlated correlations, where we could be comparing values on the the US and Canadian exchanges to the values on the Osaka and Tokyo exchanges.
In the first case, we could use a comparison of independent R-values from regression where in each regression we obtain our correlations from $R^2=1-\dfrac{SSE}{SST} $, and then test the significance of difference of R-values. For the second case, correlated correlations, smaller differences in R-values are more easy to detect.
Discussion So what if the correlation from Granger Causality is better for the North American markets than for the temperatures in Japan? There are two problems with this. First is that we are left with no real valid conclusions because we are comparing "apples to oranges" in the figurative sense. Second is because the prevailing winds in Osaka are sometimes from the direction of Tokyo and sometimes to Tokyo, so that Granger Causality could underestimate the actual relationship if seasonal variations in temperature and prevailing winds are ignored. In the second case, correlated correlations, one could find that the changes in the the larger markets (New York and Tokyo) precede changes in the smaller markets (Toronto and Osaka), but, why would we compare correlations anyway? Why wouldn't we, for example, do a round robin and Granger Causality compare New York and Tokyo markets directly, if that is what we want to know?
Best Answer
Follow this procedure (Engle-Granger Test for Cointegration):
1) Test to see if your series are stationary using adfuller test (stock prices and GDP levels are usually not)
2) If they are not, difference them and see if the differenced series are now stationary (they usually are).
3) If they are, your ORIGINAL series are said to be each integrated (I did not say co-integrated) of order 1; concisely noted as I(1).
4) If they are not both I(1), you can say safely say that they can not be co-integrated of order 1.
5) If they are both I(1), run a simple OLS regression of one of the other.
6) Check the residual of the OLS for stationarity. If they are stationary, then your original series are co-integrated of order 1.
Shortcomings of this method: 1) It may matter which variable you regress on the other, 2) it works only when you have two variables.
For a better test, you can use Johansen's procedure (https://github.com/josef-pkt/statsmodels/commit/29f0aa27d284ac0026e90ff9d877f7920a2c6056)
http://nbviewer.jupyter.org/github/mapsa/seminario-doc-2014/blob/master/cointegration-example.ipynb.