Announcement

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

  • A problem with parmby

    Dear all,

    I have a time series data set and I am testing for cointegration using bounds testing approach.

    So my code is this

    parmby "xi:ardl TC TRI PC PRI, maxlag(2 2 2 2) nocons ec1 regstore(res)", label norestore

    that produced


    ARDL(2,1,1,0) regression

    Sample: 1/6/2010 thru 12/29/2023, but with gaps Number of obs = 2,185
    R-squared = 0.9994
    Adj R-squared = 0.9994
    Log likelihood = 12727.74 Root MSE = 0.0007

    ------------------------------------------------------------------------------
    D.TC | Coefficient Std. err. t P>|t| [95% conf. interval]
    -------------+----------------------------------------------------------------
    ADJ |
    TC |
    L1. | -.1818093 .0078682 -23.11 0.000 -.1972392 -.1663794
    -------------+----------------------------------------------------------------
    LR |
    TRI |
    L1. | 1.69922 .0079424 213.94 0.000 1.683644 1.714795
    |
    PC |
    L1. | 1.080394 .0010966 985.22 0.000 1.078243 1.082544
    |
    PRI |
    L1. | -1.604827 .0082859 -193.68 0.000 -1.621076 -1.588578
    -------------+----------------------------------------------------------------
    SR |
    TC |
    LD. | .279423 .0054767 51.02 0.000 .2686828 .2901632
    |
    TRI |
    D1. | .9995084 .000688 1452.86 0.000 .9981593 1.000858
    |
    PC |
    D1. | .2896442 .0125519 23.08 0.000 .2650292 .3142591
    |
    PRI |
    D1. | -.2917724 .0125884 -23.18 0.000 -.3164589 -.2670859
    ------------------------------------------------------------------------------



    Then the problems start.


    The following commands do not run


    sencode parm, gene(parmid)
    command sencode is unrecognized

    eclplot estimate min95 max95 parmid
    variable parmid not found

    Then I condcut the bounds F-test, which is OK

    estat ectest



    Pesaran, Shin, and Smith (2001) bounds test

    H0: no level relationship F = 134.701
    Case 1 t = -23.107

    Finite sample (3 variables, 2185 observations, 3 short-run coefficients)

    Kripfganz and Schneider (2020) critical values and approximate p-values

    | 10% | 5% | 1% | p-value
    | I(0) I(1) | I(0) I(1) | I(0) I(1) | I(0) I(1)
    ---+------------------+------------------+------------------+-----------------
    F | 2.001 3.076 | 2.434 3.605 | 3.393 4.740 | 0.000 0.000
    t | -1.617 -2.978 | -1.940 -3.310 | -2.564 -3.931 | 0.000 0.000

    do not reject H0 if
    either F or t are closer to zero than critical values for I(0) variables
    (if either p-value > desired level for I(0) variables)
    reject H0 if
    both F and t are more extreme than critical values for I(1) variables
    (if both p-values < desired level for I(1) variables)

    decision: no rejection (.a), inconclusive (.), or rejection (.r) at levels:

    | 10% 5% 1%
    -------------+---------------------------------
    decision | .r .r .r



    Finally, I want to conduct some diagnostics tests:


    estimates restore res

    But then the following commands do not run


    . estat bgodfrey, lags(1/4) small
    time variable not set, use tsset varname ...

    estat imtest, white
    time variable not set, use tsset varname ...




    . predict res, residuals
    variable TC not found
    r(111);


    . sktest res
    variable res not found
    r(111);


    pnorm res
    variable res not found
    r(111);

    .
    . qnorm res
    variable res not found


    Any help is greatly appreciated!



  • #2
    These commands occur in clusters. Partial explanations are possible therefore.

    Working backwards:

    Code:
    . predict res, residuals
    variable TC not found
    r(111);
    
    . sktest res
    variable res not found
    r(111);
    
    pnorm res
    variable res not found
    r(111);
    .
    . qnorm res
    variable res not found
    As the predict failed, the variable it would have created doesn't exist. So the next commands fail.


    Code:
    . estat bgodfrey, lags(1/4) small
    time variable not set, use tsset varname ...
    
    estat imtest, white
    time variable not set, use tsset varname ...
    Anything that depends on tsset fails predictably.

    Code:
    sencode parm, gene(parmid)
    command sencode is unrecognized
    
    eclplot estimate min95 max95 parmid
    variable parmid not found
    Stata can't see sencode. Either you didn't install it, or you need to add its location to your adopath.

    However, I don't know nearly enough about parmby or ardl to comment on what you did and whether it was all a good idea. And generally, a data example to make this reproducible and explanations of which commands are community-contributed would all help.

    Comment


    • #3
      THank you NIck!. What I observe is that after running parmby, my name variables dissapear from the Variables window. Maybe this is the problem.... I will search more. Many thanks again!

      Comment


      • #4
        In essence, I think that is precisely because the point of parmby is to create a new dataset. So, I guess you'd need to read in your original data once more, or perhaps merge. I really don't know for sure what you should be doing, however.

        Comment


        • #5
          I'd like to just add a thought in response to what is shown in #1. When running Stata code, if Stata halts with an error message, it is a bad idea to continue running the code from that point on. First of all, the presence of that error message pretty much guarantees that the command that generated it did not run to completion, so the data are either still as they were before that command, or perhaps in some ill-defined partially-processed state. So if that command was supposed to change the data set in any way, you are assured that the change was either not made at all or made incorrectly. Later commands, predicated on the data having been processed properly by the commands that preceded them, may then "choke" on the incorrect/incomplete data being provided to them, leading to a cascade of errors. This is entirely predictable behavior--not just in Stata, but in any programming system. Even if the subsequent commands run without giving error messages, remember that they are working on incomplete or incorrect data, so the results they produce are likely wrong anyway.

          The correct way to act after receiving an error message is to stop, diagnose and fix the error, and then either resume execution starting with the command that produced the error, or, often, start over from the beginning.
          Last edited by Clyde Schechter; 22 Apr 2025, 09:22.

          Comment

          Working...
          X