Gregory-Hansen Cointegration Test
Moderators: EViews Gareth, EViews Moderator
Re: Gregory-Hansen Cointegration Test
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.
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
Code: Select all
group gr.add lnm
call greghansen(lnx,gr,2,"aic",6)
Re: Gregory-Hansen Cointegration Test
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
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
- Attachments
-
- greghansenedit.prg
- (5.45 KiB) Downloaded 1816 times
Re: Gregory-Hansen Cointegration Test
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:
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:
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.
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
Now you can run the program code by changing the following line:
Code: Select all
call greghansen(lnx,gr,2,"aic",6)
-
- Posts: 4
- Joined: Sat May 23, 2015 9:41 pm
Re: Gregory-Hansen Cointegration Test
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
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
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
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
- Attachments
-
- bismillah_run.wf1
- eviews workfile
- (48.83 KiB) Downloaded 5730 times
-
- gh.prg
- program command
- (4.79 KiB) Downloaded 1768 times
Re: Gregory-Hansen Cointegration Test
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.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
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
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
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
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.how can i know if there is cointegration in my model?
Re: Gregory-Hansen Cointegration Test
Dear Trubador
Thank you so much for your explanation. it is so helpful, i will learn more about this.
Best Wishes,
Setyowati
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
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
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
I think it is doable. Try changing the following lines:1. Is it possible to make the Gregory-Hansen Cointegration test with a known break point.
Code: Select all
...
!lower = @round(@obs(Y)*!trim)
!upper = @round(@obs(Y)*(1-!trim))
...
Code: Select all
...
!lower = 44+1
!upper = 44+1
...
You can always try these things in EViews and see it for yourself.2. What does the number 19-2 indicate in the variable '@TREND>19-2'?
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
Thank you for your reply, I appreciate.
Re: Gregory-Hansen Cointegration Test
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
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
You should "Run" the program file as a whole, not execute it line by line.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
Return to “Program Repository”
Who is online
Users browsing this forum: No registered users and 1 guest