You are on page 1of 10

Econometric Analysis II Friday October 9 14:24:07 2020 Page 1

___ ____ ____ ____ ____(R)


/__ / ____/ / ____/
___/ / /___/ / /___/
Statistics/Data Analysis

User: Pulak Mishra


Project: Granger Causality

___ ____ ____ ____ ____ (R)


/__ / ____/ / ____/
___/ / /___/ / /___/ 13.1 Copyright 1985-2013 StataCorp LP
Statistics/Data Analysis StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC http://www.stata.com
979-696-4600 stata@stata.com
979-696-4601 (fax)

50-student Stata lab perpetual license:


Serial number: 301306257722
Licensed to: Pulak Mishra
IIT Kharagpur

Notes:

1 . *(6 variables, 57 observations pasted into data editor)

2 . tsset time, yearly


time variable: time, 1 to 57 Setting data on gdp_con and save_con as time-series
delta: 1 year

3 . varsoc save_con gdp_con Selection of lag length for the model: save_con=f(gdp_con)

Selection-order criteria
Sample: 5 - 57 Number of obs = 53

lag LL LR df p FPE AIC HQIC SBIC

0 -1396.4 2.8e+20 52.7698 52.7984 52.8442


1 -1184.77 423.26 4 0.000 1.1e+17* 44.9348* 45.0206* 45.1578*
2 -1182.58 4.3845 4 0.356 1.2e+17 45.003 45.146 45.3748
3 -1180.95 3.2541 4 0.516 1.3e+17 45.0925 45.2927 45.613
4 -1173.7 14.51* 4 0.006 1.2e+17 44.9697 45.227 45.6389

Endogenous: save_con gdp_con


Exogenous: _cons

4 . reg save_con L(1/1).save_con L(1/1).gdp_con Regression of save_con on gdp_con

Source SS df MS Number of obs = 56


F( 2, 53) = 4722.59 Statistically significant
Model 1.9154e+12 2 9.5772e+11 Prob > F = 0.0000 model with very high
Residual 1.0748e+10 53 202796124 R-squared = 0.9944
Adj R-squared = 0.9942
explanatory power
Total 1.9262e+12 55 3.5022e+10 Root MSE = 14241

save_con Coef. Std. Err. t P>|t| [95% Conf. Interval]


Both lagged save_con
save_con and lagged gdp_con have
L1. .9481241 .0779708 12.16 0.000 .7917345 1.104514
significant influence on
gdp_con save_con.
L1. .040363 .0213994 1.89 0.065 -.0025588 .0832848 The coefficient of lagged
gdp_con is significant at
_cons -12909.27 6801.752 -1.90 0.063 -26551.86 733.3158 10 percent.
Econometric Analysis II Friday October 9 14:24:08 2020 Page 2

5 . test L1.gdp_con

( 1) L.gdp_con = 0

F( 1, 53) = 3.56 Restricted F test confirms the influence of lagged gdp_con on


Prob > F = 0.0648 save_con at 10 percent
6 . varsoc gdp_con save_con Selection of lag length for the model: gdp_con=f(save_con)
Selection-order criteria
Sample: 5 - 57 Number of obs = 53

lag LL LR df p FPE AIC HQIC SBIC

0 -1396.4 2.8e+20 52.7698 52.7984 52.8442


1 -1184.77 423.26 4 0.000 1.1e+17* 44.9348* 45.0206* 45.1578*
2 -1182.58 4.3845 4 0.356 1.2e+17 45.003 45.146 45.3748
3 -1180.95 3.2541 4 0.516 1.3e+17 45.0925 45.2927 45.613
4 -1173.7 14.51* 4 0.006 1.2e+17 44.9697 45.227 45.6389

Endogenous: gdp_con save_con


Exogenous: _cons

7 . reg gdp_con L(1/1).gdp_con L(1/1).save_con Regression of gdp_con on save_con

Source SS df MS Number of obs = 56


F( 2, 53) =23845.27
Model 2.4837e+13 2 1.2419e+13 Prob > F = 0.0000 Statistically significant
Residual 2.7602e+10 53 520795125 R-squared = 0.9989 model with very high
Adj R-squared = 0.9988 explanatory power
Total 2.4865e+13 55 4.5208e+11 Root MSE = 22821

