Announcement

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

  • Trying to use pvarsoc to select lag for my pvar but error arise

    I'm trying to analyze panel var model and want to select appropriate lag order for my data.
    But pvarsoc code doesn"t work for me. Even if I tried with example data from help pvarsoc, there is always error code "r(199)" and "command lags is unrecognized"
    What should I do? I downloaded the package st455 from stata program.

    Thanks!

  • #2
    Welcome to Statalist.

    When I install st0455 and then run the example shown in the output of help pvarsoc the results are as expected. Did you do something different?
    Code:
    . webuse grunfeld
    
    . xtset company year
           panel variable:  company (strongly balanced)
            time variable:  year, 1935 to 1954
                    delta:  1 year
    
    . pvarsoc invest mvalue kstock
    Running panel VAR lag order selection on estimation sample
    ....
    
     Selection order criteria
     Sample:  1939 - 1953                              No. of obs      =       150
                                                       No. of panels   =        10
                                                       Ave. no. of T   =    15.000
    
      +--------------------------------------------------------------------------+
      |   lag |    CD          J      J pvalue     MBIC       MAIC       MQIC    |
      |-------+------------------------------------------------------------------|
      |     1 |  .9999053          .          .          .          .          . |
      |     2 |   .999811          .          .          .          .          . |
      |     3 |  .9999274          .          .          .          .          . |
      |     4 |  .9999259          .          .          .          .          . |
      +--------------------------------------------------------------------------+
    
    . pvarsoc invest mvalue kstock, pvaro(instl(4/8))
    Running panel VAR lag order selection on estimation sample
    ....
    
     Selection order criteria
     Sample:  1943 - 1953                              No. of obs      =       110
                                                       No. of panels   =        10
                                                       Ave. no. of T   =    11.000
    
      +--------------------------------------------------------------------------+
      |   lag |    CD          J      J pvalue     MBIC       MAIC       MQIC    |
      |-------+------------------------------------------------------------------|
      |     1 |  .9999497   46.01919   .1223806  -123.1981  -25.98081  -65.41266 |
      |     2 |  .9999304   23.46367   .6598702  -103.4493  -30.53633  -60.11022 |
      |     3 |  .9998502   10.02059   .9312322  -74.58805  -25.97941  -45.69534 |
      |     4 |    .99981   2.751243   .9733466  -39.55308  -15.24876  -25.10672 |
      +--------------------------------------------------------------------------+
    
    . pvarsoc invest mvalue kstock, pinstl(1/5)
    Running panel VAR lag order selection on estimation sample
    ....
    
     Selection order criteria
     Sample:  1944 - 1953                              No. of obs      =       100
                                                       No. of panels   =        10
                                                       Ave. no. of T   =    10.000
    
      +--------------------------------------------------------------------------+
      |   lag |    CD          J      J pvalue     MBIC       MAIC       MQIC    |
      |-------+------------------------------------------------------------------|
      |     1 |  .9999413   49.16912    .070565   -116.617  -22.83088  -60.78781 |
      |     2 |  .9997416   30.64515   .2859576  -93.69444  -23.35485  -51.82255 |
      |     3 |  .9994622   18.37292    .431352  -64.52015  -17.62708  -36.60555 |
      |     4 |  .9971417   3.193073   .9561455  -38.25346  -14.80693  -24.29616 |
      +--------------------------------------------------------------------------+
    Note that I copied my commands and results from Stata's Results window and pasted them into this post using code delimiters [CODE] and [/CODE], following the advice of the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. You should take a few minutes to review the FAQ, especially sections 9-12 on how to best pose your question. Then try the same code I did and post the results using code delimiters.

    Comment


    • #3
      Thank you for your reply.

      I've just solved my problem. I downloaded pvar code from internet and put personal file. Also I have st0455 as well. I removed pvar code in personal file then It works well.
      I think the one I downloaded from internet was outdated. Maybe those are conflicted each other... It's my fault
      Last edited by Paul Vogle; 15 May 2019, 12:42.

      Comment

      Working...
      X