Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_grangercausality.wasp
Title produced by softwareBivariate Granger Causality
Date of computationThu, 06 Aug 2020 08:38:00 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2020/Aug/06/t1596695990vkpv0haccd7bf4u.htm/, Retrieved Wed, 24 Apr 2024 02:44:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=319211, Retrieved Wed, 24 Apr 2024 02:44:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact130
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bivariate Granger Causality] [] [2020-08-06 06:38:00] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
Adj Close
35891.51953
35513.71094
35695.10156
35850.16016
35980.92969
36212.91016
36106.5
36009.83984
35853.55859
36318.32813
36321.28906
36374.07813
36386.60938
36578.96094
36444.64063
36108.46875
36195.10156
36025.53906
35656.69922
35592.5
35591.25
36256.69141
36469.42969
36582.73828
36616.80859
36975.23047
36971.08984
36546.48047
36395.03125
36153.62109
35876.21875
35808.94922
35498.44141
35352.60938
35756.26172
35898.35156
35871.48047
36213.37891
35973.71094
35905.42969
35867.44141
36063.80859
36442.53906
36636.10156
36725.42188
36671.42969
37054.10156
37535.66016
37752.17188
37754.89063
38024.32031
38095.07031
38363.46875
38386.75
38164.60938
37808.91016
38233.41016
38132.87891
38545.71875
38871.87109
39056.64844
38877.12109
38684.71875
38862.23047
38700.53125
38939.21875
38585.35156
38607.01172
38767.10938
38905.83984
39275.64063
39140.28125
38645.17969
38564.87891
39054.67969
38730.85938
39067.32813
39031.55078
38981.42969
38963.26172
38600.33984
38276.62891
37789.12891
37558.91016
37462.98828
37090.82031
37318.53125
37114.87891
37393.48047
37930.76953
39352.67188
38969.80078
39110.21094
38811.39063
39434.71875
39683.28906
39749.73047
39502.05078
39831.96875
39714.19922
40267.62109
40083.53906
39529.71875
39615.89844
39784.51953
39950.46094
39756.80859
39741.35938
39452.07031
38960.78906
39046.33984
39112.73828
39601.62891
39194.48828
39122.96094
39434.94141
39592.07813
39586.41016
39394.64063
39686.5
39816.48047
39839.25
39908.05859
39513.39063
38720.57031
38730.82031
38557.03906
38823.10938
38736.23047
38896.71094
39131.03906
39215.64063
38897.46094
38337.01172
38031.12891
37982.73828
37847.64844
37830.98047
37882.78906
37686.37109
37397.23828
37481.12109
37018.32031
37118.21875
36699.83984
36976.85156
36690.5
37327.35938
37581.91016
36958.16016
37311.53125
37350.32813
37402.48828
37328.01172
37060.37109
36472.92969
36701.16016
37494.12109
37641.26953
37451.83984
37068.92969
37332.78906
36562.91016
36724.73828
36644.42188
36981.76953
37145.44922
37270.82031
37104.28125
37384.98828
37123.30859
36481.08984
36563.87891
36093.46875
38014.62109
39090.03125
39097.14063
38593.51953
38989.73828
38822.57031
38667.32813
38305.41016
38106.87109
37673.30859
37531.98047
38177.94922
37880.39844
38127.07813
38214.46875
38506.08984
38598.98828
39052.05859
39298.37891
38963.83984
39058.82813
39020.39063
39058.05859
null
39831.83984
40051.87109
40129.05078
40165.03125
40301.96094
40248.23047
40469.78125
40653.73828
40323.60938
40345.07813
40116.05859
40286.48047
40356.69141
40284.19141
40469.69922
40651.64063
40575.17188
40359.41016
40889.23047
40821.30078
41020.60938
41130.17188
40793.80859
40802.17188
40675.44922
40850.28906
40779.58984
40445.14844
40487.42969
40239.87891
40412.57031
40581.71094
41009.71094
40938.71875
41352.17188
41558.57031
41673.92188
41681.53906
41642.66016
41461.26172
41163.76172
41575.14063
41558
41253.73828
Dataseries Y:
Adj Close
10792.5
10672.25
10727.34961
10771.79981
10802.15039
10855.15039
10821.59961
10794.9502
10737.59961
10886.79981
10890.29981
10905.2002
10906.9502
10961.84961
10922.75
10831.5
10849.79981
10780.54981
10661.54981
10652.2002
10651.79981
10830.9502
10893.65039
10912.25
10934.34961
11062.4502
11069.40039
10943.59961
10888.79981
10831.40039
10746.04981
10724.40039
10640.9502
10604.34961
10735.4502
10789.84961
10791.65039
10880.09961
10835.29981
10806.65039
10792.5
10863.5
10987.4502
11053
11058.2002
11035.40039
11168.04981
11301.2002
11341.7002
11343.25
11426.84961
11462.2002
11532.40039
11521.04981
11456.90039
11354.25
11483.25
11445.04981
11570
11669.15039
11713.2002
11643.9502
11598
11665.9502
11604.5
11671.9502
11584.29981
11596.7002
11643.4502
11690.34961
11787.15039
11752.79981
11594.4502
11575.9502
11726.15039
11641.79981
11754.65039
11748.15039
11724.75
11712.25
11598.25
11497.90039
11359.4502
11301.79981
11278.90039
11148.2002
11222.04981
11157
11257.09961
11407.15039
11828.25
11709.09961
11737.90039
11657.04981
11844.09961
11924.75
11928.75
11861.09961
11945.90039
11922.79981
12088.54981
12021.65039
11843.75
11870.65039
11922.7002
11965.59961
11906.2002
11914.04981
11823.29981
11672.15039
11691.5
11691.4502
11831.75
11724.09961
11699.65039
11796.4502
11847.54981
11841.54981
11788.84961
11865.59961
11910.29981
11916.75
11946.75
11811.15039
11558.59961
11555.90039
11498.90039
11582.90039
11552.5
11588.34961
11662.59961
11687.5
11596.90039
11419.25
11346.2002
11331.04981
11271.29981
11252.15039
11284.29981
11189.2002
11085.40039
11118
10980
10997.34961
10862.59961
10948.25
10855.5
11032.4502
11109.65039
10925.84961
11029.40039
11047.79981
11053.90039
11017
10918.7002
10741.34961
10829.34961
11057.84961
11105.34961
11046.09961
10948.29981
11023.25
10797.90039
10844.65039
10847.90039
10946.2002
11003.04981
11035.7002
10982.79981
11075.90039
11003.5
10817.59961
10840.65039
10704.79981
11274.2002
11600.2002
11588.2002
11440.2002
11571.2002
11512.40039
11474.4502
11359.90039
11314
11174.75
11126.40039
11313.29981
11234.54981
11305.04981
11341.15039
11428.29981
11464
11586.34961
11661.84961
11588.34961
11604.09961
11582.59961
11583.90039
null
11786.84961
11844.09961
11877.4502
11890.59961
11941.29981
11917.2002
11966.04981
12012.04981
11908.15039
11913.4502
11840.4502
11872.09961
11895.4502
11884.5
11940.09961
11999.09961
11968.40039
11914.40039
12073.75
12037.7002
12100.7002
12151.15039
12056.04981
12048.2002
11994.2002
12043.2002
12018.40039
11921.5
11937.5
11856.79981
11910.15039
11971.79981
12086.7002
12053.9502
12165
12221.65039
12259.7002
12271.79981
12262.75
12214.54981
12126.54981
12245.79981
12255.84961
12168.4502




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=319211&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=319211&T=0

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



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)
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')