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, 10 Mar 2016 11:09:50 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Mar/10/t1457608271qk7oq0kwp0hlfuk.htm/, Retrieved Wed, 08 May 2024 14:25:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=293834, Retrieved Wed, 08 May 2024 14:25:57 +0000
QR Codes:

Original text written by user:NASDAQ AND DOW JONES DATA
IsPrivate?No (this computation is public)
User-defined keywordsNASDAQ AND DOW JONES
Estimated Impact133
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bivariate Granger Causality] [STOCK PRICE ] [2016-03-10 11:09:50] [6fb1ca1d6dbca7d49200152dc5103456] [Current]
Feedback Forum

Post a new message
Dataseries X:
4,900.88
4,891.22
5,026.42
4,871.76
4,927.37
4,963.53
4,955.97
4,893.84
4,744.40
4,635.24
4,757.88
4,634.38
4,704.07
4,726.81
4,806.86
4,765.38
4,653.60
4,780.76
4,791.63
4,712.97
4,688.54
4,632.53
4,630.74
4,483.72
4,258.44
4,276.24
4,475.62
4,512.19
4,579.79
4,567.60
4,582.90
4,580.27
4,538.55
4,464.93
4,370.90
4,352.64
4,449.56
4,432.15
4,415.49
4,485.93
4,397.93
4,368.04
4,310.65
4,321.40
4,242.62
4,185.81
4,090.59
4,071.87
4,123.90
4,075.56
4,095.52
3,999.73
4,127.73
Dataseries Y:
17,776.12
17,712.66
18,127.65
17,749.31
17,856.78
18,132.70
18,140.44
18,019.35
17,824.29
17,164.95
17,672.60
17,511.57
17,737.37
17,832.99
18,053.71
17,804.80
17,280.83
17,958.79
17,828.24
17,810.06
17,634.74
17,573.93
17,390.52
16,805.41
16,380.41
16,544.10
17,009.69
17,113.15
17,279.74
16,987.51
17,137.36
17,098.45
17,001.22
16,662.91
16,553.93
16,493.37
16,960.57
17,100.18
16,943.81
17,068.26
16,851.84
16,947.08
16,775.74
16,924.28
16,717.17
16,606.27
16,491.31
16,583.34
16,512.89
16,361.46
16,408.54
16,026.75
16,412.71





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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=293834&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 time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net



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