Page **3** of **8**

### Re: Gregory-Hansen Cointegration Test

Posted: **Wed Feb 10, 2010 8:37 pm**

by **coldmountain**

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.

### Re: Gregory-Hansen Cointegration Test

Posted: **Sat Mar 20, 2010 6:32 pm**

by **Kinga**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Mon May 03, 2010 3:51 pm**

by **arka2010**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Thu Aug 26, 2010 4:10 am**

by **Wira**

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.

### Re: Gregory-Hansen Cointegration Test

Posted: **Tue Nov 09, 2010 10:59 am**

by **jjaa**

Hi,

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

Thank You

### Re: Gregory-Hansen Cointegration Test

Posted: **Wed Nov 10, 2010 12:44 am**

by **trubador**

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...

### Re: Gregory-Hansen Cointegration Test

Posted: **Sat Dec 18, 2010 6:12 am**

by **adder000**

[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.

### Re: Gregory-Hansen Cointegration Test

Posted: **Fri Nov 04, 2011 1:25 pm**

by **echerry**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Mon Nov 07, 2011 8:28 am**

by **echerry**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Sat Jan 07, 2012 3:56 am**

by **dandume**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Sat Jan 07, 2012 4:12 am**

by **dandume**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Sun Jan 08, 2012 6:13 am**

by **trubador**

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...

### Re: Gregory-Hansen Cointegration Test

Posted: **Sun Jan 08, 2012 10:10 am**

by **echerry**

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

### Re: Gregory-Hansen Cointegration Test

Posted: **Wed Nov 07, 2012 2:58 pm**

by **JeremyHenrichs**

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.

### Re: Gregory-Hansen Cointegration Test

Posted: **Thu Nov 08, 2012 12:40 am**

by **trubador**

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`