gdp_con Coef. Std. Err. t P>|t| [95% Conf. Interval]

gdp_con Both lagged save_con


L1. .9955684 .034293 29.03 0.000 .9267853 1.064352 and lagged gdp_con have
significant influence on
save_con gdp_con.
L1. .3144877 .1249498 2.52 0.015 .0638703 .5651052 The coefficient of lagged
save_con is significant at
_cons 3565.758 10899.95 0.33 0.745 -18296.77 25428.28
5 percent.

8 . test L1.save_con

( 1) L.save_con = 0

F( 1, 53) = Restricted F test confirms the influence of lagged save_con on


6.33
Prob > F = gdp_con at 5 percent
0.0149
The results suggest both way Granger causality between gdp_con and save_con
9 . quitely var save_con gdp_con
unrecognized command: quitely
r(199); To be ignored
Econometric Analysis II Friday October 9 14:24:09 2020 Page 3

10 . quitely var save_con gdp_con, lag(1/1)


unrecognized command: quitely
r(199); To be ignored
11 . var save_con gdp_con, lag(1/1) VAR approach to Granger Causality Test: save_con=f(gdp_con)
Vector autoregression

Sample: 2 - 57 No. of obs = 56


Log likelihood = -1249.014 AIC = 44.82192
FPE = 1.00e+17 HQIC = 44.90605
Det(Sigma_ml) = 8.09e+16 SBIC = 45.03892

Equation Parms RMSE R-sq chi2 P>chi2

save_con 3 14240.7 0.9944 9979.816 0.0000 Both the estimated models are
gdp_con 3 22820.9 0.9989 50390.01 0.0000 statistically significant

Coef. Std. Err. z P>|z| [95% Conf. Interval]

save_con
save_con Both lagged save_con
L1. .9481241 .0758535 12.50 0.000 .7994539 1.096794 and lagged gdp_con have
significant influence on
gdp_con save_con.
L1. .040363 .0208183 1.94 0.053 -.0004402 .0811662 The coefficient of lagged
gdp_con is significant at
_cons -12909.27 6617.054 -1.95 0.051 -25878.46 59.91758
10 percent.
gdp_con
save_con Both lagged save_con and
L1. .3144877 .1215568 2.59 0.010 .0762407 .5527347 lagged gdp_con have
significant influence on
gdp_con gdp_con.
L1. .9955684 .0333618 29.84 0.000 .9301804 1.060956 The coefficient of lagged

_cons 3565.758 10603.97 0.34 0.737 -17217.63 24349.15


save_con is significant at
5 percent.

12 . vargranger

Granger causality Wald tests

Equation Excluded chi2 df Prob > chi2


As the Chi-squared statistic
save_con gdp_con 3.759 1 0.053
is significant (at 10 percent) - gdp_con
save_con ALL 3.759 1 0.053
Granger causes save_con.
gdp_con save_con 6.6934 1 0.010 As the Chi-squared statistic
gdp_con ALL 6.6934 1 0.010 is significant (at 5 percent) - save_con
Granger causes gdp_con.
Suggests both way Granger causality between gdp_con and save_con
13 . var save_con gdp_con, lag(1/1) dfk small VAR approach to Granger Causality Test with F test: save_con=f(gdp_con)

Vector autoregression

Sample: 2 - 57 No. of obs = 56


Log likelihood = -1249.014 AIC = 44.82192
FPE = 1.00e+17 HQIC = 44.90605
Det(Sigma_ml) = 8.09e+16 SBIC = 45.03892
Econometric Analysis II Friday October 9 14:24:09 2020 Page 4

Equation Parms RMSE R-sq F P > F

save_con 3 14240.7 0.9944 4722.591 0.0000 Both the estimated models are
gdp_con 3 22820.9 0.9989 23845.27 0.0000 statistically significant

Coef. Std. Err. t P>|t| [95% Conf. Interval]

