Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_grangercausality.wasp
Title produced by softwareBivariate Granger Causality
Date of computationWed, 06 Mar 2013 20:33:37 -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/Mar/06/t1362620258b9ab6oyg1k0ib07.htm/, Retrieved Sat, 04 May 2024 08:25:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=207536, Retrieved Sat, 04 May 2024 08:25:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsCoffee
Estimated Impact186
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bivariate Granger Causality] [Coffee Causality] [2013-03-07 01:33:37] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
204.70
218.74
219.58
270.02
298.64
329.77
302.56
338.48
351.33
382.15
403.42
456.60
482.72
541.19
670.58
700.36
628.89
577.81
484.88
439.60
417.78
377.03
434.66
447.14
454.50
435.61
385.76
393.68
373.97
371.48
294.98
304.72
342.44
339.64
322.23
288.98
283.49
271.19
287.35
305.63
330.23
425.89
448.99
435.30
457.17
462.07
455.74
428.31
380.78
371.02
411.73
405.28
423.15
405.03
351.64
310.01
285.59
283.73
259.86
271.72
288.94
285.17
285.74
288.87
283.29
251.04
266.91
278.20
280.38
302.25
318.04
313.43
317.86
340.46
321.96
312.24
303.33
310.04
294.34
293.08
300.42
309.55
304.50
297.29
286.51
279.83
275.67
275.05
283.23
280.71
282.94
285.59
291.69
310.26
318.70
323.33
316.83
321.68
326.99
331.16
331.24
324.74
317.71
321.21
313.56
301.75
309.11
310.41
320.53
317.64
326.02
311.89
314.58
312.81
297.78
294.27
294.27
309.79
343.15
434.22
524.41
503.07
528.23
498.33
465.92
390.39
379.88
383.45
440.11
391.52
345.45
300.34
272.34
266.45
228.77
237.12
258.60
231.76
220.23
225.31
243.65
263.19
278.84
279.72
282.23
305.44
301.04
300.75
305.67
317.18
312.99
292.28
303.91
295.02
298.48
325.46
335.63
308.54
309.66
317.20
309.93
276.28
194.20
173.08
172.89
151.35
156.24
159.77
167.61
185.08
208.85
208.80
204.96
196.54
191.03
208.18
210.30
201.90
186.78
196.61
189.45
196.67
206.28
202.73
193.75
189.10
183.51
180.27
191.93
175.86
172.40
166.12
161.84
150.91
155.14
145.33
134.17
130.27
128.31
116.69
117.35
135.74
148.39
170.16
152.98
149.14
140.26
127.58
137.08
137.79
158.31
169.58
178.07
168.96
173.28
179.21
174.05
185.03
191.81
199.67
268.70
316.21
482.56
441.89
489.43
445.00
403.25
371.57
380.56
374.31
395.58
384.49
377.01
340.59
321.12
337.77
296.43
280.58
276.13
234.22
243.94
273.57
266.41
272.27
284.99
276.59
270.00
278.27
261.69
273.81
273.53
257.98
292.91
371.19
429.24
456.33
589.23
489.47
419.78
420.64
418.59
369.63
353.33
391.19
391.98
392.82
347.56
331.46
303.62
275.42
259.26
271.63
246.59
241.89
256.55
258.80
249.03
232.54
232.34
225.11
244.87
236.36
209.11
201.44
185.87
207.68
249.96
274.39
244.96
228.05
222.07
208.58
207.56
190.57
192.57
169.58
167.07
169.01
157.72
145.86
145.46
148.13
146.61
145.79
152.60
140.88
129.46
131.66
128.02
124.34
129.74
125.05
128.42
130.34
142.13
144.25
135.36
129.12
124.52
119.64
133.75
144.91
154.04
141.45
144.56
146.41
136.14
142.62
146.08
134.57
138.78
140.85
146.41
141.76
137.30
142.99
160.34
168.01
172.09
166.32
169.73
181.24
165.21
162.28
177.41
177.58
199.01
229.55
236.25
266.45
297.69
285.56
283.01
267.11
242.35
238.54
219.34
231.60
237.53
233.18
273.81
262.61
250.58
254.46
241.10
227.41
231.49
246.32
242.13
243.90
269.56
283.16
274.54
269.03
258.12
252.65
249.65
263.08
259.33
271.59
282.28
296.06
288.81
303.31
308.34
346.76
330.45
310.19
312.95
322.21
324.87
322.82
315.86
272.47
268.72
262.28
282.85
285.45
283.34
297.36
332.88
330.23
310.63
330.16
327.45
340.77
335.57
348.68
350.31
348.02
362.66
373.11
382.02
420.86
448.00
466.48
490.99
479.81
514.73
547.12
581.51
634.69
643.90
Dataseries Y:
174.45
182.23
181.59
237.63
268.16
286.73
278.42
291.58
302.20
334.87
388.58
449.64
476.76
543.14
674.80
688.35
594.26
493.87
433.18
448.26
444.22
383.44
367.52
371.62
390.50
384.83
347.53
319.22
300.02
333.20
278.97
283.18
323.86
330.96
318.04
291.19
293.77
292.11
298.09
312.62
325.58
416.21
432.41
401.11
422.93
406.40
390.90
390.20
357.13
355.21
372.25
364.64
388.48
376.13
328.09
294.96
275.67
272.42
251.83
255.05
262.83
248.86
247.23
245.07
234.77
185.83
193.57
197.86
197.03
216.56
231.35
227.30
230.76
251.68
246.85
234.55
228.22
224.08
216.78
224.78
240.92
258.56
269.43
281.77
274.50
268.46
267.27
267.27
271.52
265.11
264.69
265.26
268.77
287.26
285.15
292.71
293.06
300.49
304.33
303.25
322.93
316.50
304.02
309.90
311.89
297.87
299.98
279.92
276.75
270.11
270.79
270.20
266.85
264.97
234.33
234.66
229.41
245.44
278.16
336.69
375.16
357.21
372.29
347.03
314.16
276.02
277.61
297.51
360.62
328.08
313.37
274.65
249.96
242.69
215.70
222.90
232.81
216.15
203.88
208.45
218.98
228.22
231.11
227.16
225.11
227.02
218.17
212.04
207.37
206.08
188.10
180.01
197.89
207.44
204.28
221.51
223.42
211.91
208.10
201.10
201.33
184.64
143.83
131.40
132.34
118.06
117.44
113.17
109.07
110.36
122.92
123.35
118.21
111.71
110.39
118.56
122.80
123.92
122.31
124.47
116.47
114.35
113.24
112.29
103.75
100.05
100.05
99.00
102.87
101.15
111.12
111.97
107.65
93.85
93.89
91.18
83.07
81.95
86.40
85.65
90.34
97.42
105.09
112.02
103.40
103.61
101.19
98.94
101.79
102.67
108.91
128.88
137.79
129.90
135.50
136.27
130.93
134.04
142.65
158.33
209.33
247.76
361.55
358.50
402.97
373.52
338.03
286.01
289.99
296.94
321.94
319.18
310.63
284.00
264.03
287.00
253.64
248.59
244.12
204.79
198.39
213.61
200.49
199.89
201.06
189.84
170.77
174.65
163.89
160.76
154.76
139.02
148.13
166.23
176.88
170.62
206.35
195.64
175.60
164.13
165.68
164.29
167.64
182.10
183.89
183.78
181.20
196.15
200.05
182.39
169.84
174.80
175.93
177.03
176.72
185.32
181.42
174.67
161.86
152.82
149.78
144.60
135.72
139.05
131.33
129.01
139.00
147.25
117.24
107.72
101.96
98.00
97.71
94.09
89.99
84.33
85.61
79.67
72.33
66.98
71.43
69.62
67.29
62.81
65.12
64.31
60.47
56.92
53.51
51.24
52.21
53.68
50.29
53.73
64.15
64.68
62.43
62.66
63.05
61.46
70.72
73.48
83.58
83.91
90.79
89.66
81.95
82.50
83.33
75.42
77.93
80.03
82.34
79.10
75.20
79.15
87.83
81.68
80.91
80.18
80.60
87.90
79.41
74.76
75.49
69.82
72.11
80.95
81.48
90.92
109.15
111.88
123.61
132.32
127.60
114.57
103.33
104.79
113.43
124.32
139.75
138.85
131.40
133.49
132.45
132.78
142.18
162.24
170.00
165.72
169.29
169.03
174.45
174.34
169.76
175.44
184.99
204.32
203.95
192.77
204.54
200.84
204.13
201.48
218.72
254.52
268.79
245.35
240.04
245.46
254.04
248.15
232.32
195.70
200.09
181.90
182.41
176.85
168.23
166.51
166.71
162.68
158.03
159.50
162.75
162.06
153.18
154.07
154.50
149.65
148.26
157.67
155.67
169.58
187.99
182.28
179.19
187.99
202.91
207.43
222.87
241.08
260.43




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 & 3 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=207536&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]3 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=207536&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=207536&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 time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net







Granger Causality Test: Y = f(X)
ModelRes.DFDiff. DFFp-value
Complete model402
Reduced model408-63.088089497557560.00574244217809935

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

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







Granger Causality Test: X = f(Y)
ModelRes.DFDiff. DFFp-value
Complete model402
Reduced model408-61.667681558915480.1275201492009

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

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



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