Announcement

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

  • Vector autoregression model, time series or panel data?

    Hello,


    I want to apply a vector auto regression model to analyze the relationship between oil prices, employment rates and control variables. My data is a balanced panel data over a time span of 25 years and 13 countries. I am new to this kind of regression and very confused which approach i should use. The time series (tsset) or the panel data(xtset)? .

    For the time series approach i would create an additional variable to identify each observation uniquely and set this variable as tsset?


    generate ts=_n

    tsset ts


    Or should I use the panel data approach with xtset? However, in relation to literature the time series approach with tseet seems more common....


    Hopefully some could give me a feedback on how to proceed and if the creation of an additional time series variable is permissible?



    Best Regards

    John Marburg

  • #2
    Correct, tsset is used to tell Stata you have time-series data, while xtset tells Stata you have panel data. From your data description, you won’t want to use tsset in this case and you’ll likely need something like

    Code:
    encode country, gen(country_id)
    xtset country_id year, yearly
    to xtset your data. If you’re interested in dynamics (IRFs), Granger Causality, etc., then you can estimate a panel var using pvar from Stata Journal (type search pvar in Stata). Hope this helps.

    See
    Abrigo, Michael RM, and Inessa Love. "Estimation of panel vector autoregression in Stata." The Stata Journal 16, no. 3 (2016): 778-804.
    https://www.stata-journal.com/articl...article=st0455


    Comment


    • #3
      Hello Justin,

      thank you for your response. I know tried to understand the results of panel vector autoregression, but I am struggling with certain aspects. Therefore I got 2 additional questions.


      1. Is there a way to apply the Aik-Information-criterion or a similar criterion for panel vector autoregression, which helps to find the optimal lag period?


      I tried: pvarsoc Unemploy OilRents Gdpgrowth, maxlag(8) but the results a confusing to me. Is there no Hansen j statstic, MBIC,MAIC,MQIC possible?

      Selection order criteria
      Sample: 9 - 23 No. of obs = 102
      No. of panels = 11
      Ave. no. of T = 9.273

      +--------------------------------------------------------------------------+
      | lag | CD J J pvalue MBIC MAIC MQIC |
      |-------+------------------------------------------------------------------|
      | 1 | .9996583 . . . . . |
      | 2 | .9996158 . . . . . |
      | 3 | .9992315 . . . . . |
      | 4 | .9840162 . . . . . |
      | 5 | .9605033 . . . . . |
      | 6 | .7857653 . . . . . |
      | 7 | .9654657 . . . . . |
      | 8 | .4684024 . . . . . |
      +--------------------------------------------------------------------------+


      2. After panel vectorautoregression command: pvar Unemploy OilRents Gdpgrowth, lag (2) I tried the post estimate command. pvarirf, table.

      Unfortunately I don’t know to interpret these results. Is there an impact from oil on unemployment?

      pvarirf, table

      IRF

      -------------------------------------------
      Response |
      variable |
      and |
      Forecast | Impulse variable
      horizon | Gdpgrowth OilRents Unemploy
      ----------+--------------------------------
      Gdpgrowth |
      0 | 1 0 0
      1 | -.0952183 .0678643 .0356556
      2 | .069255 -.0233971 -.0809949
      3 | -.0096592 -.0054206 -.1731342
      4 | .0034614 -.007935 -.1864206
      5 | -.0008805 -.0044197 -.189349
      6 | .0004801 -.0028365 -.1862417
      7 | .000493 -.0011581 -.1823705
      8 | .0008121 .0001552 -.1779399
      9 | .0009946 .001276 -.1732829
      10 | .001162 .002201 -.1684441
      ----------+--------------------------------
      OilRents |
      0 | 0 1 0
      1 | .1023496 .8592706 1.353608
      2 | .134833 .7203608 1.784799
      3 | .1094827 .6068909 1.976541
      4 | .0917009 .5069878 2.094631
      5 | .0739125 .421503 2.175267
      6 | .0591569 .3475908 2.230278
      7 | .0463717 .283901 2.264197
      8 | .0354616 .2290459 2.280424
      9 | .0261299 .1818924 2.281738
      10 | .0181798 .1414365 2.27056
      ----------+--------------------------------
      Unemploy |
      0 | 0 0 1
      1 | -.0037769 -.0231678 1.156084
      2 | -.0087311 -.0305481 1.133961
      3 | -.0109306 -.0340216 1.094249
      4 | -.0115948 -.0362771 1.055375
      5 | -.011854 -.0378694 1.017903
      6 | -.011934 -.0389898 .9813426
      7 | -.0119269 -.0397163 .9455296
      8 | -.0118541 -.0401113 .9104757
      9 | -.0117293 -.0402261 .8762316
      10 | -.0115616 -.0401057 .8428469
      -------------------------------------------

      .
      Last edited by John Marburg; 18 May 2021, 06:45.

      Comment


      • #4
        1. If the model is just-identified, you’ll get only the CD (coefficient of determination). You’ll need the pinstlag(numlist) option to get the M* criterion. Because you have annual data, I wouldn’t suggest considering anything beyond 2 lags. Deeper lags are hard(er) to justify with a low frequency.
        2. I can’t really read your output because you didn’t use CODE delimiters, but I suggest graphing the pvarirf(s) and interpreting them in the usual way – is the shock instantaneous, is the shock significant (does the confidence ban contain zero), how long until the shock dissipates, etc.

        Comment


        • #5
          Hello Justin,

          sorry for the late answer. If i run pinstlag i get the following error response.


          . pvarsoc Unemploy OilRents Gdpgrowth, pinstlag(4)
          Running panel VAR lag order selection on estimation sample
          model is not identified; there are more parameters, 36, than instruments, 9
          r(481);


          How can i adjust?

          Additionally i want to know if there is a way to zoom into the impulse response function ? because the graphs shows only standard deviation of 2 and more
          Last edited by John Marburg; 09 Jun 2021, 10:34.

          Comment


          • #6
            How can i [sic] adjust?
            Limit the lag order e.g.

            Code:
            pvarsoc Unemploy OilRents Gdpgrowth, pinstlag(1)

            Comment


            • #7

              I've tried pinstlag (1), pinstlag (2) and others. Unfourtanley the error message remains the same

              pvarsoc Unemploy OilRents Gdpgrowth, pinstlag(1)
              Running panel VAR lag order selection on estimation sample
              model is not identified; there are more parameters, 36, than instruments, 9

              Comment

              Working...
              X