error in Dumitrescu Hurlin test in Eviews 9?

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Mateus
Posts: 5
Joined: Thu Jul 06, 2017 5:30 am

error in Dumitrescu Hurlin test in Eviews 9?

Postby Mateus » Mon Jul 10, 2017 1:58 am

This paper (https://www.unine.ch/files/live/sites/i ... P17-03.pdf) claims there is an error in Eviews 8 Dumitrescu Hurlin causality test code. Did you fix that for Eviews 9?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: error in Dumitrescu Hurlin test in Eviews 9?

Postby EViews Gareth » Mon Jul 10, 2017 9:26 am

We do not believe it is a bug in our code. We'll post more details soon.
Follow us on Twitter @IHSEViews

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: error in Dumitrescu Hurlin test in Eviews 9?

Postby EViews Gareth » Mon Jul 10, 2017 2:23 pm

We'll go into even more detail at a later date, but to prove the results we're getting, here's some EViews code that computes the Wald statistics that they compute on page 8 of their paper.

Code: Select all

wfopen .\data_demo.dta
pagestruct id @date(t)

'compute granger causality using built in
group g y x
show g.cause(1, dh)

'loop through the cross-sections calculating Wald test for each individual
!n = 10
matrix(!n,2) walds
for !i=1 to !n
   smpl if @crossid=!i
   freeze(mode=overwrite, temp) g.cause(1)  'built in Granger Causality Test
   walds(!i,1) = temp(8,3)
   
   equation eq1.ls y c y(-1) x(-1)  'manually calculate using least squares
   freeze(mode=overwrite, temp) eq1.wald c(3)=0
   walds(!i,2) = temp(7,2)
next
smpl @all

'display individual walds and their average
show walds
=@cmean(walds)

'means are equal (to a number of decimal places), and match the W-stat given in the built in procedure.


And here is some Stata code that produces the same things using Stata's built in Wald test and Granger Causality functions:

Code: Select all

clear
use "data_demo.dta", clear
xtset id t
xtgcause y x
mat W = J(10,2,0)
forvalues i = 1/10{
   regress y L.y L.x if id==`i'
   test L.x
   matrix W[`i',1]=r(F)
   
   var y x if id==`i', lags(1/1) dfk small
   vargranger
   matrix a=r(gstats)
   matrix W[`i',2]=a[1,1]
}
matlist W


You can see that EViews produces exactly the same individual Wald statistics as Stata does, and that the EViews produced W statistic is the average of those individual Wald statistics.
Attachments
data_demo.dta
(4.26 KiB) Downloaded 287 times
Follow us on Twitter @IHSEViews

Mateus
Posts: 5
Joined: Thu Jul 06, 2017 5:30 am

Re: error in Dumitrescu Hurlin test in Eviews 9?

Postby Mateus » Wed Jul 12, 2017 1:49 am

Thanks for that.
Did you check the Z statistics?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: error in Dumitrescu Hurlin test in Eviews 9?

Postby EViews Gareth » Wed Jul 12, 2017 4:56 am

Yes, they are also correct.
Follow us on Twitter @IHSEViews

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: error in Dumitrescu Hurlin test in Eviews 9?

Postby EViews Gareth » Wed Jul 12, 2017 6:18 am

Dumitrescu and Hurlin have now updated their code so that it matches EViews.
Follow us on Twitter @IHSEViews

webers
Posts: 1
Joined: Wed Jul 12, 2017 6:52 am

Re: error in Dumitrescu Hurlin test in Eviews 9?

Postby webers » Wed Jul 12, 2017 8:04 am

Dear Mateus, Dear Gareth,

We are the authors of the paper that raised the issue.
Following your previous posts, we have carefully investigated the difference between the results obtained with Eviews and our Stata command (xtgcause). As correctly indicated by M. Gareth, it turns out that the differences arise because of small sample adjustments, which were implemented in Eviews but not in xtgcause.
We therefore apologize for incorrectly judging Eviews’ command in our paper and for the trouble this may have caused.
We have already implemented a new version of the Stata command xtgcause that calculates the Wald and Z statistics with small sample adjustments. The output coincides with Eviews'. The new version of the command is attached to this post.
We are now updating the working paper and will replace the version currently online (dated 22Feb2017) as soon as possible.

We thank both of you for raising and discussing the issue.

Luciano Lopez and Sylvain Weber
Attachments
xtgcause_2.0.zip
Package xtgcause, version 2.0
(4.39 KiB) Downloaded 289 times


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 31 guests