Announcement

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

  • running VEC, problem in lrtest

    i ran vec command

    quietly vec ln_price_2 ln_price_1 ln_price_3 ln_price_4 ln_price_5 ln_price_6, trend(constant) rank(5) lags(3)
    estimates store constantlags3
    quietly vec ln_price_2 ln_price_1 ln_price_3 ln_price_4 ln_price_5 ln_price_6, trend(constant) rank(5) lags(2)
    estimates store constantlags2
    lrtest constantlags3 constantlags2


    *last command not executed, observations differ: 147 vs. 148.why am i getting error r(498)
    i have stata 14, how come observations differ when i run the same vec model with two lags and
    Last edited by varun miglani; 26 Dec 2023, 21:40.

  • #2
    Varun:
    the difference in the e(sample) observations make sense if you consider the mechanic of the L. operator:
    Code:
    . encode make , g(num_make )
    
    . tsset num_make
    
    Time variable: num_make, 1 to 74
            Delta: 1 unit
    
    . g A=L2.price
    (2 missing values generated)
    
    . g B=L3.price
    (3 missing values generated)
    
    . sum price A B
    
        Variable |        Obs        Mean    Std. dev.       Min        Max
    -------------+---------------------------------------------------------
           price |         74    6165.257    2949.496       3291      15906
               A |         72    6074.778    2907.061       3291      15906
               B |         71    6094.183    2923.052       3291      15906
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      in the book introduction to time series using STATA by Sean Becketti, he uses the command lrtest rconstantlags3 rconstantlags2 after storing the estimates of these vec
      the objective is to check, if we can trim the lag. as Each lag adds coefficients. Since i have 6 variables, how do i decide on lags. is 2 lags enough, or should i go for 3 lags, will it depend on P>|z| . request for guidance

      Comment


      • #4
        Assuming that the underlying logic of this approach is correct, you can use the -force- option of lrtest to override this error.

        Each lag adds coefficients.
        This assumes that the model with a lower number of lags is nested in the model with a higher number of lags.

        Code:
        lrtest constantlags3 constantlags2, force
        Last edited by Andrew Musau; 27 Dec 2023, 06:58.

        Comment


        • #5
          thanks, the query is resolved

          Comment

          Working...
          X