Page 6 of 8

Re: Gregory-Hansen Cointegration Test

Posted: Wed Sep 02, 2015 5:16 am
by llenk01
Hello there,

I am using the Gregory Hansen Test to look for relationships between four European stock markets (UK, France, Germany and Spain) and US. I am testing the relationship in pairs and weirdly I am getting the same results when testing with the same dependent variable (please see the attached photo). For example I have the same result for the following pairs US-Spain, UK-Spain, Germany-Spain, France-Spain. Any idea why? Is the test valid at all?

Here is a part of the formula:

group group1
group1.add lnfr
call greghansen(lnes,group1,4,"aic",6)

Re: Gregory-Hansen Cointegration Test

Posted: Wed Sep 02, 2015 7:14 am
by trubador
Hard to say without seeing the workfile.

Re: Gregory-Hansen Cointegration Test

Posted: Wed Sep 02, 2015 7:40 am
by llenk01
Hi Trubador,

Please see the attached file.

Re: Gregory-Hansen Cointegration Test

Posted: Wed Sep 02, 2015 7:40 am
by llenk01
And the program attached

Re: Gregory-Hansen Cointegration Test

Posted: Thu Sep 03, 2015 2:04 am
by trubador
llenk01 wrote:Hello there,

I am using the Gregory Hansen Test to look for relationships between four European stock markets (UK, France, Germany and Spain) and US. I am testing the relationship in pairs and weirdly I am getting the same results when testing with the same dependent variable (please see the attached photo). For example I have the same result for the following pairs US-Spain, UK-Spain, Germany-Spain, France-Spain. Any idea why? Is the test valid at all?

Here is a part of the formula:

group group1
group1.add lnfr
call greghansen(lnes,group1,4,"aic",6)

Each time you run the code, you populate group1 with additional dependent variables. Make sure that you drop the second dependent variable after each run. The following snippet of code might be more useful:

Code: Select all

mode quiet
%y1 = "lnes"
%y2 = "lnfr"
group x.add {%y2}
call greghansen({%y1},x,4,"aic",6)
x.drop {%y2}
'... [rest of the program]

Re: Gregory-Hansen Cointegration Test

Posted: Thu Sep 03, 2015 10:01 am
by llenk01
Thanks for your help Trubador.

So in my case I use group "group1" instead the "x" in the suggested code..? weirdly I can run the program with "x" as well as "group1" but the x folder in my workfile is empy..

mode quiet
%y1 = "lnes"
%y2 = "lnfr"
group group1.add {%y2}
call greghansen({%y1},group1,4,"aic",6)
group1.drop {%y2}
'... [rest of the program]

My new results look much better. I used first country in each row as independent variable which I thought is the right think to do.. Would you suggest otherwise?

Re: Gregory-Hansen Cointegration Test

Posted: Thu Sep 03, 2015 1:14 pm
by trubador
llenk01 wrote:So in my case I use group "group1" instead the "x" in the suggested code..? weirdly I can run the program with "x" as well as "group1" but the x folder in my workfile is empy..

That is because we empty the group after we are done. Otherwise it would keep adding new variables:

Code: Select all

group1.drop {%y2}

llenk01 wrote:I used first country in each row as independent variable which I thought is the right think to do.. Would you suggest otherwise?

Since this is a cointegration analysis, it should not matter. However, you can always try the other way around to see if there is a significant change in the results.

Re: Gregory-Hansen Cointegration Test

Posted: Fri Sep 04, 2015 2:55 am
by llenk01
Thanks again Trubador - I am really happy with the outcome and the results.

Re: Gregory-Hansen Cointegration Test

Posted: Thu Sep 10, 2015 12:54 am
by nhuphuong114
Dear Mr. Trubador!

Plese kindly help me fix the error " Near Singular matrix error". Regressor maybe perfectly collinear in "DO_GHC.LS YC (@trend > 43-2)G". I attached my Work file and GH test code below.

Thank you in advance for your prompt attention! I'm looking forward to hearing from you soon!

Best Regards!
Phuong Ha

Re: Gregory-Hansen Cointegration Test

Posted: Fri Sep 11, 2015 3:16 am
by trubador
One of your variables (lex) is causing the problem. There is nothing I can do about it.

Re: Gregory-Hansen Cointegration Test

Posted: Fri Sep 11, 2015 8:18 am
by nhuphuong114
trubador wrote:One of your variables (lex) is causing the problem. There is nothing I can do about it.


Thank you for your advice! But when I remove the variable lex, this error still appears. Please kindly help me if removing the lex can make the GH test workable.

Best Regards!
Phuong Ha

Re: Gregory-Hansen Cointegration Test

Posted: Sat Sep 12, 2015 10:31 am
by trubador
You need to empty the group after you are done. See the previous thread: posting.php?mode=reply&f=15&t=976#pr45243

Re: Gregory-Hansen Cointegration Test

Posted: Thu Oct 29, 2015 2:04 am
by jug
First of all, thank you for enabling GH cointegration test add-in for Eviews.

I just have one (fairly technical) question regarding break dates. Does the identified date refer to the last date of the old regime or the first date of the new regime?

I understand that Eviews generally (for instance for unit root tests with breakpoint) defines break date as the first date for the new regime. I was just wondering weather this is also the case for GH cointegration test?

Re: Gregory-Hansen Cointegration Test

Posted: Fri Oct 30, 2015 5:16 am
by trubador
First date of the new regime.

Re: Gregory-Hansen Cointegration Test

Posted: Mon Nov 02, 2015 12:52 am
by jug
Thank you.

Cheers.