Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_grangercausality.wasp
Title produced by softwareBivariate Granger Causality
Date of computationFri, 22 Feb 2013 15:53:29 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Feb/22/t1361566487dwl1ti8v2tqb9ks.htm/, Retrieved Sat, 04 May 2024 04:21:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=206860, Retrieved Sat, 04 May 2024 04:21:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact111
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bivariate Granger Causality] [S&P 500 vs Federa...] [2013-02-22 20:53:29] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
984.94
907.84
896.78
930.09
952.77
852.3
806.58
887.68
870.74
899.24
904.42
868.15
903.25
906.65
842.62
840.24
874.09
832.23
833.74
788.42
764.9
712.87
721.36
794.35
813.88
811.08
825.16
852.06
843.55
873.64
919.53
883.92
903.47
893.06
931.76
939.15
910.71
900.94
923.33
879.56
932.68
954.07
975.15
1002.72
1005.81
996.46
1028.12
994.75
1033.37
1068.76
1060.87
1057.08
1057.58
1092.02
1081.4
1042.63
1046.5
1098.51
1109.8
1110.63
1109.24
1095.95
1109.18
1120.59
1126.42
1137.14
1145.68
1138.04
1097.5
1097.28
1068.13
1099.51
1105.24
1118.79
1145.61
1166.21
1167.72
1169.43
1182.45
1210.65
1205.94
1191.36
1165.87
1171.67
1115.05
1067.95
1098.38
1055.69
1114.61
1092.04
1030.71
1060.27
1095.17
1069.59
1106.13
1127.24
1089.47
1094.16
1055.33
1080.29
1098.87
1125.07
1134.28
1144.73
1159.97
1178.1
1178.17
1182.45
1197.96
1218.71
1178.59
1198.35
1206.07
1228.28
1235.23
1258.84
1259.78
1276.56
1285.96
1281.92
1296.63
1304.03
1320.88
1336.32
1307.4
1308.44
1320.02
1256.88
1297.54
1328.26
1335.54
1314.41
1330.36
1355.66
1347.32
1342.08
1340.68
1320.47
1314.55
1279.56
1265.42
1287.14
1307.41
1339.22
1317.72
1325.84
1304.89
1260.34
1120.76
1193.89
1177.6
1218.89
1198.62
1188.68
1166.76
1151.06
1144.03
1207.25
1209.88
1242
1237.9
1229.1
1236.91
1161.79
1246.96
1261.01
1211.82
1243.72
1249.64
1277.3
1292.48
1308.04
1326.06
1324.09
1349.96
1343.23
1357.66
1365.68
1352.63
1394.28
1402.89
1405.54
1398.96
1368.71
1385.14
1390.69
1402.31
1354.58
1324.8
1318.86
1313.32
1315.13
1314.88
1355.69
1331.85
1367.58
1341.45
1372.78
1337.89
1375.32
1402.22
1405.53
1413.49
1410.49
1403.44
1436.56
1461.05
1433.32
1450.99
1432.56
1460.91
1408.75
1412.16
1394.53
1355.49
1391.03
1409.93
1409.28
1428.48
1435.81
1419.83
1462.42
1461.02
1472.63
1494.81
1501.96
1512.12
1520.33
1511.95
Dataseries Y:
7974947000000
8477944000000
8602821000000
8766477000000
9140161000000
9431433000000
9364152000000
9174214000000
9215123000000
9451486000000
9425621000000
9325760000000
9414571000000
9295796000000
9082466000000
9087746000000
8995668000000
8696055000000
8696059000000
8869815000000
8861665000000
8857977000000
8823651000000
9145535000000
9148348000000
9152562000000
9211638000000
9281261000000
9432897000000
9261716000000
9180962000000
9374592000000
9508334000000
9345034000000
9345290000000
9297452000000
9351165000000
9245979000000
9214843000000
9222436000000
9292132000000
9286967000000
9295267000000
9259695000000
9290549000000
9364669000000
9443112000000
9448612000000
9465672000000
9531582000000
9644986000000
9609204000000
9628882000000
9608708000000
9775106000000
9752431000000
9763096000000
9720380000000
9891719000000
9878676000000
9886141000000
9870735000000
9925725000000
9981572000000
9965046000000
9969635000000
9975107000000
9958264000000
9975718000000
9965333000000
9992715000000
10058795000000
10073864000000
10058960000000
10087316000000
10166263000000
10195619000000
10193564000000
10204148000000
10241703000000
10319426000000
10322880000000
10325466000000
10301845000000
10342166000000
10314168000000
10321776000000
10306152000000
10329017000000
10358789000000
10339984000000
10338508000000
10372902000000
10396435000000
10418451000000
10422963000000
10448260000000
10466748000000
10487809000000
10494909000000
10523567000000
10512055000000
10532558000000
10564900000000
10601007000000
10654410000000
10677193000000
10708894000000
10740123000000
10805564000000
10822820000000
10870539000000
10868114000000
10948096000000
10985097000000
11033757000000
11058608000000
11059813000000
11113217000000
11067889000000
11079420000000
11117670000000
11198895000000
11286012000000
11309545000000
11316588000000
11410728000000
11449868000000
11476206000000
11514939000000
11581215000000
11649000000000
11677714000000
11710203000000
11781741000000
11855176000000
11904626000000
11914480000000
11931606000000
11965772000000
12030065000000
12107188000000
12106658000000
12123956000000
12117935000000
12112229000000
12109627000000
12127211000000
12133080000000
12075982000000
12091809000000
12055185000000
12043624000000
12054367000000
12031264000000
11987473000000
11964571000000
11936492000000
11937269000000
11903572000000
11844633000000
11922834000000
11960434000000
11943377000000
11905266000000
11930206000000
12044015000000
12070474000000
12092614000000
12005209000000
11959577000000
11998887000000
12017363000000
12027104000000
12072517000000
12132940000000
12162674000000
12134075000000
12059193000000
12082327000000
12085035000000
12096550000000
12053222000000
12053196000000
12089673000000
12059970000000
12037409000000
12049518000000
12023677000000
12061459000000
12052893000000
12061085000000
12052467000000
12084348000000
12096150000000
12079118000000
12078721000000
12101883000000
12072140000000
12060760000000
12079031000000
12113793000000
12070468000000
12061947000000
12068140000000
12094206000000
12100884000000
12098601000000
12078396000000
12092269000000
12151019000000
12185209000000
12131993000000
12146274000000
12163276000000
12212881000000
12214968000000
12225992000000
12280526000000
12393715000000
12422453000000
12395717000000
12442031000000
12513810000000
12596919000000
12643134000000
12703916000000
12793265000000
12889003000000




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 4 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=206860&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ fisher.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=206860&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=206860&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net







