I'm relatively new to the VAR model and have been using Sean Becketti's 'Introduction to Time Series Using State' as reference and wanted to check if I am on the right track.
As of now, I have 5 variables in the VAR Model. [GDP, Oil prices, Exchanged rates (Expressed in Logs)] , [Inflation Rate and Unemployment Rate (Expressed in percentages)]
I performed the Unit Root tests and all of them proved to be non-stationary and did the Johansen Cointegration tests using
vecrank lrgdp lop lexc inf unp, max ic
The results show that the variables do not have any cointegrating relationships. However, the variables contain a unit root, I don't know if I should estimate the VAR using the variables in their first differences or in levels. I did it in levels
varbasic lrgdp lop lexc inf unp, lags (1 2 3 4 5)
but I'm not sure if it should be that or
varbasic dlrgdp dlop dlexc dinf dunp, lags (1 2 3 4 5)
These are my variables
Code:
Example generated by -dataex-. To install: ssc install dataex
clear
input float(lrgdp lop lexc) double(unp inf) float(Dlrgdp Dlop Dlexc Dunp Dinf)
12.733817 3.571784 1.598734 1.5 7.74278215223094 . . . . .
12.690648 3.568123 1.5978713 1.4 10.2464332036316 -.04316902 -.0036604404 -.0008628368 -.1 2.503651
12.661692 3.487579 1.5771695 2.1 12.291933418694 -.028956413 -.08054447 -.020701766 .7 2.0455003
12.745687 3.6658666 1.614704 1.6 13.1147540983606 .08399487 .17828774 .03753448 -.5 .8228207
12.734313 3.6188145 1.6771152 1.8 14.7381242387332 -.01137352 -.04705215 .06241119 .2 1.62337
12.7117 3.512739 1.7375907 2 14 -.022613525 -.10607576 .06047547 .2 -.7381243
12.695962 3.4593616 1.805854 2.4 13.5689851767389 -.015737534 -.05337715 .06826341 .4 -.4310148
12.754564 3.5122416 1.7645824 1.8 12.3745819397994 .05860233 .05288005 -.04127169 -.6 -1.1944033
12.734605 3.423394 1.7836152 2 11.8895966029724 -.01995945 -.08884788 .019032836 .2 -.48498535
12.70936 3.469064 1.8045276 2.4 11.0423116615067 -.025244713 .04567003 .02091241 .4 -.8472849
12.699594 3.459676 1.893353 2.8 10.8433734939759 -.009765625 -.009387732 .08882523 .4 -.19893816
12.762194 3.4528406 1.9665668 3.2 11.6071428571428 .06259918 -.00683546 .073213935 .4 .7637694
12.752794 3.372798 1.961493 3.6 9.77229601518024 -.009399414 -.0800426 -.005073905 .4 -1.834847
12.759803 3.383712 1.9698684 3.7 9.1078066914498 .007008553 .010914087 .0083755255 .1 -.6644893
12.74189 3.411038 2.0019078 3.8 7.78985507246374 -.017912865 .02732563 .032039404 .1 -1.3179516
12.807036 3.365225 2.015254 2.6 7.28888888888891 .065146446 -.04581285 .013346195 -1.2 -.5009662
12.81646 3.37531 2.0397863 3.2 6.30942091616251 .00942421 .010084867 .02453232 .6 -.979468
12.796157 3.3780425 2.0465481 3.3 6.47359454855195 -.020303726 .002732754 .00676179 .1 .16417363
12.817017 3.337429 2.1241918 3.6 6.13445378151261 .02085972 -.04061341 .07764363 .3 -.3391408
12.866818 3.313822 2.1803722 2.5 5.96520298260146 .04980183 -.023606777 .05618048 -1.1 -.1692508
12.878362 3.309326 2.237168 3 5.69105691056911 .011543274 -.0044965744 .05679584 .5 -.27414608
12.84228 3.293983 2.1853395 2.3 5.75999999999999 -.036082268 -.015342474 -.05182862 -.7 .06894309
12.861259 3.299288 2.121343 3.1 5.77988915281077 .01897907 .005304575 -.06399655 .8 .019889154
12.929962 3.33482 2.0523486 2 5.62939796716187 .06870365 .035532236 -.06899428 -1.1 -.1504912
12.903667 2.842581 1.9905694 2 5.76923076923076 -.02629471 -.492239 -.06177926 0 .1398328
12.897962 2.521185 2.001881 1.9 6.05143721633889 -.005705833 -.3213961 .01131153 -.1 .28220645
12.89723 2.521185 1.9996946 2.3 8.00898203592812 -.0007314682 0 -.0021862984 .4 1.9575448
12.971673 2.6837575 2.010828 1.7 8.80829015544041 .07444286 .1625726 .011133432 -.6 .7993081
12.92926 2.873941 1.950964 2.4 9.96363636363637 -.04241371 .19018364 -.05986404 .7 1.1553462
12.932686 2.911807 1.9037777 1.8 9.70042796005709 .003426552 .03786588 -.04718626 -.6 -.2632084
12.893644 2.941276 1.906605 2.2 7.90020790020794 -.03904152 .029469013 .0028271675 .4 -1.80022
12.984353 2.876761 1.8676294 1.9 7.41496598639454 .09070873 -.064515114 -.03897548 -.3 -.4852419
12.946301 2.757052 1.8508142 2.5 7.07671957671957 -.0380516 -.11970901 -.016815186 .6 -.3382464
12.911412 2.778198 1.833541 2.9 7.02210663198959 -.03488922 .02114606 -.017273188 .4 -.05461295
12.90235 2.6452286 1.922188 3.4 6.61528580603723 -.009062767 -.13296938 .08864713 .5 -.4068208
12.970265 2.576168 1.88874 3.9 6.01646611779607 .06791592 -.069060326 -.03344822 .5 -.5988197
12.919985 2.834585 1.9055742 4.8 4.69425571340333 -.05028057 .25841665 .016834259 .9 -1.3222104
12.94254 2.916148 1.947119 4.76666666666667 4.67800729040098 .02255535 .08156276 .0415448 -.033333335 -.016248424
12.918333 2.857045 1.951395 5.03333333333333 4.51807228915663 -.024207115 -.05910301 .004276037 .26666668 -.159935
12.99056 2.9295924 1.9239225 4.93333333333333 4.30107526881723 .07222748 .072547674 -.027472496 -.1 -.21699703
12.966217 2.968532 1.876953 5.66666666666667 4.36578171091446 -.02434349 .03893995 -.04696953 .7333333 .064706445
12.940326 2.761275 1.8701546 5.16666666666667 3.83052814857803 -.025891304 -.20725727 -.006798387 -.5 -.5352536
12.928958 3.2448034 1.8171023 5.2 3.80403458213255 -.011367798 .4835284 -.05305231 .033333335 -.026493566
13.01213 3.433987 1.768508 4.83333333333333 4.524627720504 .0831728 .1891837 -.04859436 -.3666667 .7205932
12.980206 2.988204 1.7871656 5.6 3.90050876201245 -.0319252 -.4457831 .018657684 .7666667 -.624119
12.994061 2.908539 1.910165 5.23333333333333 3.80100614868644 .013855934 -.07966495 .12299943 -.3666667 -.09950262
12.965244 2.966475 1.9188864 5.46666666666667 3.49805663520268 -.028817177 .05793595 .008721352 .23333333 -.3029495
13.03053 2.989043 1.8550003 5.5 2.57534246575342 .06528664 .022568226 -.063886166 .033333335 -.9227142
13.03316 2.862582 1.8492314 6.1 2.33949945593033 .00262928 -.1264615 -.005768895 .6 -.235843
13.002828 2.979772 1.8425794 5.96666666666667 2.4232633279483 -.030332565 .1171906 -.006651998 -.13333334 .08376388
13.011215 2.995566 1.7568114 6 2.30686695278971 .008387566 .015793324 -.08576798 .033333335 -.11639638
13.063393 2.9421556 1.8557254 5.63333333333333 2.24358974358973 .05217743 -.05341005 .09891403 -.3666667 -.06327721
13.03319 2.889816 1.9392883 6.26666666666667 2.60499734183944 -.03020191 -.05233955 .08356285 .6333333 .3614076
13.020434 2.890001 1.9237765 6.1 2.41850683491062 -.012756348 .00018525124 -.01551175 -.16666667 -.1864905
13.036485 2.785011 1.981176 6.1 2.14997378080752 .016050339 -.10499 .05739963 0 -.26853305
13.129934 2.705603 1.99125 5.33333333333333 1.98537095088822 .0934496 -.07940865 .01007378 -.7666667 -.16460283
13.086267 2.629728 2.0071983 5.63333333333333 1.2435233160622 -.04366684 -.07587433 .015948415 .3 -.7418476
13.094742 2.789323 1.97535 5.66666666666667 .975359342915802 .00847435 .15959454 -.031848192 .033333335 -.26816398
13.069872 2.83615 1.92342 5.36666666666667 1.54004106776183 -.02486992 .04682732 -.05193007 -.3 .5646817
13.167482 2.8096035 1.907233 4.96666666666667 1.74180327868853 .09761047 -.026546717 -.016186953 -.4 .2017622
13.138304 2.846265 1.8751172 5.53333333333333 2.66120777891503 -.02917862 .036661625 -.032115936 .56666666 .9194045
13.106668 2.9001386 1.8304694 5.2 2.69445856634468 -.031635284 .05387354 -.04464781 -.3333333 .033250786
13.13269 2.7997174 1.8410743 4.8 2.3255813953488 .02602291 -.1004212 .010604978 -.4 -.3688772
13.203746 2.83184 1.8371985 4.2 2.16515609264855 .07105446 .032122374 -.0038758516 -.6 -.1604253
13.192417 2.9076295 1.8587487 5 .897308075772663 -.011328697 .0757897 .02155018 .8 -1.267848
13.162365 2.9697304 1.8772483 5 .990099009900991 -.030052185 .06210089 .018499613 0 .09279093
13.191945 3.026746 1.8584784 4.76666666666667 1.38339920948619 .029580116 .0570159 -.01876986 -.23333333 .3933002
13.232254 3.138244 1.8616062 4.23333333333333 1.77427304090683 .04030895 .11149788 .003127813 -.53333336 .3908738
13.214523 3.048483 1.8915474 4.26666666666667 3.06324110671939 -.017730713 -.08976126 .0299412 .033333335 1.288968
13.248065 2.91723 1.9568384 4.23333333333333 2.69607843137256 .03354168 -.13125277 .06529093 -.033333335 -.3671627
13.222542 2.9262035 2.0096192 3.96666666666667 2.29044834307992 -.025523186 .00897336 .05278087 -.26666668 -.4056301
13.29889 2.935982 1.963833 3.2 2.22760290556901 .0763483 .009778738 -.04578638 -.7666667 -.06284544
13.286092 2.6506565 2.0201964 3.3 2.15723873441995 -.01279831 -.28532577 .05636358 .1 -.07036417
13.259114 2.586259 2.0167592 3.46666666666667 2.2434367541766 -.02697754 -.064397335 -.003437281 .16666667 .08619802
13.23906 2.565206 2.0330641 3.1 2.28680323963794 -.02005291 -.021053314 .01630497 -.3666667 .04336648
13.30432 2.472328 2.0134616 2.5 2.32117479867363 .06525898 -.09287786 -.019602537 -.6 .03437156
13.283984 2.454734 2.0364158 2.8 2.25246363209761 -.02033615 -.017594099 .022954226 .3 -.06871117
13.26049 2.774462 2.0538929 2.96666666666667 2.47432306255837 -.023492813 .3197281 .017477036 .16666667 .22185943
13.274122 3.017657 2.0596468 3.2 2.04937121564973 .013630867 .2431948 .005753994 .23333333 -.42495185
13.34865 3.169966 2.065874 3.16666666666667 2.68518518518515 .07452679 .15230894 .006227255 -.033333335 .635814
13.348047 3.2815375 2.1065755 3.4 2.89123451124368 -.0006017685 .11157179 .04070139 .23333333 .20604932
13.287727 3.287157 2.1722455 3.2 2.91571753986331 -.0603199 .005619764 .06567001 -.2 .02448303
13.296283 3.397301 2.1921618 3.33333333333333 3.42309447740759 .008555412 .11014366 .019916296 .13333334 .5073769
13.361666 3.3901365 2.2251422 3.03333333333333 3.11091073038775 .06538296 -.007164478 .032980442 -.3 -.3121837
13.35588 3.260785 2.1848927 3.33333333333333 3.52363960749332 -.005785942 -.12935114 -.04024959 .3 .4127289
13.310266 3.285662 2.216909 3.36666666666667 3.93979637007527 -.04561424 .024876595 .032016277 .033333335 .4161568
13.320636 3.227373 2.19689 3.56666666666667 2.5595763459841 .010370255 -.05828905 -.020018816 .2 -1.38022
13.38958 2.9607956 2.1861658 3.36666666666667 2.0113686051596 .06894302 -.26657724 -.010724306 -.2 -.54820776
13.34324 3.040865 2.1871219 3.73333333333333 1.0340370529944 -.04633999 .0800693 .0009560585 .3666667 -.9773316
13.364398 3.226976 2.1021235 3.73333333333333 .468483816013621 .02115917 .1861112 -.08499837 0 -.56555325
13.324635 3.2934885 2.0180607 3.66666666666667 1.41996557659209 -.03976345 .066512346 -.08406281 -.06666667 .9514818
13.40151 3.286036 1.9903824 3.53333333333333 2.22888984140592 .07687569 -.007452488 -.02767825 -.13333334 .8089243
13.380116 3.444789 1.9540068 3.96666666666667 4.60554371002131 -.02139473 .1587529 -.03637564 .4333333 2.376654
13.33437 3.2766414 1.9471028 4.33333333333333 2.24671470962272 -.04574585 -.16814756 -.006904006 .3666667 -2.358829
13.34543 3.345802 1.9928846 4.43333333333333 1.90920661858297 .011060715 .0691607 .04578185 .1 -.3375081
13.410333 3.379633 1.9342626 4.1 1.21593291404613 .064902306 .03383112 -.058622 -.3333333 -.6932737
13.425058 3.46979 1.932487 4.13333333333333 -1.42682429677945 .014725685 .09015703 -.001775503 .033333335 -2.642757
13.385754 3.5730944 1.9257075 4.33333333333333 .829187396351576 -.03930473 .10330415 -.006779671 .2 2.2560117
13.367247 3.702618 1.9261932 4.5 1.20732722731057 -.018507004 .12952352 .00048577785 .16666667 .3781398
13.447302 3.754901 1.8458267 4.13333333333333 1.24275062137531 .08005524 .05228329 -.0803665 -.3666667 .035423394
end