Wel… good point Prakash and Eric.
After your emails I went deeply and I found out that it is possible to have a Granger causality test by using OLS. So, I can regress ‘y’ on lagged values of ‘y’ and ‘x’.
. regress “dep. var" L(1/4).“dep. var" L(1/4).“indep. var" . test L1.“indep. var" L2.“indep. var" L3.“indep. var" L4.“indep. var”
Then I get the results. However, I didn’t understand very well how to interpret it. For instance, I think that if the coefficients of the lag of “indep. var” are statistically significant AND different from 0, then it is possible to argue that x Granger-cause y. Am I right? Anyone acquainted with that?
Prakash and Eric, thanks for the warning. Otherwise I would be fighting hard to get something from that first question. Warm regards Anderson
Anderson Macedo de Jesus PhD Researcher International Institute of Social Studies (ISS) Erasmus University Rotterdam (EUR) Cel number +31 0681415932 andemacj@iss.nlandemacj@gmail.com  On Mar 24, 2014, at 9:01 PM, DE SOUZA Eric < eric.de_souza@coleurope.eu> wrote: As Prakash Singh has pointed out, -var- does not work with panel data. The following link may be of interest to you:
http://econ.worldbank.org/WBSITE/EXTERNAL/EXTDEC/EXTRESEARCH/0,,contentMDK:22677911~pagePK:64214825~piPK:64214943~theSitePK:469382,00.html
Eric de Souza College of Europe Brugge (Bruges), Belgium http://www.coleurope.eu
-----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Anderson Macedo de Jesus Sent: 24 March 2014 14:22 To: statalist@hsphsun2.harvard.edu Subject: Re: st: granger causality test Importance: High
Dear Nick,
Thanks for your help. You are definitely right when you told me that -ca- was not a suitable panelvar. I have chosen country that was a string variable, but i run -encode- and this was not a problem anymore. Therefore, I used -country1- as my panelvar and -year- as my timevar. (Thanks for your hint on the number I should use in delta. As I understood, I need to use delta 5 because my timevar varies every 5 years) My result was great, since my previous one was telling me that panel variable was "weakly balanced".
. tsset country1 year, delta(5) panel variable: country1 (strongly balanced) time variable: year, 1990 to 2010 delta: 5 units
Now that I have set the data, I tried to run the "vector autoregressive models" and the result was "repeated time values in sample". a) As dependent variable I chose two (pfi_fh and ca) b) Time settings: I used the variable "year" and panel id variable 'country1" b.1) The time unit chosen was "use format of time variable" c) And I included 2 lags
My results were: a) 2 lags: "repeated time values in sample" b) 5 lags: "no observations"
Therefore, my question is: Where am I failing? Thanks a lot Anderson
On Mar 24, 2014, at 1:03 PM, Nick Cox <njcoxstata@gmail.com> wrote:
Right at the top of the help for -tsset- you get an explanation:
Declare data to be time series
tsset timevar [, options]
tsset panelvar timevar [, options]
There are two valid forms. You have panel or longitudinal data, so only the second form is valid for you.
In your case, setting a timevar alone doesn't work, because you haven't specified a panelvar. Conversely, setting a panelvar alone would not work because you haven't specified a timevar.
In your case, -ca- is evidently not even a suitable panelvar.
You need something like
tsset country year
and indeed you need something like
tsset country year, delta(5)
where -delta(5)- is documented under options.
Note that -country- or your equivalent must be a numeric variable: if you are holding country names in a string variable, apply -encode-.
Spelling is "Granger", not "granger" or "Gangrer".
Nick njcoxstata@gmail.com
On 24 March 2014 06:47, Anderson Macedo de Jesus
I am trying to use the granger causality test in stata 13.1, but with no success. First of all, before the test I need to set the variables, right? I have a data set with 135 countries, 26 variables within 5 years (1990, 1995, 2000, 2005, 2010). For the Gangrer causality test I am using the Vector autoregression -var-. Before that I know I need to set the data for the causality test but I get the following messages from stata:
-tsset- year (command+variable) r(451) repeated time values in sample
or
-tsset- ca (command+variable) r(451) time variable must contain only integer values.
I don't know what is going on. Someone could give me a clue?
* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/
* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/
* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/
|