Hello,
I have to admit that I am a fairly new Stata-user and I am sorry if answers for my questions are obvious. Furthermore, I am sorry for my bad english but I hope you can help me.
Even though I know that it posting an image to explain the data is not the best way I have attached one because it makes it easier to explain my problem.
As you can see I have time series data with different variables (Var1 ... ) and each variable belongs to a group (two digits).
Now I would like to make a pairwise VAR for all variables of one group with all variables of another group.
For example I would like to make a VAR wit Var1/Var2; Var1/Var3, Var4/Var2 and Var4/Var3 and the same vor Var7.
I hope it is clear what I mean.
My goal is to use the granger-causality test (vargranger after VAR estimation) to count the number of significant granger causalities between the groups. So for example I would like to know if there are 4 granger causal relations between group 10 and 11.
So I am looking for a to calculate this automatically as I have a large number of variables.
I think I would need a loop but as I am completely new in Stata I am not sure if it is possible at all.
The commands in the loop would be something like:
varbasic Var1 Var2, lags (1 2) nograph
vargranger
mat results12 = r(gstats)
and afterwards I would generate a new variable like:
generate granger_group1011_company12 = 1 if results[1,3] <= 0.05
(of course the varibale has to be shorter but maybe somethink like this)
I am very thankful if someone is able to help me with the loop. Furthermore I am not sure if the VAR-analysis works with the groups.
If not maybe it is possible to make a pairwise VAR for every variable-pair and afterwards adjust for the grouping?
As I said, I am very sorry to ask you so much but I am thankful for every hint. I do not expect a complete solutions but ideas would be great.
Thank you so much.
Christian
I have to admit that I am a fairly new Stata-user and I am sorry if answers for my questions are obvious. Furthermore, I am sorry for my bad english but I hope you can help me.
Even though I know that it posting an image to explain the data is not the best way I have attached one because it makes it easier to explain my problem.
As you can see I have time series data with different variables (Var1 ... ) and each variable belongs to a group (two digits).
Now I would like to make a pairwise VAR for all variables of one group with all variables of another group.
For example I would like to make a VAR wit Var1/Var2; Var1/Var3, Var4/Var2 and Var4/Var3 and the same vor Var7.
I hope it is clear what I mean.
My goal is to use the granger-causality test (vargranger after VAR estimation) to count the number of significant granger causalities between the groups. So for example I would like to know if there are 4 granger causal relations between group 10 and 11.
So I am looking for a to calculate this automatically as I have a large number of variables.
I think I would need a loop but as I am completely new in Stata I am not sure if it is possible at all.
The commands in the loop would be something like:
varbasic Var1 Var2, lags (1 2) nograph
vargranger
mat results12 = r(gstats)
and afterwards I would generate a new variable like:
generate granger_group1011_company12 = 1 if results[1,3] <= 0.05
(of course the varibale has to be shorter but maybe somethink like this)
I am very thankful if someone is able to help me with the loop. Furthermore I am not sure if the VAR-analysis works with the groups.
If not maybe it is possible to make a pairwise VAR for every variable-pair and afterwards adjust for the grouping?
As I said, I am very sorry to ask you so much but I am thankful for every hint. I do not expect a complete solutions but ideas would be great.
Thank you so much.
Christian
Comment