save_con
save_con Both lagged save_con
L1. .9481241 .0779708 12.16 0.000 .7917345 1.104514 and lagged gdp_con have
significant influence on
gdp_con save_con.
L1. .040363 .0213994 1.89 0.065 -.0025588 .0832848 The coefficient of lagged
gdp_con is significant at
_cons -12909.27 6801.752 -1.90 0.063 -26551.86 733.3158 10 percent.

gdp_con
save_con Both lagged save_con and
L1. .3144877 .1249498 2.52 0.015 .0638703 .5651052 lagged gdp_con have
significant influence on
gdp_con gdp_con.
L1. .9955684 .034293 29.03 0.000 .9267853 1.064352
The coefficient of lagged
_cons 3565.758 10899.95 0.33 0.745 -18296.77 25428.28 save_con is significant at
5 percent.

14 . vargranger

Granger causality Wald tests


As the Restricted F statistic
Equation Excluded F df df_r Prob > F
is significant (at 10 percent)-
save_con gdp_con 3.5576 1 53 0.0648 gdp_con Granger causes
save_con ALL 3.5576 1 53 0.0648 save_con.
As the Restricted F statistic
gdp_con save_con 6.3349 1 53 0.0149 is significant (at 5 percent)-
gdp_con ALL 6.3349 1 53 0.0149 save_con Granger causes
gdp_con.
Suggests both way Granger causality between gdp_con and save_con
15 . generate lngdp_con=ln( gdp_con) Question: Are the variables stationary?
log transformation of the variables
16 . generate lnsave_con=ln( save_con)

17 . varsoc lnsave_con Lag length selection for lnsave_con

Selection-order criteria
Sample: 5 - 57 Number of obs = 53

lag LL LR df p FPE AIC HQIC SBIC

0 -79.9889 1.24398 3.05619 3.07048 3.09336


1 38.3769 236.73 1 0.000 .014838 -1.37271 -1.34412 -1.29836*
2 38.5978 .44187 1 0.506 .015282 -1.34331 -1.30043 -1.23179
3 41.3526 5.5094* 1 0.019 .014305* -1.40953* -1.35235* -1.26083
4 41.796 .88688 1 0.346 .014613 -1.38853 -1.31705 -1.20265

Endogenous: lnsave_con
Exogenous: _cons
Econometric Analysis II Friday October 9 14:24:10 2020 Page 5

18 . varsoc lngdp_con Lag length selection for lngdp_con


Selection-order criteria
Sample: 5 - 57 Number of obs = 53

lag LL LR df p FPE AIC HQIC SBIC

0 -54.5864 .476983 2.0976 2.11189 2.13477


1 113.342 335.86 1 0.000 .000877 -4.20158 -4.17299 -4.12723
2 115.444 4.2046* 1 0.040 .000841* -4.24318* -4.20029* -4.13165*
3 116.219 1.5497 1 0.213 .000848 -4.23468 -4.1775 -4.08598
4 116.234 .02916 1 0.864 .000881 -4.1975 -4.12602 -4.01162

Endogenous: lngdp_con
Exogenous: _cons

19 . dfuller lngdp_con, trend lags(2) ADF test for lngdp_con

Augmented Dickey-Fuller test for unit root Number of obs = 54

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) 1.254 -4.141 -3.496 -3.178

MacKinnon approximate p-value for Z(t) = 1.0000 Presence of unit root => non-stationary series

20 . dfuller lnsave_con, trend lags(3) ADF test for lnsave_con

Augmented Dickey-Fuller test for unit root Number of obs = 53

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -2.157 -4.143 -3.497 -3.178

MacKinnon approximate p-value for Z(t) = 0.5143 Presence of unit root => non-stationary series

21 . reg lnsave_con lngdp_con Test for cointegration between lnsave_con and lngdp_con

Source SS df MS Number of obs = 57


F( 1, 55) = 4402.17 Statistically significant
Model 77.1001849 1 77.1001849 Prob > F = 0.0000
model with very high
Residual .963277274 55 .017514132 R-squared = 0.9877
Adj R-squared = 0.9874 explanatory power
Total 78.0634622 56 1.3939904 Root MSE = .13234

