Announcement

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

  • What should the command be?

    I would like to ask about the exact command.
    Assume yt= (infla t, unrate t, hwages t)is(3×1)-vector, in order to estimate the order of the VAR(p) model for yt, using a constant for the determinstic component, what should the command be?
    I suppose it is varsoc command.
    The data is like this (until 2021).
    date infla unrate hwages
    1961-01-01 1.600272387 6.6 1.401869159
    1961-02-01 1.462087725 6.9 1.401869159
    1961-03-01 1.462087725 6.9 1.401869159
    1961-04-01 0.914014895 7.0 1.869158879
    1961-05-01 0.913087589 7.1 2.803738318
    1961-06-01 0.776764607 6.9 2.803738318
    1961-07-01 1.252115059 7.0 2.803738318
    1961-08-01 1.114488349 6.6 2.34741784
    1961-09-01 1.249577845 6.7 2.325581395
    1961-10-01 0.773109244 6.5 3.255813953
    1961-11-01 0.671591672 6.1 3.720930233
    1961-12-01 0.6709158 6.0 4.147465438

  • #2
    Please read section 12 of the FAQ to re-ask this question.

    Comment


    • #3
      OK, I am using the StataSE-17.

      I typed this.

      Code:
      .varsoc infla unrate hwages
      no observations
      r(2000);
      Below is more details.
      Code:
      . tsset date
      Time variable: date, 01jan1961 to 01jan2022, but with gaps
              Delta: 1 day
      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input int date double(infla unrate hwages)
       366 1.6002723867895696 6.6 1.4018691588784993
       397 1.4620877252641273 6.9 1.4018691588784993
       425 1.4620877252641273 6.9 1.4018691588784993
       456  .9140148950576688   7  1.869158878504673
       486  .9130875887725098 7.1 2.8037383177570208
       517  .7767646065522271 6.9 2.8037383177570208
       547 1.2521150592210928   7 2.8037383177570208
       578 1.1144883485306067 6.6 2.3474178403755985
       609  1.249577845322758 6.7 2.3255813953488413
       639  .7731092436978892 6.5 3.2558139534883956
       670  .6715916722634718 6.1 3.7209302325581506
       700  .6709158000673066   6  4.147465437788012
       731  .6702412868626828 5.8  4.608294930875578
       762  .9048257372647361 5.5  4.147465437788012
       790 1.1058981233240894 5.6  4.147465437788012
       821 1.3418316001337915 5.6  4.128440366972463
       851  1.340482573726165 5.5 3.1818181818181746
       882 1.2399463806964661 5.5 3.1818181818181746
       912 1.0026737967917532 5.4 3.1818181818181746
       943 1.1356045424182115 5.7 3.2110091743119185
       974 1.4676450967312737 5.6 3.1818181818181746
      1004 1.3342228152097624 5.4  2.702702702702675
      1035 1.3342228152097624 5.7  3.139013452914785
      1065 1.2329223592130178 5.5  2.212389380530988
      1096 1.3315579227700658 5.7 1.7621145374449254
      1127 1.2288276320161717 5.9  2.212389380530988
      1155 1.1269472986410678 5.7 2.6548672566371723
      1186  .8937437934460002 5.7  2.643171806167399
      1216  .8928571428572729 5.9  2.643171806167399
      1247 1.3240648791795095 5.6  3.083700440528636
      1277 1.5552614162801515 5.6  3.083700440528636
      1308 1.5521796565392876 5.4 2.6666666666666616
      1339  .9861932938851181 5.5  3.524229074889873
      1369 1.2179065174459103 5.5  3.070175438596512
      1400 1.3166556945362728 5.7   3.04347826086957
      1430 1.6458196181703633 5.5  3.463203463203457
      1461 1.6425755584754231 5.6  3.463203463203457
      1492 1.4107611548554555 5.4 3.0303030303030276
      1521  1.409373975745476 5.4  2.586206896551735
      1552 1.5419947506564835 5.3 3.0042918454935563
      1582 1.5404785316292857 5.1 3.0042918454935563
      1613 1.3067624959159918 5.2  2.991452991453003
      1643 1.0752688172047886 4.9  2.564102564102577
      1674  .9756097560978505   5 3.8961038961038863
      1705 1.1718749999999112 5.1 3.8297872340425476
      1735  1.203252032520541 5.1 1.7021276595744705
      1766  1.397011046133656 4.8 2.5316455696202445
      1796 1.1981865284968585   5 2.5104602510460206
      1827 1.0989010989011172 4.9 2.9288702928870203
      1858 1.1970236169526638 5.1 3.3613445378151363
      1886 1.1958629605690607 4.7  4.201680672268915
      1917  1.389337641356847 4.8 2.9166666666666785
      1947 1.6139444803096037 4.6  3.750000000000009
      1978  1.934859722669935 4.6  3.319502074688807
      2008   1.80528691166999 4.4 3.3333333333333437
      2039 1.6103059581317858 4.4 2.9166666666666785
      2070 1.7374517374519893 4.3   2.86885245901638
      2100 1.7030848329047998 4.2  5.439330543933041
      2131 1.7302146747839586 4.1  4.115226337448541
      2161   1.92000000000061   4 3.6734693877551017
      2192 1.9181585677747748   4  3.658536585365857
      2223  2.557544757033292 3.8  4.065040650406515
      2251 2.7786649632704608 3.8 3.2258064516129004
      2282 2.8680688336521376 3.8  4.453441295546545
      2312 2.7636594663277725 3.9  4.016064257028096
      2343 2.4359379943062143 3.8 3.6144578313253017
      2373   2.75490816972761 3.8  4.435483870967727
      2404 3.4865293185423196 3.8  4.453441295546545
      2435  3.573687539531689 3.7  4.382470119521931
      2465  3.791469194312458 3.7  4.761904761904767
      2496  3.559055118109966 3.6  4.743083003952564
      2526  3.359497645211307 3.8 4.7244094488189115
      2557 3.1994981179423787 3.9  4.313725490196085
      2588  2.867830423940143 3.8           4.296875
      2616 2.5481665630825656 3.8           4.296875
      2647 2.5402726146219523 3.8  3.875968992248069
      2677 2.3183925811437245 3.8 3.8610038610038755
      2708 2.8412600370599117 3.9  4.651162790697683
      2738 2.9275808936827463 3.8  4.247104247104261
      2769  2.603369065849259 3.8  4.651162790697683
      2800 2.5954198473283174 3.8  4.198473282442738
      2830 2.5875190258752623   4  3.409090909090895
      2861  3.102189781021991 3.9 3.7735849056603765
      2891   3.28068043742451 3.8 4.8872180451127845
      2922 3.6474164133742715 3.7  6.390977443609014
      2953 3.6363636363640373 3.8  5.617977528089879
      2982 3.9393939393937316 3.7  6.367041198501866
      3013  3.927492447129688 3.5  6.343283582089554
      3043  4.229607250755163 3.5  7.063197026022294
      3074  4.204204204204065 3.7  6.666666666666665
      3104  4.491017964071808 3.7  6.666666666666665
      3135  4.477611940298498 3.5  6.296296296296289
      3166  4.464285714285698 3.4  6.959706959706957
      3196  4.747774480712219 3.4  7.692307692307687
      3227  4.424778761061909 3.4  7.636363636363641
      3257  4.705882352941226 3.4  7.168458781362008
      3288   4.69208211143699 3.4 6.0070671378091856
      3319  4.678362573098771 3.4  6.382978723404253
      3347  5.247813411078961 3.4   5.98591549295775
      3378  5.523255813953809 3.4  6.315789473684208
      end
      format %td date
      ------------------ copy up to and including the previous line ------------------

      Listed 100 out of 734 observations
      Use the count() option to list more


      Additionally, I would like to estimate the VAR(p) model fo yt using varbasic command.
      I typed this.


      Code:
      . varbasic infla unrate hwages
      no observations
      r(2000);

      Comment


      • #4
        I don't understand what the problem is. Thanks for giving your data, but I still have no idea what the issue is. Like, simply explain to me, what's your research question, what variables do you want to use to estimate the model, what technique do you want to use to do so and what issue you're having exactly.

        Not just for me, as I'm sure others don't know what the problem is either. Please, ask the question as if someone is asking you the question. Notice how here I explain what I want specifically, and give the context such that anyone with knowledge of the problem can assist me in solving it.


        Anyways, based off the error code, presumably there's no set of observables which can be used in the model in the first place. You don't go into detail about your model or even if this is a user written command, but I suspect the issue is there. Your time series has gaps in it- perhaps this is where the issue lies, while it's quite unlikely.

        Comment


        • #5
          My answer arises directly from #1. You have monthly data that happen to be given as daily dates, one for the first of each month.

          I imagine that you tsset or xtset your data in terms in that daily date variable -- but given that, Stata can't find previous values. For example, the date before 1 February is 31 January, the date before that is 30 January, and so on, but you don't have data for such dates. Given what you told,Stata, Stata sees mostly gaps in your data.

          You need to back up and create a monthly date variable

          Code:
          gen mdate = mofd(date) 
          
          format mdate %tm
          and reissue your tsset or xtset. Then there is a stronger chance that your VAR modelling will work.

          Comment


          • #6

            Thanks for your comments.
            More precisely, using a monthly time series of the growth of the hourly earnings of Manufacturing (hwages t), inflation rate (infla t) and unemployment rate (unrate t) for the United States, whose data is obtained from the FRB of St. Louis database, seasonally adjusted, monthly frequency, from 1961 to 2022, and let yt= (infla t, unrate t, hwages t)be an (3×1)-vector that collects the information concerning the variables of interest, I try to estimate the order of of the VAR(p) model for yt with a constant for the deterministic component.

            Comment

            Working...
            X