Assessment 2 Stata
Assessment 2 Stata
15.00
14.00
lnRGDP
13.00
12.00
11.00
0.40
0.30
GCF(k)
0.20
0.10
b) Undertake unit root test using Augmented-Dickey Fuller unit root test (with and without constant, with
trend and without trend) etc. at level? Report the result and identify variables that have unit root problem
(non-stationary) and stationary (no unit root problem)? Do all variables are stationary at level? If no, what
is next?
. dfuller lnRGDP, constant lag(0)
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
c) Undertake unit root test using Augmented-Dickey Fuller unit root test (with and without constant, with
trend and without trend) at first difference if there is/are non-stationary variable/s at question a? If there
is still non-stationary variable, at second difference run the units root test? What is the result now? If all
variables are stationary at different order what method you intended to use?
. dfuller d1.lnRGDP, constant lag(0)
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Selection-order criteria
Sample: 1984 - 2023 Number of obs = 40
e) Undertake Johanson Co-integration test and identify the presence of long-run relationship or not? And
how much long-run relationship exists?
. vecrank lnRGDP lnLP INF OPEN GCFk lnFDI, trend(constant)
5%
maximum trace critical
rank parms LL eigenvalue statistic value
0 42 -60.570137 . 119.0326 94.15
1 53 -36.40331 0.68362 70.6990 68.52
2 62 -21.262107 0.51374 40.4166* 47.21
3 69 -11.24941 0.37923 20.3912 29.68
4 74 -5.5607739 0.23730 9.0139 15.41
5 77 -2.3238155 0.14285 2.5400 3.76
6 78 -1.0538221 0.05868
f) Estimate the long-run and short-run estimates using VECM (vector Error correction Model)?
. vec lnRGDP lnLP INF OPEN GCFk lnFDI, trend(constant)
D_lnRGDP
_ce1
L1. .0507825 .0344699 1.47 0.141 -.0167772 .1183423
lnRGDP
LD. .0289351 .1967938 0.15 0.883 -.3567737 .4146438
lnLP
LD. -.1552272 .2477698 -0.63 0.531 -.640847 .3303926
INF
LD. .0001766 .0011093 0.16 0.874 -.0019976 .0023507
OPEN
LD. .0076027 .0032266 2.36 0.018 .0012786 .0139268
GCFk
LD. .2482783 .2714232 0.91 0.360 -.2837015 .7802581
lnFDI
LD. -.0002838 .0025704 -0.11 0.912 -.0053216 .0047541
D_lnLP
_ce1
L1. -.0044866 .0116984 -0.38 0.701 -.027415 .0184417
lnRGDP
LD. .6515921 .0667877 9.76 0.000 .5206906 .7824936
lnLP
LD. .2794474 .0840879 3.32 0.001 .1146382 .4442567
INF
LD. -.0002661 .0003765 -0.71 0.480 -.001004 .0004717
OPEN
LD. .0001617 .0010951 0.15 0.883 -.0019845 .002308
GCFk
LD. .1964101 .0921154 2.13 0.033 .0158673 .376953
lnFDI
LD. .0004111 .0008723 0.47 0.637 -.0012986 .0021209
D_INF
_ce1
L1. -2.066523 5.802213 -0.36 0.722 -13.43865 9.305607
lnRGDP
LD. -88.85891 33.12571 -2.68 0.007 -153.7841 -23.9337
lnLP
LD. 24.64216 41.70634 0.59 0.555 -57.10077 106.3851
INF
LD. -.1397635 .1867234 -0.75 0.454 -.5057346 .2262075
OPEN
LD. 1.013746 .5431304 1.87 0.062 -.0507696 2.078262
GCFk
LD. 4.812512 45.68786 0.11 0.916 -84.73405 94.35907
lnFDI
LD. -.8749578 .4326655 -2.02 0.043 -1.722967 -.0269491
D_OPEN
_ce1
L1. 7.725559 1.414951 5.46 0.000 4.952307 10.49881
lnRGDP
LD. -3.443999 8.078166 -0.43 0.670 -19.27691 12.38892
lnLP
LD. -25.43387 10.17067 -2.50 0.012 -45.36802 -5.499718
INF
LD. -.2238752 .0455351 -4.92 0.000 -.3131224 -.1346281
OPEN
LD. .501957 .1324499 3.79 0.000 .2423599 .7615541
GCFk
LD. -11.49174 11.14162 -1.03 0.302 -33.32892 10.34544
lnFDI
LD. -.3199437 .1055115 -3.03 0.002 -.5267424 -.113145
D_GCFk
_ce1
L1. -.0634868 .01725 -3.68 0.000 -.0972962 -.0296775
lnRGDP
LD. .3524517 .0984827 3.58 0.000 .1594291 .5454742
lnLP
LD. .2274653 .1239929 1.83 0.067 -.0155564 .4704869
Cointegrating equations
_ce1
lnRGDP 1 . . . . .
lnLP .6094553 .4173725 1.46 0.144 -.2085798 1.42749
INF .0407158 .0074674 5.45 0.000 .0260801 .0553516
OPEN -.0566145 .0063327 -8.94 0.000 -.0690264 -.0442026
GCFk 8.224228 2.095426 3.92 0.000 4.117268 12.33119
lnFDI .0193136 .0122189 1.58 0.114 -.004635 .0432621
_cons -18.15695 . . . . .
g) Assuming each variable interact each other’s, estimate the model using VAR (vector autoregrression)
. var lnRGDP lnLP INF OPEN GCFk lnFDI
Vector autoregression
lnRGDP
lnRGDP
L1. .8985024 .1832825 4.90 0.000 .5392752 1.25773
L2. .1325099 .1763376 0.75 0.452 -.2131053 .4781252
lnLP
L1. -.5081734 .2424338 -2.10 0.036 -.9833349 -.0330119
L2. .3402483 .2300201 1.48 0.139 -.1105828 .7910794
INF
L1. .0014107 .0012602 1.12 0.263 -.0010593 .0038807
L2. -.0002996 .0011476 -0.26 0.794 -.0025489 .0019496
OPEN
L1. .0041307 .0031689 1.30 0.192 -.0020803 .0103417
L2. -.0033336 .0032523 -1.02 0.305 -.009708 .0030409
GCFk
L1. .5334575 .3626176 1.47 0.141 -.1772599 1.244175
L2. -.1106144 .3218392 -0.34 0.731 -.7414078 .5201789
lnFDI
L1. .0012973 .0025277 0.51 0.608 -.0036569 .0062516
L2. .0010924 .0027427 0.40 0.690 -.0042832 .006468
lnLP
L1. 1.265844 .082621 15.32 0.000 1.10391 1.427778
L2. -.3425495 .0783905 -4.37 0.000 -.496192 -.188907
INF
L1. .0001249 .0004295 0.29 0.771 -.0007169 .0009666
L2. .0006512 .0003911 1.67 0.096 -.0001153 .0014178
OPEN
L1. .001685 .00108 1.56 0.119 -.0004316 .0038017
L2. .0003028 .0011084 0.27 0.785 -.0018696 .0024752
GCFk
L1. .2113129 .1235795 1.71 0.087 -.0308984 .4535241
L2. -.0901899 .1096823 -0.82 0.411 -.3051632 .1247833
lnFDI
L1. .0008973 .0008614 1.04 0.298 -.0007911 .0025857
L2. .0010613 .0009347 1.14 0.256 -.0007707 .0028933
INF
lnRGDP
L1. -40.31594 26.49477 -1.52 0.128 -92.24475 11.61286
L2. 67.67777 25.49083 2.65 0.008 17.71666 117.6389
lnLP
L1. -40.6393 35.0455 -1.16 0.246 -109.3272 28.04863
L2. 54.48039 33.25102 1.64 0.101 -10.69041 119.6512
INF
L1. .1546913 .1821722 0.85 0.396 -.2023597 .5117424
L2. -.2491034 .1658939 -1.50 0.133 -.5742495 .0760427
OPEN
L1. .5713307 .4580899 1.25 0.212 -.3265089 1.46917
L2. -.9778249 .4701486 -2.08 0.038 -1.899299 -.0563505
GCFk
L1. -31.70784 52.41892 -0.60 0.545 -134.447 71.03135
L2. -44.07237 46.52412 -0.95 0.343 -135.258 47.11322
lnFDI
L1. -.8104045 .3654014 -2.22 0.027 -1.526578 -.0942309
L2. .4447796 .3964775 1.12 0.262 -.332302 1.221861
lnLP
L1. -16.50672 9.65953 -1.71 0.087 -35.43905 2.425616
L2. 30.85435 9.164919 3.37 0.001 12.89144 48.81726
INF
L1. .0106413 .0502118 0.21 0.832 -.0877721 .1090546
L2. .1351215 .045725 2.96 0.003 .0455021 .224741
OPEN
L1. .7912413 .1262625 6.27 0.000 .5437714 1.038711
L2. -.3213876 .1295862 -2.48 0.013 -.5753719 -.0674032
GCFk
L1. 16.19766 14.44813 1.12 0.262 -12.12016 44.51548
L2. -21.32492 12.82336 -1.66 0.096 -46.45825 3.808403
lnFDI
L1. -.0742649 .1007149 -0.74 0.461 -.2716625 .1231328
L2. .3224525 .1092804 2.95 0.003 .1082669 .5366382
lnLP
L1. .2500199 .1135552 2.20 0.028 .0274559 .4725839
L2. -.3126033 .1077406 -2.90 0.004 -.5237711 -.1014355
INF
L1. -.0015922 .0005903 -2.70 0.007 -.0027491 -.0004353
L2. -.0005705 .0005375 -1.06 0.289 -.001624 .000483
OPEN
L1. .0007261 .0014843 0.49 0.625 -.0021831 .0036353
L2. .0042128 .0015234 2.77 0.006 .001227 .0071985
GCFk
L1. -.2104359 .1698488 -1.24 0.215 -.5433335 .1224617
L2. .1652101 .1507484 1.10 0.273 -.1302513 .4606716
lnFDI
L1. .0026906 .001184 2.27 0.023 .0003701 .0050112
L2. -.0019032 .0012847 -1.48 0.138 -.0044211 .0006147
lnFDI
lnRGDP
L1. -4.121028 10.29804 -0.40 0.689 -24.30482 16.06276
L2. 6.261979 9.907827 0.63 0.527 -13.15701 25.68096
lnLP
L1. -10.64837 13.62156 -0.78 0.434 -37.34613 16.04939
L2. -3.025055 12.92407 -0.23 0.815 -28.35577 22.30566
INF
L1. .0615492 .0708071 0.87 0.385 -.0772301 .2003285
L2. -.0122778 .06448 -0.19 0.849 -.1386563 .1141006
OPEN
L1. -.4866538 .1780513 -2.73 0.006 -.8356279 -.1376797
L2. .5763307 .1827383 3.15 0.002 .2181702 .9344912
GCFk
L1. 2.288779 20.37429 0.11 0.911 -37.64409 42.22165
L2. 1.620746 18.08309 0.09 0.929 -33.82146 37.06295
lnFDI
L1. .321275 .142025 2.26 0.024 .0429112 .5996388
L2. .3721435 .1541037 2.41 0.016 .0701058 .6741812
multicollinearity:
. estat vif
Heteroskedasticity:
. hettest
chi2(1) = 0.22
Prob > chi2 = 0.6376
Autocorrelation:
. pwcorr lnRGDP lnLP INF OPEN GCFk lnFDI, sig
lnRGDP 1.0000
Normality:
. swilk lnRGDP lnLP INF OPEN GCFk lnFDI
model stability:
. ovtest
2. Using panel data, suppose you are interested to investigate the determinants of Economic growth in
four
selected east African countries, namely (Ethiopia, Kenya, Uganda and Djibouti with Panel ID, 1, 2, 3 & 4
respectively) from 2000 to 2018. Where RGDP is the dependent variable, however, lp is labour
productivity, K is capital (Gross capital formation), la (land area) and Inf is inflation rate).
a) Plot graphically for all variables
. xtset id year
panel variable: id (strongly balanced)
time variable: year, 2000 to 2018
delta: 1 unit
1 2
0.0020.00
60.00 -20.00 60.00
40.00
3 4
0.00
-20.00 40.00
20.00
Statistic p-value
Unadjusted t 1.2627
Adjusted t* 1.3740 0.9153
.
. xtunitroot llc K
Statistic p-value
Unadjusted t -0.6523
Adjusted t* -0.7098 0.2389
Statistic p-value
Unadjusted t 1.0232
Adjusted t* 1.1134 0.8672
. xtunitroot llc la
Statistic p-value
Unadjusted t -0.2026
Adjusted t* -0.2205 0.4127
. xtunitroot llc inf
Statistic p-value
Unadjusted t -0.6219
Adjusted t* -0.6767 0.2493
F(4,68) = 16.75
corr(u_i, Xb) = -0.2862 Prob > F = 0.0000
sigma_u 5.9747698
sigma_e 4.6570745
rho .62206355 (fraction of variance due to u_i)
F test that all u_i=0: F(3, 68) = 18.17 Prob > F = 0.0000
.
. xtreg rgdp lp K la inf,be
note: lp omitted because of collinearity
F(3,0) = .
sd(u_i + avg(e_i.))= 0 Prob > F = .
lp 0 (omitted)
K 2.280461 . . . . .
la -5.237818 . . . . .
inf -.8037623 . . . . .
_cons 17.83259 . . . . .
sigma_u 0
sigma_e 4.6570745
rho 0 (fraction of variance due to u_i)
rgdp
L1. -.0791192 .1131332 -0.70 0.484 -.3008563 .1426178