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, 21 May 2015 17:56:55 +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/2015/May/21/t14322274564hcdncdpz4a8src.htm/, Retrieved Sat, 04 May 2024 10:02:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=279199, Retrieved Sat, 04 May 2024 10:02:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact132
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bivariate Granger Causality] [] [2015-05-21 16:56:55] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2.93
0.31
-1.19
0.31
-0.57
-8.9
-0.62
1.25
2.43
2.73
1.65
-0.48
2.06
5.13
2
2.93
0.81
-0.78
1.62
0.42
3.38
3.39
0.74
3.76
0.03
-1.48
-0.77
2.92
0.15
2.01
0.63
-1.32
-2.32
2.39
4.59
-0.38
-0.25
1.23
1.94
1.11
0.3
1.29
-3.26
2.07
1.59
1.51
0.79
-1.37
1.91
0.28
-0.33
-3.82
-4.35
0.37
-1.49
0.7
2.92
0.26
1.31
-0.1
0.95
3.15
4.15
2.46
1.46
1.95
1.27
2.51
1.63
2.12
2.8
1.2
0.06
-0.56
-0.31
1.76
-0.93
0.49
1.37
1.49
4.03
2.8
-0.15
1.39
-0.2
-1.71
1.2
1.33
2.35
0.89
1
-1.8
1.29
1.57
3.32
0.97
2.48
1.63
-0.54
-0.12
-0.44
1.06
0.23
2.33
1.87
1.65
1.57
1.02
1.36
1.99
2.17
0
-0.88
-1.7
1.55
2.26
-2.52
-0.27
-2.53
0.41
-1.41
1
1.52
-1.6
-1.43
-0.5
-6.01
-8.19
-3.66
-1.5
0.37
-1.41
1.28
3.19
4.74
1.53
2.8
2.3
3.76
0.54
1.26
2.36
0.69
0.81
3.04
1.74
-2.66
-1.09
1.97
-0.38
2.52
1.86
0.26
2.67
1.68
1.36
0.36
1.19
-0.47
-1.02
-0.19
-3.72
-3.94
3.03
-1.18
-0.21
2.53
1.86
0.39
-0.33
-2.33
0.18
0.47
1.14
1.28
0.43
1.02
1.99
2.29
0.36
1
0.99
1.84
-1.03
1.39
-0.24
1.54
1.51
1.04
1.19
0
1.87
0.11
0.06
0.92
1.32
-0.64
0.36
-1.44
-1.67
0.52
-0.27
-1.06
2.53
0.38
1.38
Dataseries Y:
5.4%
-5.1%
1.4%
9.3%
42.7%
-13.7%
17.8%
-6.7%
-5.4%
2.9%
-9.3%
-6.1%
-2.2%
0.0%
2.2%
32.6%
0.0%
-3.3%
0.0%
-11.0%
8.6%
-4.4%
0.0%
24.8%
-4.4%
36.9%
-5.6%
-3.0%
-6.7%
-3.9%
0.7%
4.1%
-3.9%
-12.9%
-3.9%
0.0%
-4.9%
-3.4%
6.2%
-16.7%
-3.0%
9.3%
-15.1%
8.9%
-4.6%
-16.6%
2.6%
3.1%
-5.5%
0.0%
5.1%
4.9%
-22.1%
21.6%
-3.1%
0.0%
-20.3%
-4.8%
-11.7%
-0.4%
-18.6%
-19.1%
17.8%
51.2%
-8.4%
2.1%
20.7%
-10.0%
0.0%
8.7%
-7.4%
-4.6%
15.7%
12.9%
5.1%
-4.8%
-8.9%
-7.6%
5.3%
8.6%
-2.0%
-8.4%
6.9%
13.0%
-10.9%
-3.4%
-2.1%
8.6%
-4.0%
10.3%
8.1%
0.0%
4.5%
-9.3%
-1.2%
13.3%
-3.4%
2.0%
5.1%
-5.8%
-5.5%
0.2%
-9.9%
-11.9%
4.6%
6.5%
5.6%
6.7%
0.4%
0.5%
13.8%
14.8%
33.1%
-8.1%
-6.1%
40.2%
-16.1%
-9.0%
27.6%
-7.3%
1.2%
-1.2%
14.5%
-2.9%
4.4%
55.2%
-17.7%
-9.9%
-35.5%
-2.3%
-0.9%
-16.8%
-2.2%
-28.0%
2.2%
-16.1%
1.8%
-6.5%
3.9%
-4.5%
-9.6%
-4.1%
-16.2%
-29.5%
35.1%
104.5%
-20.4%
-50.0%
-1.4%
4.4%
-15.0%
90.5%
-32.5%
13.6%
-17.4%
-7.9%
-2.9%
14.7%
21.8%
-3.2%
27.2%
11.1%
-3.1%
31.0%
15.8%
-37.7%
-12.6%
-5.8%
18.4%
22.4%
-32.4%
-15.6%
-12.3%
-25.4%
-24.5%
25.0%
10.0%
21.8%
-9.0%
14.8%
-17.1%
16.4%
-5.9%
8.6%
2.9%
-18.3%
-14.6%
-25.3%
16.2%
16.3%
-2.0%
2.0%
-6.0%
8.5%
-2.0%
52.0%
11.8%
16.5%
-15.2%
-8.3%
3.9%
13.8%
7.7%
-1.0%
0.0%





Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R Server'Sir Maurice George Kendall' @ kendall.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 & 0 seconds \tabularnewline
R Server & 'Sir Maurice George Kendall' @ kendall.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=279199&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]0 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Maurice George Kendall' @ kendall.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=279199&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=279199&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 time0 seconds
R Server'Sir Maurice George Kendall' @ kendall.wessa.net



Parameters (Session):
par1 = 0.0 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 1 ;
Parameters (R input):
par1 = 0.0 ; 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')