Gregory-Hansen Cointegration Test

For posting your own programs to share with others

Moderators: EViews Gareth, EViews Moderator

coldmountain
Posts: 1
Joined: Wed Feb 10, 2010 7:10 pm

Re: Gregory-Hansen Cointegration Test

Postby coldmountain » Wed Feb 10, 2010 8:37 pm

dear trubador,

thank you for your effort and contribution to our forum with your very helpful GH test code.

i'm new to eviews and try to run your code to test cointegration between real exports (seasonally adjusted, rx_sa) and real import+ (seasonally adjusted, rmm_sa) but there's a error message: "!type mismatch at argument 2 in "call greghansen(rx_sa,rmm_sa,2,"aic",5)" whenever i run the code.

pls tell my why and how i can resolve it,

thank you very much.
Attachments
greghansen.prg
(4.74 KiB) Downloaded 622 times
greghansen test.wf1
(8.73 KiB) Downloaded 532 times

Kinga
Posts: 3
Joined: Sun Nov 08, 2009 4:44 pm

Re: Gregory-Hansen Cointegration Test

Postby Kinga » Sat Mar 20, 2010 6:32 pm

dear trubador,

I am getting the same error message: "!type mismatch at argument 2 in "call greghansen(x,y,2,"aic",5)" whenever i run the code.

Could you please help to resolve the problem.

Kinga

arka2010
Posts: 1
Joined: Mon May 03, 2010 2:31 pm

Re: Gregory-Hansen Cointegration Test

Postby arka2010 » Mon May 03, 2010 3:51 pm

Hi,
I would greteful if anyone could help me.I use eviews 6.0 and I am trying to run the code on the regression:int(dependent variable) inf(only one independent variable).I have tryied to do this and here are my eviews archives.I can't spot where is the mistake.
Thanks in advance
Attachments
program.prg
(4.84 KiB) Downloaded 468 times
thesis.wf1
(13.76 KiB) Downloaded 429 times

Wira
Posts: 6
Joined: Mon Jan 18, 2010 3:18 pm

Re: Gregory-Hansen Cointegration Test

Postby Wira » Thu Aug 26, 2010 4:10 am

Dear Eviews administrator,

I was wondering if you could tell me what is the cointegration factor of Gregory Hansen test? I am thinking the result is like Johansen test result but it is not. The program results in only the break position and its statistical test. How many cointegration and the equation of that do not appear. Or I am wrong in understanding this test. Pls explain to me. Thanks.

jjaa
Posts: 11
Joined: Tue Sep 28, 2010 8:19 pm

Re: Gregory-Hansen Cointegration Test

Postby jjaa » Tue Nov 09, 2010 10:59 am

Hi,
what is the Phillips procedure in the Gregory Hansen Cointegration Test?

Thank You

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Gregory-Hansen Cointegration Test

Postby trubador » Wed Nov 10, 2010 12:44 am

jjaa wrote:Hi,
what is the Phillips procedure in the Gregory Hansen Cointegration Test?
Thank You

You should refer to the original paper cited in the beginning of the code...

adder000
Posts: 5
Joined: Sun Dec 12, 2010 1:16 am

Re: Gregory-Hansen Cointegration Test

Postby adder000 » Sat Dec 18, 2010 6:12 am

[quote="trubador"][quote="jjaa"]Hi,
Dear trubador,
Thank you for your attention and It's my great honor to introduce myself. My name is Adder,a Chinese postgraduate student. I am writting a paper now (the data I used is time series) , which should be estimated by the method of FM-OLS. I want to use the Gregory-Hansen test based on the method of FM-OLS to detect the structural break, but I don't know how to get it. I know you have once given the Gregory-Hansen test program in this forumm,but that program is based on the OLS. Can you give me some help? I am using the Eviews 6.Thank you very much.

echerry
Posts: 3
Joined: Fri Nov 04, 2011 12:43 pm

Re: Gregory-Hansen Cointegration Test

Postby echerry » Fri Nov 04, 2011 1:25 pm

Hi everyone,

I am carrying out a study on the long-run relationship between imports and exports of a country to check whether its current account balance is sustainable or not.

My series are real exports and real imports, quarterly data from 1970Q1 to 2010Q4.

I already did the Johansen cointegration test for the whole sample and for a subsample from 1970Q1 to 2007Q4 (so ending when the last financial crisis started, more or less). The test gave me no cointegration for the whole sample but cointegration with 1 cointegrating vector when analyzing the subsample.

I did the G-H test with the program troubadour posted, testing the whole sample for all of the models available and changing the program accordingly as follows

group independents
independents.add real_mm
call greghansen(real_x,independents,3,"aic",6)
(this is the example for model n. 3)
This is an example of an output I got:

THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 3: Level Shift with Trend

ADF Procedure

t-stat -4.326451
Lag 1.000000
Break 1995Q1

Phillips Procedure

Za-stat -54.95626
Za-break 1995Q1
Zt-stat -5.918280
Zt-break 1995Q1

Looking at the critical values provided by G&H 1996, table 1, it looks like the ADF does not reject the null of no cointegration while the Za and Zt stats reject it.
Now, my question is: which procedure should I check in order to decide whether there is cointegration or not? How can I choose?

Thank you for your help
Cherry

echerry
Posts: 3
Joined: Fri Nov 04, 2011 12:43 pm

Re: Gregory-Hansen Cointegration Test

Postby echerry » Mon Nov 07, 2011 8:28 am

Hello, is there anyone able to help me on this?

Thanks,
Cherry