lnsave_con Coef. Std. Err. t P>|t| [95% Conf. Interval]

lngdp_con 1.628394 .0245429 66.35 0.000 1.579209 1.677579


_cons -10.50616 .3297599 -31.86 0.000 -11.16702 -9.84531
Econometric Analysis II Friday October 9 14:24:10 2020 Page 6

22 . predict u, res Predicting u (residual) of the regression

23 . varsoc u Lag length selection for u (residual)

Selection-order criteria
Sample: 5 - 57 Number of obs = 53

lag LL LR df p FPE AIC HQIC SBIC

0 33.5723 .017128 -1.22914 -1.21485 -1.19197


1 43.998 20.851* 1 0.000 .012002* -1.58483* -1.55624* -1.51048*
2 44.7179 1.4399 1 0.230 .012131 -1.57426 -1.53137 -1.46273
3 45.9676 2.4994 1 0.114 .012019 -1.58368 -1.5265 -1.43498
4 46.5664 1.1975 1 0.274 .012206 -1.56854 -1.49706 -1.38267

Endogenous: u
Exogenous: _cons

24 . dfuller u, nodrift lags(2)

Augmented Dickey-Fuller test for unit root Number of obs = 54

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -2.562 -3.574 -2.927 -2.598

MacKinnon approximate p-value for Z(t) = 0.1011 To be ignored

25 . dfuller u, nodrift lags(1) Unit root test for residual of the regression

Augmented Dickey-Fuller test for unit root Number of obs = 55

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -3.735 -3.573 -2.926 -2.598

MacKinnon approximate p-value for Z(t) = 0.0037 Presence of no unit root => variables are cointegrated

26 . varsoc lnsave_con lngdp_con Selection of lag length for the model: lnsave_con=f(lngdp_con)

Selection-order criteria
Sample: 5 - 57 Number of obs = 53

lag LL LR df p FPE AIC HQIC SBIC

0 -20.5699 .008034 .851694 .880286 .926045


1 159.999 361.14* 4 0.000 .00001* -5.81129* -5.72552* -5.58824*
2 163.291 6.5836 4 0.160 .000011 -5.78457 -5.64161 -5.41282
3 165.938 5.2939 4 0.258 .000011 -5.73351 -5.53337 -5.21306
4 168.679 5.482 4 0.241 .000012 -5.686 -5.42868 -5.01684

Endogenous: lnsave_con lngdp_con


Exogenous: _cons
Econometric Analysis II Friday October 9 14:24:10 2020 Page 7

27 . reg lnsave_con L(1/1).lnsave_con L(1/1).lngdp_con Regression of lnsave_con on lagged lnsave_con and


lagged lngdp_con
Source SS df MS Number of obs = 56
F( 2, 53) = 3320.97 Statistically significant
Model 74.0213025 2 37.0106513 Prob > F = 0.0000
model with very high
Residual .590660477 53 .011144537 R-squared = 0.9921
Adj R-squared = 0.9918 explanatory power
Total 74.611963 55 1.35658115 Root MSE = .10557

lnsave_con Coef. Std. Err. t P>|t| [95% Conf. Interval]

lnsave_con
L1. .5757739 .1096849 5.25 0.000 .3557738 .7957741 Both lagged lnsave_con
and lagged lngdp_con
lngdp_con have significant influence
L1. .7109736 .1808605 3.93 0.000 .3482134 1.073734 on lnsave_con.

_cons -4.653856 1.198233 -3.88 0.000 -7.057206 -2.250505

28 . test L1.lngdp_con

( 1) L.lngdp_con = 0

F( 1, 53) = 15.45 Restricted F test confirms influence of lagged lngdp_con on lnsave_con


Prob > F = 0.0002

29 . test L1.lnsave_con

( 1) L.lnsave_con = 0

F( 1, 53) = 27.56 Restricted F test confirms influence of lagged lngdp_con on lnsave_con


Prob > F = 0.0000
Regression of lngdp_con on lagged lnsave_con and lagged
30 . reg lngdp_con L(1/1).lngdp_con L(1/1).lnsave_con lngdp_con

Source SS df MS Number of obs = 56


