Announcement

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

  • Error IRF for varbasic and vec command

    Hi everyone! I am working with a panel dataset (10 countries) which runs from 2001q4 until 2021q4 (81 observations). I want to run an analysis for each country separately. The results of my cointegration tests are not completely indicative hence I want to run both VAR and VEC for each country. My unitroot tests showed that each variable is stationary in first difference.

    When I use the following codes for running my VAR and VEC, respectively, for country 1:
    Code:
    varbasic d.lgEHB d.lgGDP d.lgPCE d.lgGGD d.lgEMC d.NEX if countryid==1, irf lags(2)
    Code:
    vec lgGDP lgEHB lgGGD lgPCE lgEMC NEX if countryid==1, lags(2) trend(constant)
    irf create myirf, set(VEC2_1, replace)
    irf graph irf
    However, if I run these IRFs then I receive graphs that seem to be incorrect to me. I have attached the results to this post. Does anyone know what the problem here is // what did I wrong and how do I run my VAR and VEC to find IRFs that are correct?

    I am using Stata14 on Windows10. An example of my data is the below, where EHB stands for equity home bias, GDP for gross domestic product, PCE for private consumption expenditure, GGD for general government debt, EMC for equity market capitalisation, and NEX for net exports.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long countryid float(time lgEHB lgGDP lgPCE lgGGD lgEMC) double NEX
    1 167  -.2720569 24.799786 24.170223  25.58839 23.950283 1011282200.0000001
    1 168 -.25861654 24.812256 24.181713  25.64453  24.03007 2118992699.9999998
    1 169  -.2472665  24.81871  24.19171 25.776365  24.10396         1506974900
    1 170 -.23756395  24.82338  24.20702 25.769596  24.17277         2126624600
    1 171  -.2291845   24.8311 24.215796 25.790054  24.23714 2053162899.9999998
    1 172 -.25163904  24.83359 24.217073 25.874876  24.39485         1525886200
    1 173 -.26872382 24.837196 24.223743 25.950054 24.531046         1735959400
    1 174 -.28216273  24.84242  24.22559  25.94105 24.650894         1853311400
    1 175  -.2930121 24.860935  24.23517 25.985153 24.757904         2164329400
    1 176  -.3333287  24.86683  24.25337  26.00223 24.887384         2641476700
    1 177  -.3661215  24.88507  24.26355  26.04554 25.002005 2994093700.0000005
    1 178  -.3933359   24.8989  24.28772  26.07822  25.10483         2401532000
    1 179  -.4162956 24.906204  24.28495 26.094795  25.19806         1155104600
    1 180  -.4027754  24.92251  24.30408  26.17538  25.30204         3719920000
    1 181  -.3918572  24.93328  24.32064  26.14995 25.396225         1995521830
    1 182  -.3828611  24.94332  24.31778 26.147684 25.482296         2205869170
    1 183  -.3753248   24.9623  24.33571   26.0499  25.56154         2804403000
    1 184  -.3908807   24.9684 24.342356  26.13012  25.68528 2893360899.9999995
    1 185     -.4034  24.98873  24.35606 26.224796  25.79538         3136652400
    1 186  -.4136974 24.999086  24.36052  26.19351  25.89455         3399050700
    1 187  -.4223193  25.01818 24.365833 26.193077 25.984766         4357585000
    1 188  -.4098309  25.03254  24.38149 26.275164 26.039864 3898590100.0000005
    1 189   -.398745 25.040806 24.385704 26.334557 26.092085         5159494000
    1 190  -.3888373 25.057514  24.40465  26.42336 26.141714         4707259000
    1 191  -.3799291  25.06828 24.417986  26.32855 26.188995         5154989000
    1 192  -.3926442  25.08009  24.42011 26.434795  26.00346         7198971000
    1 193  -.4122583   25.0791  24.41608 26.441025  25.77548         4531522500
    1 194  -.4464336 25.060715 24.405777 26.355185 25.479685         5508692300
    1 195  -.5207927 25.047094 24.410847  26.36112  25.05779 3155093999.9999995
    1 196  -.5022713   25.0442  24.42856 26.361794 25.174534         3642279670
    1 197  -.4876704 25.053484  24.43476  26.44118  25.27906         3121925700
    1 198  -.4758632 25.062735  24.43063 26.459536  25.37369         3641415600
    1 199  -.4661172   25.0582 24.438534  26.52647  25.46013         4024513680
    1 200  -.4621955 25.071663 24.439955  26.47118 25.485996         3338822400
    1 201  -.4584838 25.083437  24.46421  26.41818  25.51121 2627855600.0000005
    1 202  -.4549657 25.099386 24.471384  26.53343   25.5358         2732542100
    1 203  -.4516264 25.116714  24.47673 26.513115   25.5598         3212349400
    1 204  -.4579364  25.12411  24.49342 26.586784 25.475487 2184714999.9999995
    1 205  -.4655403 25.132515   24.5047  26.61458 25.383404         2908174000
    1 206  -.4748756 25.131474  24.51906 26.552864 25.281975 1464643999.9999998
    1 207  -.4866017  25.15096 24.528437  26.52487  25.16908         3198851900
    1 208  -.4917439  25.15118 24.526365 26.652285  25.22819         1855845000
    1 209  -.4963531 25.153826 24.526106   26.6098 25.283995         2324880000
    1 210  -.5005082 25.158373 24.529787   26.6212  25.33685         2824217100
    1 211  -.5042733  25.15772 24.539467  26.64511  25.38705         2626663000
    1 212  -.4442209 25.164667  24.54368  26.62567  25.41411         4065377500
    1 213  -.3904413  25.17458  24.54884  26.64671  25.44046 2914032600.0000005
    1 214  -.4704591  25.18044   24.5577  26.70043 25.466133 2670413099.9999995
    1 215 -.55295974  25.18202 24.566553  26.70504  25.49116 2539477900.0000005
    1 216   -.572958  25.19662 24.568064  26.71071 25.445786         2202961100
    1 217 -.59539515 25.204245  24.57537  26.72189  25.39825 3850374199.9999995
    1 218  -.6168424 25.211456 24.572275   26.6272 25.348343         3714739700
    1 219  -.6411762  25.21467 24.580536 26.637714  25.29581         4616328000
    1 220  -.6138664 25.225513 24.587677  26.53692 25.293976 4156828999.9999995
    1 221 -.58718747 25.238363  24.59189  26.59465 25.292133         3909162700
    1 222  -.6102509  25.24451 24.598833 26.607067  25.29029 3131935799.9999995
    1 223  -.6339491  25.26162  24.60125 26.576183  25.28844      2659990341.14
    1 224  -.5423384   25.2675  24.62014  26.63842  25.35121         4696375000
    1 225  -.4677082  25.27056 24.618816  26.61273 25.410275         3436546500
    1 226  -.4870888 25.275354  24.63838  26.59753 25.466043         4061570000
    1 227 -.50481105 25.283426 24.645655 26.558094 25.518864         2446719200
    1 228 -.58412063 25.298016  24.65299   26.5529  25.57837         1943252700
    1 229  -.6604876  25.30838   24.6646 26.626234 25.634533 3453686899.9999995
    1 230  -.6490103 25.316254  24.66421  26.65636  25.68771 3336749700.0000005
    1 231  -.6387751 25.333197 24.685873    26.669   25.7382 4021144500.0000005
    1 232  -.6909868  25.33441 24.682354  26.69384 25.680395         4330595700
    1 233  -.7532732  25.34441 24.684187 26.641603 25.619043 3643660300.0000005
    1 234  -.7108687 25.361317  24.69885  26.63476  25.55368         3041885800
    1 235  -.6644375 25.366293 24.709745  26.61244 25.483746 2081548700.0000002
    1 236  -.6526583  25.36727  24.70871  26.58559  25.51803         4302404000
    1 237  -.6417714  25.38023 24.709984 26.595057  25.55118         3252067000
    1 238  -.6688197  25.37957  24.71339 26.551836 25.583265         3484420000
    1 239  -.6948957  25.35893 24.701015 26.579445 25.614353         4655882000
    1 240  -.5991732 25.254496 24.559576 26.585217 25.612446 4017944999.9999995
    1 241 -.51151013 25.360266 24.671646  26.68953  25.61053         2764237000
    1 242  -.6328675 25.344793  24.63359 26.692535  25.60862 3716479999.9999995
    1 243  -.7715945  25.34092  24.62137  26.79209   25.6067         2508606000
    1 244  -.7088888  25.38513 24.677557  26.78422  25.70711  95046000.00000005
    1 245  -.6599375  25.43335  24.76205  26.81989  25.79835  641768399.9999999
    1 246   -.623453 25.421953  24.72727  26.78773  25.88196         1418213370
    1 247 -.59340864  25.45426 24.785975  26.76945 25.959114          340202000
    2 167  -.2494752 24.984484  24.32811 26.283234 25.834307 2420498800.0000005
    2 168 -.26215103  24.99551  24.33365  26.30383  25.77486         2512864100
    2 169  -.2766859  25.00508  24.34058 26.431854 25.711655         2808673400
    2 170 -.29352218  25.01359  24.34487  26.41602  25.64418         2999270200
    2 171  -.3132555 25.014614 24.352255  26.46504 25.571825         2835626100
    2 172  -.3188052  25.02337 24.352116 26.532267  25.65814 1067602059.9999999
    2 173 -.32353145 25.031504  24.36025  26.57699  25.73759         3408400300
    2 174  -.3276049  25.04379 24.370464  26.59199 25.811193         2958003600
    2 175   -.331152 25.064545  24.38085  26.66431  25.87975         3971983800
    2 176  -.3374248 25.075094  24.39115 26.674105 26.013935         3076483700
    2 177  -.3424327 25.090025  24.39732  26.66734  26.13223         2474171400
    2 178 -.34653935  25.09969 24.406765 26.690033    26.238         3437532100
    2 179  -.3499789 25.107565 24.414364  26.74424 26.333643         4247486000
    2 180 -.35526755 25.119595   24.4282  26.74492 26.347485 3069163999.9999995
    2 181 -.36044315  25.12993 24.446566 26.667114  26.36114         2613559000
    2 182  -.3655092 25.146675  24.45712  26.65966 26.374605 1979742700.0000002
    2 183 -.37046915  25.15806   24.4648  26.62222 26.387896         1878516500
    2 184  -.3800835 25.163803  24.47749  26.69143 26.477116         1413515500
    2 185  -.3882756  25.17805  24.48729 26.723547 26.559025         1520128500
    end
    format %tq time
    label values countryid countryid
    label def countryid 1 "Austria", modify
    label def countryid 2 "Belgium", modify
    Attached Files
    Last edited by Willem vanderMee; 20 Jan 2023, 05:54.

  • #2
    Edit: I have attached the figures that were previously in .gph format. Apologies for that. I have now attached the figures again, but in .pgn format.
    VEC:
    Click image for larger version

Name:	VEC IRF error figures.png
Views:	1
Size:	20.3 KB
ID:	1698048


    VAR:
    Click image for larger version

Name:	VAR IRF error figures.png
Views:	1
Size:	21.2 KB
ID:	1698049

    Comment


    • #3
      It's hard to tell exactly because the images are blurry, but one thing that jumps out is the scale of NEX. I would start by using the natural log of NEX since it appears your other variables are presumably logged as well.

      Comment

      Working...
      X