Gregory-Hansen Cointegration Test
Moderators: EViews Gareth, EViews Moderator
Re: Gregory-Hansen Cointegration Test
Hi Trabadur, would you please tell me in this test number of observation matter? for example my data sample contains 5000 observations, can I use Gregory and Hansen test?
Thank you in advance
Thank you in advance
Re: Gregory-Hansen Cointegration Test
I cannot think of any particular reason why the test should not be used in such large samples. But if this is a high frequency data (daily/intraday), then the noise may introduce problems and some sort of filtering may be needed prior to the analysis. A literature review might be helpful in that respect...
Re: Gregory-Hansen Cointegration Test
Hello,
Could someone help me please? I uploaded the files. Error: "Near Singular Matrix in "Do_ghc.ls Y C (@trend>35-2) G"
This error occurs when I run the program under the regime shift.
thanks in advance!
Could someone help me please? I uploaded the files. Error: "Near Singular Matrix in "Do_ghc.ls Y C (@trend>35-2) G"
This error occurs when I run the program under the regime shift.
thanks in advance!
Re: Gregory-Hansen Cointegration Test
One of the earlier posts does address this problem. Your independent variable contains zeros until 9/25/2006, which is the very source of the error. You should adjust the range accordingly. Please inspect the raw data carefully before doing anything with them.
Re: Gregory-Hansen Cointegration Test
thanks Trubador!
Does it happen all the time? What if the data don't have those values?
And does it still recognize as "NA" if I input zero instead of NA?
Thanks again!
Does it happen all the time? What if the data don't have those values?
And does it still recognize as "NA" if I input zero instead of NA?
Thanks again!
Re: Gregory-Hansen Cointegration Test
Actually, that post explains the situation for NA values. And yes, it applies to zero values as well. The problem here is related to your data, not the specification itself.
-
- Posts: 2
- Joined: Fri Jun 27, 2014 8:13 am
Re: Gregory-Hansen Cointegration Test
Hi turbador thanks for helpful posts. I have a question regarding your above post. If there is no NA value in data set and error message occurs "Near Singular Matrix error. Regressors may be perfectly collinear in "Do_GHC.LS Y C (@TREND>5-2) G" then what does it mean? is there multicollinearity among regressors?Actually, that post explains the situation for NA values. And yes, it applies to zero values as well. The problem here is related to your data, not the specification itself.
-
- Posts: 8
- Joined: Sat Nov 01, 2014 6:07 am
Re: Gregory-Hansen Cointegration Test
dear trubador,
i really need your help. i want to know how to run gregory hansen cointegration test. i hope u explain to me with detail. could i know your email so that i can contact you directly. thanks :)
i really need your help. i want to know how to run gregory hansen cointegration test. i hope u explain to me with detail. could i know your email so that i can contact you directly. thanks :)
-
- Posts: 8
- Joined: Sat Nov 01, 2014 6:07 am
Re: Gregory-Hansen Cointegration Test
what maxlag i have to write in gregory hansen subroutine? is that based on our own? and how to interpret the result (beased on ADF procedure and phillip procedure)? thankyou for your help :)
-
- Posts: 8
- Joined: Sat Nov 01, 2014 6:07 am
Re: Gregory-Hansen Cointegration Test
dear trubador,
i've time series data and i think have a trend. how to intrepret the result of gregory hansen test? which model would we choose what procedure i must based to? i really hope your reply:)
THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 2: Level Shift
Model A. with level shift (c)
ADF Procedure
t-stat -2.843375
Lag 0.000000
Break 2010M02
Phillips Procedure
Za-stat -16.13550
Za-break 2010M02
Zt-stat -3.014790
Zt-break 2010M02
Model B. level shift with trend
THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 3: Level Shift with Trend
ADF Procedure
t-stat -3.455989
Lag 1.000000
Break 2007M04
Phillips Procedure
Za-stat -21.67565
Za-break 2007M03
Zt-stat -3.032055
Zt-break 2007M03
Model c. regime shift
THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 4: Regime Shift
ADF Procedure
t-stat -2.815224
Lag 1.000000
Break 2011M02
Phillips Procedure
Za-stat -15.07875
Za-break 2010M08
Zt-stat -2.861866
Zt-break 2010M08
i've time series data and i think have a trend. how to intrepret the result of gregory hansen test? which model would we choose what procedure i must based to? i really hope your reply:)
THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 2: Level Shift
Model A. with level shift (c)
ADF Procedure
t-stat -2.843375
Lag 0.000000
Break 2010M02
Phillips Procedure
Za-stat -16.13550
Za-break 2010M02
Zt-stat -3.014790
Zt-break 2010M02
Model B. level shift with trend
THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 3: Level Shift with Trend
ADF Procedure
t-stat -3.455989
Lag 1.000000
Break 2007M04
Phillips Procedure
Za-stat -21.67565
Za-break 2007M03
Zt-stat -3.032055
Zt-break 2007M03
Model c. regime shift
THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 4: Regime Shift
ADF Procedure
t-stat -2.815224
Lag 1.000000
Break 2011M02
Phillips Procedure
Za-stat -15.07875
Za-break 2010M08
Zt-stat -2.861866
Zt-break 2010M08
- Attachments
-
- test.WF1
- (18.04 KiB) Downloaded 1471 times
Re: Gregory-Hansen Cointegration Test
Hello guys,
I have some questions regarding cointegration tests. I will appreciate very much if you take time and help me with this.
I have price index data of several countries and Dow Jones (DJ).
I need find whether these countries are cointegrated with DJ.
I have already run the test separately. (E.g. test on Mexico with DJ, Greece with DJ, etc.)
Now I need to make portfolio of these countries. How can I form a portfolio of these countries under Gregory-Hansen Test and Johansen cointegration test?
Thanks in advance!
I have some questions regarding cointegration tests. I will appreciate very much if you take time and help me with this.
I have price index data of several countries and Dow Jones (DJ).
I need find whether these countries are cointegrated with DJ.
I have already run the test separately. (E.g. test on Mexico with DJ, Greece with DJ, etc.)
Now I need to make portfolio of these countries. How can I form a portfolio of these countries under Gregory-Hansen Test and Johansen cointegration test?
Thanks in advance!
-
- Posts: 4
- Joined: Sat May 23, 2015 9:41 pm
Re: Gregory-Hansen Cointegration Test
Dear Trubador!
This is the first time I run in Eviews by using code. I did following to your guide, but an error appears :"flow of control Statement executed from the command line".
Attached is my Work file. Please kindly you help me fix this error!
I started the procedure such as:
group independents
independents.add loil lex
call greghansen(lsen,independents,4,"aic",2)
.....
Thank you so much and best regards!
Phuong Ha
This is the first time I run in Eviews by using code. I did following to your guide, but an error appears :"flow of control Statement executed from the command line".
Attached is my Work file. Please kindly you help me fix this error!
I started the procedure such as:
group independents
independents.add loil lex
call greghansen(lsen,independents,4,"aic",2)
.....
Thank you so much and best regards!
Phuong Ha
- Attachments
-
- official data 2005-2015.wf1
- (169.15 KiB) Downloaded 3803 times
Re: Gregory-Hansen Cointegration Test
Reading through previous discussions (at least) would be more than helpful: http://forums.eviews.com/viewtopic.php?f=15&t=976#p4932
As the error message indicates, you trying to run a program code from the command line...
As the error message indicates, you trying to run a program code from the command line...
Re: Gregory-Hansen Cointegration Test
dear trubador,
Thank you for generating greghansen test code for eviews. I am new to econometrics and I am trying to use this code for my project. however I get the error message: "!type mismatch at argument 2 in "call greghansen(x,y,2,"aic",6)" whenever i run the code. I have search in the previous posts and found that this question apparently had been asked in 2010 but it seems no answers avalaible.
Could you please help me to resolve the problem. Below I attach the workfile and the program.
thank you very much for your time and assistance.
Thank you for generating greghansen test code for eviews. I am new to econometrics and I am trying to use this code for my project. however I get the error message: "!type mismatch at argument 2 in "call greghansen(x,y,2,"aic",6)" whenever i run the code. I have search in the previous posts and found that this question apparently had been asked in 2010 but it seems no answers avalaible.
Could you please help me to resolve the problem. Below I attach the workfile and the program.
thank you very much for your time and assistance.
- Attachments
-
- greghansen.prg
- (5.46 KiB) Downloaded 1405 times
-
- xm lao.WF1
- (12.82 KiB) Downloaded 4050 times
Re: Gregory-Hansen Cointegration Test
See the "Arguments" section in the code. It says, the second argument should be a group even if you have only one series. Creating a group object with a single series should solve your problem.I get the error message: "!type mismatch at argument 2 in "call greghansen(x,y,2,"aic",6)" whenever i run the code. I have search in the previous posts and found that this question apparently had been asked in 2010 but it seems no answers avalaible.
Return to “Program Repository”
Who is online
Users browsing this forum: No registered users and 2 guests