Granger Causality Test: Y = f(X)
ModelRes.DFDiff. DFFp-value
Complete model225
Reduced model226-120.33022037588951.04865717194437e-05

\begin{tabular}{lllllllll}
\hline
Granger Causality Test: Y = f(X) \tabularnewline
Model & Res.DF & Diff. DF & F & p-value \tabularnewline
Complete model & 225 &  &  &  \tabularnewline
Reduced model & 226 & -1 & 20.3302203758895 & 1.04865717194437e-05 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=206860&T=1

[TABLE]
[ROW][C]Granger Causality Test: Y = f(X)[/C][/ROW]
[ROW][C]Model[/C][C]Res.DF[/C][C]Diff. DF[/C][C]F[/C][C]p-value[/C][/ROW]
[ROW][C]Complete model[/C][C]225[/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]Reduced model[/C][C]226[/C][C]-1[/C][C]20.3302203758895[/C][C]1.04865717194437e-05[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=206860&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=206860&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Granger Causality Test: Y = f(X)
ModelRes.DFDiff. DFFp-value
Complete model225
Reduced model226-120.33022037588951.04865717194437e-05







Granger Causality Test: X = f(Y)
ModelRes.DFDiff. DFFp-value
Complete model225
Reduced model226-16.939040865420850.00901900891536227

\begin{tabular}{lllllllll}
\hline
Granger Causality Test: X = f(Y) \tabularnewline
Model & Res.DF & Diff. DF & F & p-value \tabularnewline
Complete model & 225 &  &  &  \tabularnewline
Reduced model & 226 & -1 & 6.93904086542085 & 0.00901900891536227 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=206860&T=2

[TABLE]
[ROW][C]Granger Causality Test: X = f(Y)[/C][/ROW]
[ROW][C]Model[/C][C]Res.DF[/C][C]Diff. DF[/C][C]F[/C][C]p-value[/C][/ROW]
[ROW][C]Complete model[/C][C]225[/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]Reduced model[/C][C]226[/C][C]-1[/C][C]6.93904086542085[/C][C]0.00901900891536227[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=206860&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=206860&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Granger Causality Test: X = f(Y)
ModelRes.DFDiff. DFFp-value
Complete model225
Reduced model226-16.939040865420850.00901900891536227



Parameters (Session):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 1 ;
Parameters (R input):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 1 ;
R code (references can be found in the software module):
library(lmtest)
par1 <- as.numeric(par1)
par2 <- as.numeric(par2)
par3 <- as.numeric(par3)
par4 <- as.numeric(par4)
par5 <- as.numeric(par5)
par6 <- as.numeric(par6)
par7 <- as.numeric(par7)
par8 <- as.numeric(par8)
ox <- x
oy <- y
if (par1 == 0) {
x <- log(x)
} else {
x <- (x ^ par1 - 1) / par1
}
if (par5 == 0) {
y <- log(y)
} else {
y <- (y ^ par5 - 1) / par5
}
if (par2 > 0) x <- diff(x,lag=1,difference=par2)
if (par6 > 0) y <- diff(y,lag=1,difference=par6)
if (par3 > 0) x <- diff(x,lag=par4,difference=par3)
if (par7 > 0) y <- diff(y,lag=par4,difference=par7)
x
y
(gyx <- grangertest(y ~ x, order=par8))
(gxy <- grangertest(x ~ y, order=par8))
bitmap(file='test1.png')
op <- par(mfrow=c(2,1))
(r <- ccf(ox,oy,main='Cross Correlation Function (raw data)',ylab='CCF',xlab='Lag (k)'))
(r <- ccf(x,y,main='Cross Correlation Function (transformed and differenced)',ylab='CCF',xlab='Lag (k)'))
par(op)
dev.off()
bitmap(file='test2.png')
op <- par(mfrow=c(2,1))
acf(ox,lag.max=round(length(x)/2),main='ACF of x (raw)')
acf(x,lag.max=round(length(x)/2),main='ACF of x (transformed and differenced)')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow=c(2,1))
acf(oy,lag.max=round(length(y)/2),main='ACF of y (raw)')
acf(y,lag.max=round(length(y)/2),main='ACF of y (transformed and differenced)')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Granger Causality Test: Y = f(X)',5,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Model',header=TRUE)
a<-table.element(a,'Res.DF',header=TRUE)
a<-table.element(a,'Diff. DF',header=TRUE)
a<-table.element(a,'F',header=TRUE)
a<-table.element(a,'p-value',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Complete model',header=TRUE)
a<-table.element(a,gyx$Res.Df[1])
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Reduced model',header=TRUE)
a<-table.element(a,gyx$Res.Df[2])
a<-table.element(a,gyx$Df[2])
a<-table.element(a,gyx$F[2])
a<-table.element(a,gyx$Pr[2])
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Granger Causality Test: X = f(Y)',5,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Model',header=TRUE)
a<-table.element(a,'Res.DF',header=TRUE)
a<-table.element(a,'Diff. DF',header=TRUE)
a<-table.element(a,'F',header=TRUE)
a<-table.element(a,'p-value',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Complete model',header=TRUE)
a<-table.element(a,gxy$Res.Df[1])
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.element(a,'')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Reduced model',header=TRUE)
a<-table.element(a,gxy$Res.Df[2])
a<-table.element(a,gxy$Df[2])
a<-table.element(a,gxy$F[2])
a<-table.element(a,gxy$Pr[2])
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable2.tab')