Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Aduba Joseph
    Participant
    Post count: 22

    Dear Professor, I am trying to extract granger causality test table but received the error below. I updated to beta and still received the same error. Could you kindly fix this.

    asdocx xtgcause fdi Rpf, replace

    “Unknown sub-command xtgcause
    If xtgcause is a community contributed program
    You can post a request on the asdocx forum for addition of this program to asdocx”
    Forum link: https://asdocx.com/forums/forum/asdocx-forum/
    r(199);

    Attaullah Shah
    Moderator
    Post count: 76

    The command xtgcause is not a Stata official command. Hence asdocx is not aware of that. The help file of xtgcause shows that the command leaves scalar in r(), and hence these can be written with flexmat and then exported with asdocx. Here is an example.

    The dataset Data_demo.xls used in this example is provided by Dumitrescu and Hurlin at
    http://www.runmycode.org/companion/view/42, along with a few results.

            . import excel using Data_demo.xls, clear
            . ren (A-J) x#, addnumber
            . ren (K-T) y#, addnumber
            . gen t = _n
            . reshape long x y, i(t) j(id)
            . xtset id t
            . xtgcause y x, lag(1)
    

    Now create the table from the scalars with flexmat

    flexmat reset
    flexmat addrow, data(Lag order, `r(lags)', \empty, \empty) row(1)
    flexmat addrow, data(W-bar, `r(wbar)', \empty, \empty) row(2) dec(3)
    flexmat addrow, data(Z-bar, `r(zbar)', p-value, `r(zbar_pv)') row(3) dec(3)
    flexmat addrow, data(Z-bar tilde, `r(zbart)', p-value, `r(zbart_pv)') row(4) dec(3) 
    asdocx export
    Table: Results
    Lag order 1
    W-bar 1.291
    Z-bar 0.650 p-value 0.515
    Z-bar tilde 0.259 p-value 0.796
    Aduba Joseph
    Participant
    Post count: 22

    Thanks. It will be nice to include the code in asdocx going foreword.
    Once more, thanks for providing the solution.
    Sincerely.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.