echerry wrote:Hi everyone,

I am carrying out a study on the long-run relationship between imports and exports of a country to check whether its current account balance is sustainable or not.

My series are real exports and real imports, quarterly data from 1970Q1 to 2010Q4.

I already did the Johansen cointegration test for the whole sample and for a subsample from 1970Q1 to 2007Q4 (so ending when the last financial crisis started, more or less). The test gave me no cointegration for the whole sample but cointegration with 1 cointegrating vector when analyzing the subsample.

I did the G-H test with the program troubadour posted, testing the whole sample for all of the models available and changing the program accordingly as follows

group independents
independents.add real_mm
call greghansen(real_x,independents,3,"aic",6)
(this is the example for model n. 3)
This is an example of an output I got:

THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 3: Level Shift with Trend

ADF Procedure

t-stat -4.326451
Lag 1.000000
Break 1995Q1

Phillips Procedure

Za-stat -54.95626
Za-break 1995Q1
Zt-stat -5.918280
Zt-break 1995Q1

Looking at the critical values provided by G&H 1996, table 1, it looks like the ADF does not reject the null of no cointegration while the Za and Zt stats reject it.
Now, my question is: which procedure should I check in order to decide whether there is cointegration or not? How can I choose?

Thank you for your help
Cherry

dandume
Posts: 2
Joined: Sat Jan 07, 2012 3:35 am

Re: Gregory-Hansen Cointegration Test

Postby dandume » Sat Jan 07, 2012 3:56 am

Hi iam using eviews to investigate co- integration among corruption, economic growth and poverty
my problems i dont know how to extract trace statistics and maximal value from the result obtained in the eview

dandume
Posts: 2
Joined: Sat Jan 07, 2012 3:35 am

Re: Gregory-Hansen Cointegration Test

Postby dandume » Sat Jan 07, 2012 4:12 am

Hi i here by summit result from eview for the data of 1996 to 2011 i dont know how separate trace statistics and maximal value from the result
i will be grateful for your kind help
Attachments
RESULT.docx
(13.43 KiB) Downloaded 298 times
DATA ON CAUSALITY STUDY.docx
I have attached the data and the result can any one help me in indicating which one is supposed to my trace statistics and maximal value
(11.34 KiB) Downloaded 295 times

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Gregory-Hansen Cointegration Test

Postby trubador » Sun Jan 08, 2012 6:13 am

dandume wrote:Hi i here by summit result from eview for the data of 1996 to 2011 i dont know how separate trace statistics and maximal value from the result

Your question has nothing to do with G-H Cointegration test. Anyway, in my opinion, the number of observations are too small to conduct such an analysis. According to your output, 0.807608 is the Eigenvalue and 33.06752 is the trace statistic. Rest of the output is pretty self-explanatory...

echerry
Posts: 3
Joined: Fri Nov 04, 2011 12:43 pm

Re: Gregory-Hansen Cointegration Test

Postby echerry » Sun Jan 08, 2012 10:10 am

Still looking for help with this, is there anyone who can answer my question?

Thanks a lot
Cherry

echerry wrote:Hello, is there anyone able to help me on this?

Thanks,
Cherry

echerry wrote:Hi everyone,

I am carrying out a study on the long-run relationship between imports and exports of a country to check whether its current account balance is sustainable or not.

My series are real exports and real imports, quarterly data from 1970Q1 to 2010Q4.

I already did the Johansen cointegration test for the whole sample and for a subsample from 1970Q1 to 2007Q4 (so ending when the last financial crisis started, more or less). The test gave me no cointegration for the whole sample but cointegration with 1 cointegrating vector when analyzing the subsample.

I did the G-H test with the program troubadour posted, testing the whole sample for all of the models available and changing the program accordingly as follows

group independents
independents.add real_mm
call greghansen(real_x,independents,3,"aic",6)
(this is the example for model n. 3)
This is an example of an output I got:

THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 3: Level Shift with Trend

ADF Procedure

t-stat -4.326451
Lag 1.000000
Break 1995Q1

Phillips Procedure

Za-stat -54.95626
Za-break 1995Q1
Zt-stat -5.918280
Zt-break 1995Q1

Looking at the critical values provided by G&H 1996, table 1, it looks like the ADF does not reject the null of no cointegration while the Za and Zt stats reject it.
Now, my question is: which procedure should I check in order to decide whether there is cointegration or not? How can I choose?

Thank you for your help
Cherry

JeremyHenrichs
Posts: 2
Joined: Wed Nov 07, 2012 2:55 pm

Re: Gregory-Hansen Cointegration Test

Postby JeremyHenrichs » Wed Nov 07, 2012 2:58 pm

Trubador, thank you very much for you helpful program. Although, I am currently working on my master-thesis, so I would need some kind of source I can refer to when using this code. Is there any journal article or something where you published your program, where I can refer to? Thanks a lot in advance.

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Gregory-Hansen Cointegration Test

Postby trubador » Thu Nov 08, 2012 12:40 am

JeremyHenrichs wrote:Is there any journal article or something where you published your program, where I can refer to?


Sİnce the code has first been made available in the forum, you can use the website itself as a reference. I am not sure which citation rules you should follow, but something along the following lines would be more than enough I believe:

Code: Select all

Ocakverdi, E. and Tang, C.F. (2009). Gregory-Hansen Cointegration Test EViews Source Code. http://forums.eviews.com/viewtopic.php?f=15&t=976#p3427


Return to “Program Repository”

Who is online

Users browsing this forum: No registered users and 1 guest