Examples / VARCAUSE.RPF |
VARCAUSE.RPF is an example of a block exogeneity test (Granger causality test involving more than two variables).
The five variable VAR has three real variables (real GDP, unemployment and real investment), and two nominal ones (M2 and price level). All but unemployment are included in log form. The block exogeneity test is to see if the three real variables are exogenous relative to the two nominal ones. This involves running a system on just those three variables with (unrestricted) and without (restricted) the two nominal variables. The likelihood ratio test (with a minor adjustment of the "T" multiplier to deal with loss of degrees of freedom) is used as the test statistic.
Note that, like a two variable Granger test, this is subject to having a non-standard asymptotic distribution due to unit roots. If it weren't for the fact that the result is way out in the tails (non-causality is overwhelming rejected using the standard chi-squared asymptotics), this would probably deserve a more careful approach.
Full Program
open data haversample.rat
calendar(q) 1959
data(format=rats) 1959:1 2006:4 dgnp fm2 gdph ih lr
*
set loggdp = log(gdph)
set logm2 = log(fm2)
set logp = log(dgnp)
set logi = log(ih)
set unemp = lr
*
system(model=unrestricted)
variables loggdp unemp logi
lags 1 to 4
det constant logp{1 to 4} logm2{1 to 4}
end(system)
estimate(resids=unresids)
compute ntotal=%nregsystem,mcorr=%nreg,loglunr=%logl
compute logdetunr=%logdet
*
system(model=restricted)
variables loggdp unemp logi
lags 1 to 4
det constant
end(system)
estimate(resids=resresids)
compute loglres=%logl
compute logdetres=%logdet
*
* Using RATIO
*
ratio(degrees=ntotal-%nregsystem,mcorr=mcorr,$
title="Exogeneity of Real Variables")
# unresids
# resresids
*
* Using %LOGDET statistics:
*
compute teststat=(%nobs-mcorr)*(logdetres-logdetunr)
cdf(title="Exogeneity of Real Variables") chisqr $
teststat ntotal-%nregsystem
*
* Using %LOGL statistics. The standard LR test of -2*(L(R)-L(U)) is
* adjusted by multiplying by (T-c)/T to implement the multiplier
* correction.
*
compute teststat=-2.0*(%nobs-mcorr)/%nobs*(loglres-loglunr)
cdf(title="Exogeneity of Real Variables") chisqr $
teststat ntotal-%nregsystem
Output
VAR/System - Estimation by Least Squares
Quarterly Data From 1960:01 To 2006:04
Usable Observations 188
Dependent Variable LOGGDP
Mean of Dependent Variable 8.6324850619
Std Error of Dependent Variable 0.4316368147
Standard Error of Estimate 0.0072688036
Sum of Squared Residuals 0.0088235294
Durbin-Watson Statistic 1.9954
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LOGGDP{1} 1.226399016 0.129072827 9.50160 0.00000000
2. LOGGDP{2} 0.040054697 0.166391941 0.24072 0.81006355
3. LOGGDP{3} -0.326842793 0.167162288 -1.95524 0.05222355
4. LOGGDP{4} 0.128053668 0.126251020 1.01428 0.31191722
5. UNEMP{1} -0.008004490 0.003016626 -2.65346 0.00873651
6. UNEMP{2} 0.013553738 0.004836842 2.80219 0.00567601
7. UNEMP{3} -0.006518079 0.004933922 -1.32107 0.18828378
8. UNEMP{4} 0.003119594 0.002936580 1.06232 0.28962328
9. LOGI{1} -0.077543012 0.024931750 -3.11021 0.00219888
10. LOGI{2} 0.031966831 0.028609304 1.11736 0.26544625
11. LOGI{3} 0.033342130 0.028797122 1.15783 0.24858723
12. LOGI{4} -0.011902589 0.022884582 -0.52011 0.60367300
13. Constant -0.302054702 0.135325331 -2.23206 0.02694087
14. LOGP{1} 0.153748818 0.214899740 0.71544 0.47533356
15. LOGP{2} -0.134761795 0.390824464 -0.34481 0.73066799
16. LOGP{3} -0.705687587 0.394476756 -1.78892 0.07544016
17. LOGP{4} 0.680507789 0.216394735 3.14475 0.00196801
18. LOGM2{1} 0.045612157 0.102316832 0.44579 0.65632397
19. LOGM2{2} 0.156381004 0.187761716 0.83287 0.40610787
20. LOGM2{3} -0.214481364 0.183580639 -1.16832 0.24434191
21. LOGM2{4} -0.001460064 0.099637390 -0.01465 0.98832589
F-Tests, Dependent Variable LOGGDP
Variable F-Statistic Signif
*******************************************************
LOGGDP 336.6449 0.0000000
UNEMP 3.7040 0.0064544
LOGI 2.8241 0.0266142
Dependent Variable UNEMP
Mean of Dependent Variable 5.8732269504
Std Error of Dependent Variable 1.4427883606
Standard Error of Estimate 0.2234951514
Sum of Squared Residuals 8.3416638091
Durbin-Watson Statistic 1.9378
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LOGGDP{1} -14.48423037 3.96862436 -3.64969 0.00035080
2. LOGGDP{2} 2.13279723 5.11608155 0.41688 0.67730081
3. LOGGDP{3} 3.67517648 5.13976757 0.71505 0.47557830
4. LOGGDP{4} 6.49867061 3.88186177 1.67411 0.09598047
5. UNEMP{1} 1.33581407 0.09275272 14.40189 0.00000000
6. UNEMP{2} -0.59270178 0.14871920 -3.98538 0.00010048
7. UNEMP{3} 0.24520413 0.15170415 1.61633 0.10791026
8. UNEMP{4} -0.08052958 0.09029153 -0.89188 0.37373833
9. LOGI{1} 2.34396054 0.76658079 3.05768 0.00259835
10. LOGI{2} -1.37968124 0.87965517 -1.56843 0.11867268
11. LOGI{3} 0.17668868 0.88543005 0.19955 0.84207432
12. LOGI{4} -0.42482830 0.70363617 -0.60376 0.54682157
13. Constant 10.79479976 4.16087119 2.59436 0.01031920
14. LOGP{1} -0.45707754 6.60755919 -0.06917 0.94493313
15. LOGP{2} -0.94203565 12.01674688 -0.07839 0.93760884
16. LOGP{3} 17.66204929 12.12904451 1.45618 0.14722084
17. LOGP{4} -15.98690516 6.65352604 -2.40277 0.01736760
18. LOGM2{1} 0.91423441 3.14595319 0.29061 0.77171287
19. LOGM2{2} -4.43343183 5.77314172 -0.76794 0.44360677
20. LOGM2{3} 3.76516967 5.64458543 0.66704 0.50566657
21. LOGM2{4} 0.13815090 3.06356794 0.04509 0.96408564
F-Tests, Dependent Variable UNEMP
Variable F-Statistic Signif
*******************************************************
LOGGDP 5.3641 0.0004347
UNEMP 300.4806 0.0000000
LOGI 2.6856 0.0331745
Dependent Variable LOGI
Mean of Dependent Variable 6.6146375119
Std Error of Dependent Variable 0.5577696411
Standard Error of Estimate 0.0362100449
Sum of Squared Residuals 0.2189649480
Durbin-Watson Statistic 1.9556
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LOGGDP{1} 2.223235132 0.642985164 3.45768 0.00069124
2. LOGGDP{2} -0.629732041 0.828892895 -0.75973 0.44848911
3. LOGGDP{3} -1.594754526 0.832730435 -1.91509 0.05719003
4. LOGGDP{4} 0.818584934 0.628928137 1.30156 0.19486098
5. UNEMP{1} -0.064674881 0.015027530 -4.30376 0.00002853
6. UNEMP{2} 0.088991341 0.024095059 3.69334 0.00029953
7. UNEMP{3} -0.034516292 0.024578672 -1.40432 0.16208101
8. UNEMP{4} 0.021585540 0.014628776 1.47555 0.14194674
9. LOGI{1} 0.261843964 0.124199227 2.10826 0.03650098
10. LOGI{2} 0.300206379 0.142519213 2.10643 0.03666181
11. LOGI{3} 0.228045346 0.143454844 1.58967 0.11380136
12. LOGI{4} -0.088720396 0.114001118 -0.77824 0.43752791
13. Constant -3.632768487 0.674132444 -5.38881 0.00000024
14. LOGP{1} 2.473520405 1.070537833 2.31054 0.02208126
15. LOGP{2} -3.677712411 1.946918945 -1.88899 0.06062647
16. LOGP{3} -1.231625339 1.965113086 -0.62675 0.53168206
17. LOGP{4} 2.547308045 1.077985251 2.36303 0.01927715
18. LOGM2{1} -0.019866305 0.509698334 -0.03898 0.96895560
19. LOGM2{2} 1.048856045 0.935347902 1.12135 0.26374707
20. LOGM2{3} -0.893169482 0.914519580 -0.97665 0.33015296
21. LOGM2{4} -0.401542631 0.496350512 -0.80899 0.41967192
F-Tests, Dependent Variable LOGI
Variable F-Statistic Signif
*******************************************************
LOGGDP 9.5537 0.0000006
UNEMP 7.0297 0.0000296
LOGI 39.2576 0.0000000
VAR/System - Estimation by Least Squares
Quarterly Data From 1960:01 To 2006:04
Usable Observations 188
Dependent Variable LOGGDP
Mean of Dependent Variable 8.6324850619
Std Error of Dependent Variable 0.4316368147
Standard Error of Estimate 0.0078019947
Sum of Squared Residuals 0.0106524463
Durbin-Watson Statistic 1.9498
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LOGGDP{1} 1.257522686 0.126063422 9.97532 0.00000000
2. LOGGDP{2} 0.053842844 0.174572341 0.30843 0.75812418
3. LOGGDP{3} -0.285879374 0.173726501 -1.64557 0.10164690
4. LOGGDP{4} -0.011772623 0.130572148 -0.09016 0.92826173
5. UNEMP{1} -0.009362884 0.003161088 -2.96192 0.00348225
6. UNEMP{2} 0.014222985 0.005047060 2.81807 0.00538753
7. UNEMP{3} -0.004361986 0.005068926 -0.86053 0.39067191
8. UNEMP{4} 0.000058306 0.002862526 0.02037 0.98377254
9. LOGI{1} -0.060460216 0.023743851 -2.54635 0.01174759
10. LOGI{2} 0.020200868 0.029659353 0.68110 0.49671096
11. LOGI{3} 0.026230969 0.029715713 0.88273 0.37859280
12. LOGI{4} 0.002013921 0.022914268 0.08789 0.93006508
13. Constant -0.037697075 0.044930639 -0.83901 0.40261057
F-Tests, Dependent Variable LOGGDP
Variable F-Statistic Signif
*******************************************************
LOGGDP 1582.3249 0.0000000
UNEMP 2.9292 0.0223658
LOGI 1.8965 0.1131166
Dependent Variable UNEMP
Mean of Dependent Variable 5.8732269504
Std Error of Dependent Variable 1.4427883606
Standard Error of Estimate 0.2321384781
Sum of Squared Residuals 9.4304477766
Durbin-Watson Statistic 1.9464
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LOGGDP{1} -15.29976053 3.75085755 -4.07900 0.00006860
2. LOGGDP{2} 2.30364352 5.19417905 0.44350 0.65794845
3. LOGGDP{3} 2.54443638 5.16901214 0.49225 0.62316093
4. LOGGDP{4} 9.62677352 3.88500900 2.47793 0.01416311
5. UNEMP{1} 1.37383680 0.09405418 14.60687 0.00000000
6. UNEMP{2} -0.60050216 0.15016889 -3.99885 0.00009375
7. UNEMP{3} 0.20774767 0.15081949 1.37746 0.17012950
8. UNEMP{4} -0.01200261 0.08517084 -0.14092 0.88809214
9. LOGI{1} 1.94789751 0.70646824 2.75723 0.00644785
10. LOGI{2} -1.19870032 0.88247650 -1.35834 0.17610532
11. LOGI{3} 0.44186424 0.88415342 0.49976 0.61787208
12. LOGI{4} -0.61148601 0.68178505 -0.89689 0.37100992
13. Constant 3.73747264 1.33685430 2.79572 0.00575708
F-Tests, Dependent Variable UNEMP
Variable F-Statistic Signif
*******************************************************
LOGGDP 7.9525 0.0000065
UNEMP 1090.7057 0.0000000
LOGI 2.5186 0.0430215
Dependent Variable LOGI
Mean of Dependent Variable 6.6146375119
Std Error of Dependent Variable 0.5577696411
Standard Error of Estimate 0.0396029944
Sum of Squared Residuals 0.2744695042
Durbin-Watson Statistic 1.9525
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LOGGDP{1} 1.707520775 0.639899046 2.66842 0.00833715
2. LOGGDP{2} -0.459268273 0.886130750 -0.51828 0.60491410
3. LOGGDP{3} -1.268750717 0.881837258 -1.43876 0.15200510
4. LOGGDP{4} 0.215390517 0.662785381 0.32498 0.74558607
5. UNEMP{1} -0.068632392 0.016045712 -4.27730 0.00003106
6. UNEMP{2} 0.092402586 0.025618923 3.60681 0.00040420
7. UNEMP{3} -0.013957633 0.025729915 -0.54247 0.58818689
8. UNEMP{4} -0.008521701 0.014530208 -0.58648 0.55830760
9. LOGI{1} 0.493736735 0.120523999 4.09658 0.00006402
10. LOGI{2} 0.252133382 0.150551138 1.67474 0.09577217
11. LOGI{3} 0.178989953 0.150837222 1.18664 0.23697685
12. LOGI{4} -0.078104095 0.116313029 -0.67150 0.50278806
13. Constant -0.681276197 0.228068323 -2.98716 0.00322013
F-Tests, Dependent Variable LOGI
Variable F-Statistic Signif
*******************************************************
LOGGDP 3.8844 0.0047634
UNEMP 5.1538 0.0005993
LOGI 70.4568 0.0000000
Exogeneity of Real Variables
Log Determinants are -21.122046 -20.731947
Chi-Squared(24)= 65.146518 with Significance Level 0.00001158
Exogeneity of Real Variables
Chi-Squared(24)= 65.146518 with Significance Level 0.00001158
Exogeneity of Real Variables
Chi-Squared(24)= 65.146518 with Significance Level 0.00001158
Copyright © 2025 Thomas A. Doan