Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Granger test and var (xtvar, pr

    Hi everyone,

    I am encountering a few problems when I tried to run var codes to be followed by a Granger test. I am using Stata 14.

    My dataset is a list of 70 countries and 20 quarters (approx 1400 observations). The panel is balanced. I am investigating whether certain variables such as newspaper articles influence the number of ICOs in a given quarter/country. Hence the DV goes from 0 (many zeroes) to 77 with average of 0.68. To establish causality I would like to run a Granger causality test.

    I tried running a few models but I always get errors. var (see below) but I get "repeated time values in sample".

    Code:
    var NumberofICOperquarter  LNNumberofnews, lags(1/2)
    repeated time values in sample
    r(451);
    I guess this is because var does not work with a panel. So I have tried using the pvar but I also receive an error.
    Code:
    pvar NumberofICOperquarter  LNNumberofnews
    derivative already defined for parameter NumberofICOperquarter___0 in equation 1
    r(498);
    Therefore, I have found another test, xtgcause, but I get an empty outcome:
    Code:
    xtgcause NumberofICOperquarter  LNNumberofnews
    Dumitrescu & Hurlin (2012) Granger non-causality test results:

    Lag order: 1
    W-bar = .
    Z-bar = . (p-value = .)
    Z-bar tilde = . (p-value = .)

    H0: LNNumberofnews does not Granger-cause NumberofICOperquarter.
    H1: LNNumberofnews does Granger-cause NumberofICOperquarter for at least one panelvar (CountryID).

    The only model that works is XTVAR and it works fine but this is not compatible with a Granger causality test (?).

    Hence, my questions are two:
    - is there a way to fix the above errors such as the one I get with pvar?
    - is there another way to run a Granger causality test considering the above?

    Thank you in advance,

    Cristiano

  • #2
    Hi,
    Did you try to specify your panel id and time variable ?
    I am only guessing your variable name, but try with the ones you have
    encode "countries", gen(id)
    rename 'quarters' year

    You also need to check for duplicates and define your panel (tell STATA that you are using panel data) with this command : xtset id year

    Hope that helps !

    Raja

    Comment


    • #3
      Hi Christiano,

      I'm having exactly the same problems as you did. Did you solve this problem and could you tell me how? Especially the 'derivative already defined...' problem.

      Thanks!

      Nathalie

      Comment


      • #4
        Hi Cristiano,

        The Dumitrescu & Hurlin (2012) Granger non-causality test can only be run if you have first correctly specified your panel data using the xtset command. It also requires a strongly balanced dataset and that the variables are both stationary (in this regard xtunitroot can be used).

        Kind regards,
        Jordan

        Comment


        • #5
          Hi everyone, sorry for the delayed reply. I didn't follow this page anymore. Thanks everyone for your support on this.

          Comment

          Working...
          X