Page 4 of 8

Re: Gregory-Hansen Cointegration Test

Posted: Thu Feb 27, 2014 7:03 am
by d952
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

Re: Gregory-Hansen Cointegration Test

Posted: Thu Feb 27, 2014 1:57 pm
by trubador
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

Posted: Fri Apr 25, 2014 6:26 am
by mensenu
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!

Re: Gregory-Hansen Cointegration Test

Posted: Fri Apr 25, 2014 2:16 pm
by trubador
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

Posted: Fri Apr 25, 2014 10:35 pm
by mensenu
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!

Re: Gregory-Hansen Cointegration Test

Posted: Sat Apr 26, 2014 2:43 am
by trubador
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.

Re: Gregory-Hansen Cointegration Test

Posted: Thu Jul 03, 2014 6:04 am
by mahwish_arshad
trubador wrote: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.


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?

Re: Gregory-Hansen Cointegration Test

Posted: Sat Nov 01, 2014 6:43 am
by addienasyamila
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 :)

Re: Gregory-Hansen Cointegration Test

Posted: Tue Nov 04, 2014 8:12 am
by addienasyamila
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 :)

Re: Gregory-Hansen Cointegration Test

Posted: Tue Nov 04, 2014 6:01 pm
by addienasyamila
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

Re: Gregory-Hansen Cointegration Test

Posted: Sun Jan 18, 2015 6:52 am
by dilzod1
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!

Re: Gregory-Hansen Cointegration Test

Posted: Sat May 23, 2015 10:11 pm
by nhuphuong114
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

Re: Gregory-Hansen Cointegration Test

Posted: Mon May 25, 2015 2:08 am
by trubador
Reading through previous discussions (at least) would be more than helpful: viewtopic.php?f=15&t=976#p4932

As the error message indicates, you trying to run a program code from the command line...

Re: Gregory-Hansen Cointegration Test

Posted: Mon May 25, 2015 10:08 pm
by feka
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.

Re: Gregory-Hansen Cointegration Test

Posted: Tue May 26, 2015 12:00 am
by trubador
feka wrote: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.

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.