F( 2, 53) =16784.22 Statistically significant
Model 27.8136562 2 13.9068281 Prob > F = 0.0000 model with very high
Residual .043913989 53 .000828566 R-squared = 0.9984
Adj R-squared = 0.9984
explanatory power
Total 27.8575702 55 .506501276 Root MSE = .02878

lngdp_con Coef. Std. Err. t P>|t| [95% Conf. Interval]

lngdp_con Lagged lngdp_con has


L1. 1.036476 .0493147 21.02 0.000 .9375629 1.135388 significant influence on
lngdp_con.
lnsave_con Lagged lnsave_con does
L1. -.0123747 .0299075 -0.41 0.681 -.0723614 .0476121 not have significant

-.3031321 .3267184 -0.93 0.358 -.9584462 .3521821


influence on lngdp_con.
_cons
Econometric Analysis II Friday October 9 14:24:11 2020 Page 8

31 . test L1.lngdp_con

( 1) L.lngdp_con = 0

F( 1, 53) = 441.74 Restricted F test confirms influence of lagged lngdp_con on lngdp_con


Prob > F = 0.0000

32 . test L1.lnsave_con

( 1) L.lnsave_con = 0

F( 1, 53) = 0.17 Restricted F test confirms no influence of lagged lnsave_con on lngdp_con


Prob > F = 0.6807

33 . var lnsave_con lngdp_con, lag91/1)


option lag91 not allowed
r(198);

34 . var lnsave_con lngdp_con, lag(1/1) VAR approach to Granger causality test: lnsave_con=f(lngdp_con)

Vector autoregression

Sample: 2 - 57 No. of obs = 56


Log likelihood = 169.3565 AIC = -5.834162
FPE = .00001 HQIC = -5.750031
Det(Sigma_ml) = 8.10e-06 SBIC = -5.61716

Equation Parms RMSE R-sq chi2 P>chi2


Statistically significant
lnsave_con 3 .105568 0.9921 7017.895 0.0000 model with very high
lngdp_con 3 .028785 0.9984 35468.53 0.0000
explanatory power

Coef. Std. Err. z P>|z| [95% Conf. Interval]

lnsave_con
lnsave_con
L1. .5757739 .1067065 5.40 0.000 .366633 .7849148 Both lagged lnsave_con
and lagged lngdp_con
lngdp_con have significant influence
L1. .7109736 .1759493 4.04 0.000 .3661192 1.055828 on lnsave_con.

_cons -4.653856 1.165695 -3.99 0.000 -6.938576 -2.369135

lngdp_con Lagged lnsave_con does


lnsave_con
not have significant
L1. -.0123747 .0290953 -0.43 0.671 -.0694005 .0446512
influence on lngdp_con.
lngdp_con Lagged lngdp_con has
L1. 1.036476 .0479756 21.60 0.000 .9424452 1.130506 significant influence on
lngdp_con.
_cons -.3031321 .3178466 -0.95 0.340 -.9260999 .3198357
Econometric Analysis II Friday October 9 14:24:11 2020 Page 9

35 . vargranger

Granger causality Wald tests

Equation Excluded chi2 df Prob > chi2


As the Chi-squared statistic
lnsave_con lngdp_con 16.328 1 0.000 is significant - lngdp_con
lnsave_con ALL 16.328 1 0.000 Granger causes lnsave_con.
lngdp_con lnsave_con .18089 1 0.671 As the Chi-squared statistic
lngdp_con ALL .18089 1 0.671 is not significant - lnsave_con does
not Granger cause lngdp_con.

36 . var lngdp_con lnsave_con, lag(1/1) VAR approach to Granger causality test: lngdp_con=f(lnsave_con)

Vector autoregression

Sample: 2 - 57 No. of obs = 56


Log likelihood = 169.3565 AIC = -5.834162
FPE = .00001 HQIC = -5.750031
Det(Sigma_ml) = 8.10e-06 SBIC = -5.61716

Equation Parms RMSE R-sq chi2 P>chi2


Statistically significant
lngdp_con 3 .028785 0.9984 35468.53 0.0000 model with very high
lnsave_con 3 .105568 0.9921 7017.895 0.0000
explanatory power

