Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: granger causality test


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: granger causality test
Date   Mon, 24 Mar 2014 12:03:20 +0000

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
[email protected]


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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index