Announcement

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

  • VECM model and Granger causality

    Hi,

    I would like to test (short-run) Granger causality in a VECM model with only one lag. I have found a document that does it for 3 lags. I thought I would be able to edit the code easily but somehow I am stuck:
    https://socialsciences.mcmaster.ca/m...out%20full.pdf

    Here is the data I have:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(monthyear lconsumption lincome)
    675    363     560
    676   4982    8538
    677   5008   15146
    678  79305  265707
    679  77967  354004
    680  47894  211406
    681  39764  155116
    682  31204  149535
    683  36509  161429
    684  40262  178205
    685  36904  145206
    686  49472  196574
    687  41860  172077
    688 134783  593005
    689 382292 2095681
    690 512925 2605281
    691 498831 2252573
    692 493515 2075523
    693 510854 1864678
    694 629511 1949752
    end
    format %tm monthyear

    Here is the code I have. The last line does not work:
    Code:
    tsset monthyear
    vecrank lconsumption lincome, lags(1)
    vec lconsumption lincome, lags(1)
    test ([D_lconsumption]: LD.lincome )
    Here is the error I get:
    ". test ([D_lconsumption]: LD.lincome )
    LD.lincome not found
    "

    In the link provided, the code is very similar with 3 lags. I just do not know the syntax to get the short-term Granger causality test to work with one lag. Please help. Thanks.

  • #2
    Hi,

    I was wondering if anyone had a chance to look into it. Please let me know.

    Comment


    • #3
      Look at the e(b) matrix to see what you got as variable names.

      Comment


      • #4
        I have a [1,4] matrix. Here it is:
        Click image for larger version

Name:	Capture.GIF
Views:	1
Size:	6.5 KB
ID:	1721053

        Would you be able to help me use it? Thanks!

        Comment


        • #5
          Based on the matrix content, I guess I do not understand how the variables are named. Therefore, I am having a hard time to input the proper name on "test". please help. Thanks!

          Comment


          • #6
            Is there someone who can help me extract those vectors and run the test? I am really stuck there, your help is much appreciated! Thank you in advance!!

            Comment


            • #7
              You need 2 lags to use the approach you've outlined above, which appears to be how people do it.

              HTML Code:
              https://www.youtube.com/watch?v=UgbMUS9eWPw

              Comment


              • #8
                What if I only have one lag? I cannot change my model to 2 lags.

                Comment


                • #9
                  When you have 1 lag, only the error correction term is in the model. There is no lag of the variables. When you have 2 lags, it includes the lags of the variables permitting the test. So you really only have 1 lag of the variables.

                  Run it, you'll see it in the results.

                  Comment

                  Working...
                  X