Gregory-Hansen Cointegration Test
Moderators: EViews Gareth, EViews Moderator
Re: Gregory-Hansen Cointegration Test
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)
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)
- Attachments
-
- results.JPG (150.54 KiB) Viewed 68106 times
Re: Gregory-Hansen Cointegration Test
Hard to say without seeing the workfile.
Re: Gregory-Hansen Cointegration Test
Hi Trubador,
Please see the attached file.
Please see the attached file.
- Attachments
-
- econometrics ii project.wf1
- (363.05 KiB) Downloaded 3926 times
Re: Gregory-Hansen Cointegration Test
And the program attached
- Attachments
-
- gh02.prg
- (4.77 KiB) Downloaded 1664 times
Re: Gregory-Hansen Cointegration Test
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: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)
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
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?
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?
- Attachments
-
- NewResults.JPG (158.91 KiB) Viewed 68037 times
Re: Gregory-Hansen Cointegration Test
That is because we empty the group after we are done. Otherwise it would keep adding new variables: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..
Code: Select all
group1.drop {%y2}
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.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
Thanks again Trubador - I am really happy with the outcome and the results.
-
- Posts: 4
- Joined: Sat May 23, 2015 9:41 pm
Re: Gregory-Hansen Cointegration Test
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
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
- Attachments
-
- gh test.prg
- (4.79 KiB) Downloaded 1640 times
-
- phase iv.wf1
- (30.36 KiB) Downloaded 4040 times
Re: Gregory-Hansen Cointegration Test
One of your variables (lex) is causing the problem. There is nothing I can do about it.
-
- Posts: 4
- Joined: Sat May 23, 2015 9:41 pm
Re: Gregory-Hansen Cointegration Test
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.One of your variables (lex) is causing the problem. There is nothing I can do about it.
Best Regards!
Phuong Ha
Re: Gregory-Hansen Cointegration Test
You need to empty the group after you are done. See the previous thread: http://forums.eviews.com/posting.php?mo ... 76#pr45243
Re: Gregory-Hansen Cointegration Test
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?
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
First date of the new regime.
Re: Gregory-Hansen Cointegration Test
Thank you.
Cheers.
Cheers.
Return to “Program Repository”
Who is online
Users browsing this forum: No registered users and 2 guests