Page 5 of 8

Re: Gregory-Hansen Cointegration Test

Posted: Tue May 26, 2015 6:53 am
by feka
Dear trubador,
Thank you for the prompt response. I try to create the single series for the independent variable, but I still have the same error message. I want to test call greghansen(lnx,lnm,2,"aic",6), Could you show me how to correctly define my series lnm to "group G ' group of independent variable(s) (including single series) " argument?
Many thanks for your kind help.

Re: Gregory-Hansen Cointegration Test

Posted: Tue May 26, 2015 7:28 am
by trubador

Code: Select all

group gr.add lnm
call greghansen(lnx,gr,2,"aic",6)

Re: Gregory-Hansen Cointegration Test

Posted: Tue May 26, 2015 7:54 am
by feka
Dear trubador,
Please do apologize me, but I've tried to follow your instruction and it did not work. Below I attach the program. Perhaps my mistake in another command or typo? Really sorry to bother you.
sincerely yours,
feka

Re: Gregory-Hansen Cointegration Test

Posted: Tue May 26, 2015 12:05 pm
by trubador
You are not bothering me at all.

You are just not following the instructions. First, create a group called "gr" in your workfile by typing the following syntax into the command line:

Code: Select all

group gr.add lnm


Make sure that there is now a group object in your workfile called "gr" and includes the series "lnm".

Now you can run the program code by changing the following line:

Code: Select all

call greghansen(lnx,gr,2,"aic",6)


At some point, I have to assume that you have a basic understanding of EViews and that you know how to manipulate data, at the very least. If you need help, there are very nice learning resources on EViews' website. I strongly suggest you to take a look at http://www.eviews.com/illustrated/illustrated.html and/or http://www.eviews.com/Learning/index.html before doing such complex analyses.

Re: Gregory-Hansen Cointegration Test

Posted: Wed Jun 03, 2015 1:02 am
by nhuphuong114
Dear Mr. Trubador!

I have a data spanning from 2005 to 2015, I divide into 3 sub-sample. I test unit roots for entire sample and 03 sub-samples.
For entire sample, all variables are I(1), however, 03 sub-samples are I(0). Can I employ GH test for each sub-samples?
Thank you in advance for your prompt support.
I'm looking forward to hearing from you!

Best regards!
Phuong Ha

Re: Gregory-Hansen Cointegration Test

Posted: Wed Jun 10, 2015 3:22 pm
by Setyowati
Dear trubador and all members

i want to run the GH test for my data but i then i got message "Syntax error in "GHZ" (1,1) =? "Gregory-Hansen".
What should i do to fix this one? i attached my workfile and program.
need help in hurry. thank you so much.

Best Wishes,

Setyowati

Re: Gregory-Hansen Cointegration Test

Posted: Thu Jun 11, 2015 12:04 am
by trubador
Setyowati wrote:Dear trubador and all members

i want to run the GH test for my data but i then i got message "Syntax error in "GHZ" (1,1) =? "Gregory-Hansen".
What should i do to fix this one? i attached my workfile and program.
need help in hurry. thank you so much.

Best Wishes,

Setyowati

That is because all spaces are substituted with question marks "?" in your code. It might be a copy-paste problem, but you need to figure it out.

And please do not send private messages. There is really no need to. Once you have posted your question in the forum, I usually do my best to answer it.

Re: Gregory-Hansen Cointegration Test

Posted: Thu Jun 11, 2015 8:29 am
by Setyowati
Dear Mr. trubador

thank you so much for your help, i am so new in eviews. i fixed it already then i get the result as follow

THE GREGORY-HANSEN
COINTEGRATION TEST
MODEL 2: Level Shift

ADF Procedure

t-stat -6.410.373
Lag 1.000.000
Break 2012M06

Phillips Procedure

Za-stat -1.129.511
Za-break 2008M07
Zt-stat -1.032.463
Zt-break 2008M07

how can i know if there is cointegration in my model?

Best Regards,

Setyowati

Re: Gregory-Hansen Cointegration Test

Posted: Thu Jun 11, 2015 1:17 pm
by trubador
Setyowati wrote:how can i know if there is cointegration in my model?

Table 1 of the original paper (Gregory and Hansen,JOE,1996) presents the asymptotic critical values for such purposes. In your case, 5% and 1% levels of significance would be -4.61 and -5.13, respectively. Therefore, you can reject the null hypothesis of no cointegration.

Re: Gregory-Hansen Cointegration Test

Posted: Fri Jun 12, 2015 5:53 am
by Setyowati
Dear Trubador

Thank you so much for your explanation. it is so helpful, i will learn more about this.

Best Wishes,

Setyowati

Re: Gregory-Hansen Cointegration Test

Posted: Mon Jun 22, 2015 4:10 am
by R. Jassy
Dear Eren and Tang,
Thank you for all the help and support, i appreciate.
I have 2 questions:
1. Is it possible to make the Gregory-Hansen Cointegration test with a known break point.
2. What does the number 19-2 indicate in the variable '@TREND>19-2'?
Thank you in advance for your reply
Kind Regards,
Yasmine

Re: Gregory-Hansen Cointegration Test

Posted: Mon Jun 29, 2015 6:23 am
by trubador
R. Jassy wrote:1. Is it possible to make the Gregory-Hansen Cointegration test with a known break point.

I think it is doable. Try changing the following lines:

Code: Select all

...
!lower = @round(@obs(Y)*!trim)
!upper = @round(@obs(Y)*(1-!trim))
...

For instance, if you would like to generate the statistics for a particular breakpoint, say 44, then simply write:

Code: Select all

...
!lower = 44+1
!upper = 44+1
...
It will generate the relevant statistics for 44th observation, but you'll need to refer to original paper for use the table for critical values there for hypothesis testing.
R. Jassy wrote:2. What does the number 19-2 indicate in the variable '@TREND>19-2'?

You can always try these things in EViews and see it for yourself.
It simply generates a binary dummy variable starting as of 19th observation. These days we do it with the following command:

Code: Select all

@after("19")

Re: Gregory-Hansen Cointegration Test

Posted: Tue Jun 30, 2015 2:21 am
by R. Jassy
Thank you for your reply, I appreciate.

Re: Gregory-Hansen Cointegration Test

Posted: Wed Jul 01, 2015 7:06 am
by msvanidze
Thanks for this topic and code itself!

I am not good with programming. I just copied your code, inserted it in new program file, and executed commands. however, in the very beginning I received such error message "GREGHANSEN is not a defined subroutine in “CALL GREGHANSEN(y,x, “AIC”, 6)”. p.s. I called my data y and x as given in the initial code. I am working with EViews 8. Could you detect what is wrong with my trial?

Thank you!
Best,
Miranda

Re: Gregory-Hansen Cointegration Test

Posted: Wed Jul 01, 2015 10:56 am
by trubador
msvanidze wrote:Thanks for this topic and code itself!

I am not good with programming. I just copied your code, inserted it in new program file, and executed commands. however, in the very beginning I received such error message "GREGHANSEN is not a defined subroutine in “CALL GREGHANSEN(y,x, “AIC”, 6)”. p.s. I called my data y and x as given in the initial code. I am working with EViews 8. Could you detect what is wrong with my trial?

Thank you!
Best,
Miranda

You should "Run" the program file as a whole, not execute it line by line.