Announcement

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

  • gcrobustvar error in running

    Hello All,
    I intend to test Granger Causality in presence of structural breaks, so I use the gcrobustvar command for the same. My N=37, and variables are log Real Health expenditure per capita and log Real GSDP per capita. So these are the commands I used to run the gcrobustvar command in Stata 16, but I am getting a conformability error r(503). The
    tsset Id, yearly
    g lnPcRealHealthexp = ln(Healthexp per capita)
    g lnPcRealGSDP = ln(GSDP per capita)
    matrix pvap0opt = (34,21)
    matrix pvapiopt = (34,21)
    matrix pvnybopt = (34,21)
    matrix pvqlropt = (34,21)*Testing for Non-linear Granger Causality*
    tsset Id, yearly
    gcrobustvar lnPcRealHealthexp lnPcRealGSDP, pos(2,1) lags(1/3)

    In the Stata manual on the command, in compatibility issues it says to do the following:

    . The following files are required: gcrobustvar.ado, chowgmmstar3.ado, nyblomstar3.ado, pvcalc.ado, and pvalue.mmat.

    . The matrices (pvap0opt[34,21], pvapiopt[34,21], pvnybopt[34,21], and pvqlropt[34,21]) in pvalue.mmat need to be imported in advance.

    . The gcrobustvar command uses the matsqrt command. It can be found and installed in Stata by typing findit matsqrt in the Command window.

    The second line seems to be the problem. Any suggestions on how to resolve this?

  • #2
    Hi! In your command, "matrices (pvap0opt[34,21], pvapiopt[34,21], pvnybopt[34,21], and pvqlropt[34,21])" seem to import only one value from each of the p-value table, rather than the whole tables. In the gcrobustvar implementation example, there are codes importing p-value tables. Following the example importing the whole p-value tables, Stata will not report conformability error r(503).

    Comment


    • #3
      Hi,

      We are having the same problem as Khushboo. However, we understand that importing the tables you mention would be a solution. The only problem is that we don't know how to do it. Could you please explain? We have looked at the implementation examples in https://www.crei.cat/wp-content/uplo...3/GCrobust.pdf but we struggle to find any help there.

      Thank you in advance!

      /Erik and Hannes

      Comment


      • #4
        Hi! In the implementation example/package, please go to "Main_Implement.do" file to check the command to import the pv table (stored in the file "pvtable.mmat").

        Comment


        • #5
          Dr Wang's website has an example in a stata do file, you can refer to that:
          https://drive.google.com/file/d/1ba8...utYlyjnnI/view

          Comment


          • #6
            Hi, it works now. However, we get very different results depending on whether we analyze our variables in first differences or not. We cannot seem to understand why. Could you maybe please explain why this might be the case?

            Best regards

            Comment


            • #7
              The gcrobustvar command is designed in a manner that it is robust to all parameter instabilities. So you do not need to difference the data for stationarity. the differencing will only change he interpretation of your results. so instead of health granger causing economic growth, the first difference will be interpreted as change in health granger causes change in economic growth. Hope that helps

              Comment


              • #8
                Yiru Wang , I have worked with the steps in the zip file , however, the estimation worked for one of my variables but other is either showing
                missing matrix error or
                initial weight matrix is not positive definite; check your instruments

                Comment


                • #9
                  The 'gcrobustvar' command uses the 'gmm' command. The errors mentioned, such as, "initial weight matrix is not positive definite," arise from applying the 'gmm' command with the data or subsamples of the data.

                  Comment

                  Working...
                  X