Coef. Std. Err. z P>|z| [95% Conf. Interval]

lngdp_con
lngdp_con Lagged lngdp_con has
L1. 1.036476 .0479756 21.60 0.000 .9424452 1.130506 significant influence on
lngdp_con.
lnsave_con
L1. -.0123747 .0290953 -0.43 0.671 -.0694005 .0446512 Lagged lnsave_con does
not have significant
_cons -.3031321 .3178466 -0.95 0.340 -.9260999 .3198357 influence on lngdp_con.

lnsave_con
lngdp_con
L1. .7109736 .1759493 4.04 0.000 .3661192 1.055828 Both lagged lnsave_con
and lagged lngdp_con
lnsave_con have significant influence
L1. .5757739 .1067065 5.40 0.000 .366633 .7849148 on lnsave_con.

_cons -4.653856 1.165695 -3.99 0.000 -6.938576 -2.369135

37 . vargranger

Granger causality Wald tests

Equation Excluded chi2 df Prob > chi2


As the Chi-squared statistic
lngdp_con lnsave_con .18089 1 0.671 is not significant - lnsave_con does
lngdp_con ALL .18089 1 0.671 not Granger cause lngdp_con.
lnsave_con lngdp_con 16.328 1 0.000 As the Chi-squared statistic
lnsave_con ALL 16.328 1 0.000 is significant - lngdp_con
Granger causes lnsave_con.
Suggests Granger causality from lngdp_con to lnsave_con; NOT from lnsave_con to lngdp_con
The test can also be carried out using F-test with extension command 'dfk small'
Econometric Analysis II Friday October 9 14:24:11 2020 Page 10
Are first differences of the variables stationary?
38 . generate lngdp_cond1=D1.lngdp_con First difference of lngdp_con
(1 missing value generated)

39 . generate lnsave_cond1=D1.lnsave_con First difference of lnsave_con


(1 missing value generated)

40 . varsoc lngdp_cond1 Lag length selection for lngdp_cond1

Selection-order criteria
Sample: 6 - 57 Number of obs = 52

lag LL LR df p FPE AIC HQIC SBIC

0 106.784 .001001* -4.06862* -4.05423* -4.03109*


1 107.073 .57701 1 0.447 .001029 -4.04125 -4.01248 -3.9662
2 107.11 .07498 1 0.784 .001068 -4.00423 -3.96108 -3.89166
3 107.981 1.7425 1 0.187 .001073 -3.99928 -3.94174 -3.84918
4 108.199 .43641 1 0.509 .001107 -3.96921 -3.89728 -3.78159

Endogenous: lngdp_cond1
Exogenous: _cons

41 . varsoc lnsave_cond1 Lag length selection for lnsave_cond1

Selection-order criteria
Sample: 6 - 57 Number of obs = 52

lag LL LR df p FPE AIC HQIC SBIC

0 37.64 .014306 -1.40923 -1.39485 -1.37171*


1 37.8069 .33366 1 0.564 .014772 -1.37719 -1.34842 -1.30214
2 40.6788 5.7439* 1 0.017 .013747* -1.44919* -1.40603* -1.33661
3 40.889 .42043 1 0.517 .014174 -1.41881 -1.36127 -1.26871
4 41.0472 .31636 1 0.574 .014644 -1.38643 -1.3145 -1.19881

Endogenous: lnsave_cond1
Exogenous: _cons

42 . dfuller lngdp_cond1 , trend lags(0) ADF test for lngdp_cond1

Dickey-Fuller test for unit root Number of obs = 55

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -9.294 -4.139 -3.495 -3.177

MacKinnon approximate p-value for Z(t) = 0.0000 Presence of no unit root => stationarity

43 . dfuller lnsave_cond1 , trend lags(2) ADF test for lnsave_cond1

Augmented Dickey-Fuller test for unit root Number of obs = 53

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -5.692 -4.143 -3.497 -3.178

MacKinnon approximate p-value for Z(t) = 0.0000 Presence of no unit root => stationarity

44 .

You might also like