Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_grangercausality.wasp
Title produced by softwareBivariate Granger Causality
Date of computationSat, 08 Feb 2025 21:09:52 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2025/Feb/08/t1739045557adgj6m8jxgz2eeg.htm/, Retrieved Thu, 28 May 2026 19:33:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=320184, Retrieved Thu, 28 May 2026 19:33:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact345
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bivariate Granger Causality] [UAH s f'CO2] [2025-02-08 20:09:52] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
0.024
0.0406507
0.0353014
0.0929521
0.139603
0.108253
0.108904
0.126555
0.170205
0.104856
0.0565068
0.0411575
-0.0821918
0.0824589
0.0331096
0.20476
0.100411
0.0250616
0.0377123
0.092363
-0.126986
-0.0443356
-0.0226849
-0.0110342
0.136616
0.0512671
0.270918
0.0845685
0.101219
0.24087
0.0315205
-0.0298288
-0.117178
-0.345527
-0.205877
-0.131226
0.00642466
-0.0519247
-0.050274
0.174377
0.0380274
0.0826781
0.227329
0.0329795
0.0426301
0.116281
0.00193151
0.106582
0.136233
0.0998836
-0.00546575
0.0381849
0.0418356
0.0584863
-0.018863
-0.181212
-0.0425616
0.015089
0.0357397
0.00939041
0.0980411
-0.0223082
0.0863425
0.323993
0.0676438
0.168295
0.0599452
0.0605959
0.0382466
0.0938973
0.118548
-0.00480137
0.00484932
-0.0475
-0.109849
-0.316199
-0.248548
-0.219897
-0.201247
-0.335596
-0.262945
-0.179295
-0.236644
-0.0979932
-0.106342
-0.0166918
-0.0460411
0.0186096
0.0182603
-0.040089
-0.0784384
-0.122788
-0.237137
0.141514
-0.00683562
0.155815
0.0594658
0.197116
0.0547671
0.422418
0.365068
0.448719
0.26537
0.351021
0.244671
0.263322
0.279973
0.260623
0.088274
0.0799247
0.0285753
-0.136774
-0.145123
-0.242473
-0.0898219
-0.0521712
0.0824795
0.14113
0.100781
0.0654315
-0.154918
-0.0972671
-0.0486164
-0.264966
-0.307315
-0.0886644
0.0629863
0.00763699
0.0852877
-0.0340616
0.032589
0.12424
0.13689
0.110541
0.0881918
0.396842
0.0634932
0.0741438
0.0277945
-0.0235548
0.172096
0.00874658
0.0243973
0.154048
0.123699
0.0143493
0.117
Dataseries Y:
0.146738
0.157225
0.162574
0.170561
0.177438
0.180564
0.186885
0.192581
0.200499
0.206542
0.209668
0.211614
0.213352
0.2112
0.213771
0.2128
0.209816
0.208359
0.206763
0.206903
0.205863
0.200101
0.19038
0.176145
0.169549
0.161009
0.15226
0.145456
0.140805
0.135668
0.133308
0.13074
0.127061
0.126298
0.134147
0.151509
0.158941
0.167554
0.175611
0.180404
0.187697
0.198462
0.202353
0.201035
0.202564
0.207635
0.203122
0.19236
0.185
0.183196
0.180697
0.17806
0.17202
0.162021
0.15612
0.155913
0.152859
0.14536
0.147167
0.150085
0.150156
0.150505
0.149742
0.153493
0.156759
0.164469
0.166762
0.16461
0.157042
0.161349
0.15774
0.155241
0.157603
0.15698
0.154967
0.150038
0.145387
0.136013
0.133376
0.142127
0.153726
0.14963
0.150673
0.15005
0.149843
0.145608
0.142762
0.143389
0.144848
0.147836
0.15506
0.15145
0.155062
0.164022
0.169926
0.172914
0.174304
0.178194
0.188265
0.1941
0.19806
0.203617
0.196535
0.190286
0.174524
0.16265
0.154943
0.155917
0.153141
0.154323
0.147102
0.140228
0.138007
0.133148
0.136066
0.138081
0.152666
0.161903
0.16496
0.161906
0.16531
0.16434
0.166355
0.172954
0.175316
0.179901
0.18643
0.195806
0.191016
0.193865
0.199769
0.207479
0.211369
0.213662
0.217066
0.213457
0.214083
0.211029
0.198391
0.192907
0.1977
0.190757
0.189092
0.180204
0.172497
0.168124
0.166111




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=320184&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=320184&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=320184&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







Granger Causality Test: Y = f(X)
ModelRes.DFDiff. DFFp-value
Complete model140
Reduced model142-20.449337408238990.638967697115797

\begin{tabular}{lllllllll}
\hline
Granger Causality Test: Y = f(X) \tabularnewline
Model & Res.DF & Diff. DF & F & p-value \tabularnewline
Complete model & 140 &  &  &  \tabularnewline
Reduced model & 142 & -2 & 0.44933740823899 & 0.638967697115797 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=320184&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]140[/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]Reduced model[/C][C]142[/C][C]-2[/C][C]0.44933740823899[/C][C]0.638967697115797[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=320184&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=320184&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 model140
Reduced model142-20.449337408238990.638967697115797







Granger Causality Test: X = f(Y)
ModelRes.DFDiff. DFFp-value
Complete model140
Reduced model142-24.506273555143410.0126871424871922

\begin{tabular}{lllllllll}
\hline
Granger Causality Test: X = f(Y) \tabularnewline
Model & Res.DF & Diff. DF & F & p-value \tabularnewline
Complete model & 140 &  &  &  \tabularnewline
Reduced model & 142 & -2 & 4.50627355514341 & 0.0126871424871922 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=320184&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]140[/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]Reduced model[/C][C]142[/C][C]-2[/C][C]4.50627355514341[/C][C]0.0126871424871922[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=320184&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=320184&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 model140
Reduced model142-24.506273555143410.0126871424871922



Parameters (Session):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 2 ;
Parameters (R input):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 2 ;
R code (references can be found in the software module):
par8 <- '1'
par7 <- '0'
par6 <- '0'
par5 <- '1'
par4 <- '1'
par3 <- '0'
par2 <- '0'
par1 <- '1'
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)
print(x)
print(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')