Page 1 of 1

### HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Mon Jan 05, 2009 8:05 am
Below you can find HEGY test as a subroutine in EViews. Copy and paste the code into your program window to execute. Please feel free to modify and/or improve it...

Code: Select all

`'HEGY test for unit roots and seasonal unit roots of MONTHLY seriescall hegy(name of your series)subroutine hegy(series y)'generate auxiliary polynomialsseries Z1 =   y + y(-1) + y(-2) + y(-3) + y(-4) + y(-5) + y(-6) + y(-7) + y(-8) + y(-9) + y(-10) + y(-11)series Z2 = - y + y(-1) - y(-2) + y(-3) - y(-4) + y(-5) - y(-6) + y(-7) - y(-8) + y(-9) - y(-10) + y(-11)series Z3 = - y + y(-2) - y(-4) + y(-6) - y(-8) + y(-10)series Z4 = - y + @sqrt(3)*y(-1) - 2*y(-2) + @sqrt(3)*y(-3) - y(-4) + y(-6) - @sqrt(3)*y(-7) + 2*y(-8) - @sqrt(3)*y(-9) + y(-10)series Z5 = - y - @sqrt(3)*y(-1) - 2*y(-2) - @sqrt(3)*y(-3) - y(-4) + y(-6) + @sqrt(3)*y(-7) + 2*y(-8) + @sqrt(3)*y(-9) + y(-10)series Z6 = - y + y(-1) - y(-3) + y(-4) - y(-6) + y(-7) - y(-9) + y(-10)series Z7 = - y - y(-1) + y(-3) + y(-4) - y(-6) - y(-7) + y(-9) + y(-10)series Z8 = y - y(-12)'create seasonal dummiesfor !i=1 to 11series s!i = @seas(!i) - @seas(12)next'estimate the equationequation eq1.ls(showopts,c=1e-5,m=1000) Z8 c s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 Z1(-1) Z2(-1) Z3(-1) Z3(-2) Z4(-1) Z4(-2) Z5(-1) Z5(-2) Z6(-1) Z6(-2) Z7(-1) Z7(-2) Z8(-1 to -12) show eq1.output'generate the test statistics that are not given in the equation output (Warning: critical values are different from those of EViews'. You should find true values for accurate hypothesis testing!)freeze eq1.wald c(15)=0, c(16)=0freeze eq1.wald c(17)=0, c(18)=0freeze eq1.wald c(19)=0, c(20)=0freeze eq1.wald c(21)=0, c(22)=0freeze eq1.wald c(23)=0, c(24)=0freeze eq1.wald c(14)=0, c(15)=0, c(16)=0, c(17)=0, c(18)=0, c(19)=0, c(20)=0, c(21)=0, c(22)=0, c(23)=0, c(24)=0freeze eq1.wald c(13)=0, c(14)=0, c(15)=0, c(16)=0, c(17)=0, c(18)=0, c(19)=0, c(20)=0, c(21)=0, c(22)=0, c(23)=0, c(24)=0'delete auxiliary series and seasonal dummiesdelete z* s*endsub`

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Wed Sep 02, 2009 7:19 am
Hello,

Thank you for the program, but I do not know how to interpret the results. Please, can you give me any reference to understand the results of this test?
Thank you very much in advance.
Best regards,

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Wed Sep 02, 2009 7:46 am
Hylleberg, S., Engle, R. F., Granger, C. W. J. and Yoo, B. S., 1990. "Seasonal integration and cointegration," Journal of Econometrics, Elsevier, vol. 44(1-2), pp 215-238.
Joseph Beaulieu, J. and Miron, Jeffrey A., 1993. "Seasonal unit roots in aggregate U.S. data," Journal of Econometrics, Elsevier, vol. 55(1-2), pp 305-328.

You can find plenty of other studies, if you search journal/working paper databases...

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Wed Sep 02, 2009 10:59 am
Hello,

Thank you again for your answer; another question: the test you developed is based on the derivation of Franses (1990) or Beaulieu and Miron?

Best regards,

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Wed Sep 02, 2009 11:10 am
Please see the following discussion for more details: viewtopic.php?f=5&t=843

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Wed Sep 02, 2009 3:22 pm
Your test follows the developments of Franses (1991); however, according to Franses' methodology, we should check the statistical significance of:

1) phi 3, phi 4
2) phi 5, phi 6
3) phi 7, phi 8
4) phi 9, phi 10
5) phi 11, phi 12
6) phi 3... phi 12

but in the program you modified step 6 and added a step 7 as follows:

6) phi 2... phi 12
7) phi 1... phi 12
Why is that? I am confused.

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Wed Sep 02, 2009 11:16 pm
I had written the code long before I posted it into the forum. Therefore, I do not remember why such a difference occurs in the hypothesis testing stage. Anyway, general structure of the code will remain more or less the same in different HEGY specifications and you can make all the necessary modifications easily.

### Re: HEGY Seasonal Unit Root Testing for daily Series

Posted: Wed Feb 17, 2010 10:40 am
HEGY Seasonal Unit Root Testing , co integrqtion nd VECM for daily stock indices,

am working for PhD on world stock prices indice (eight major counitres), Plz can you help how to do this test in Eviews, i do not anything about command programming in eviews.

i am looking forward for your warm response.

thanking you,

yours
krishna

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Mon Sep 26, 2011 5:53 am
Hi,

i need an confirmation...

I have problem while interpreting HEGY results for my monthly data. My test variable indicates that there is no unit root in 2phi/3 and 5phi/6 interval but there is one between phi/2, phi/3 and phi/6 intervals. Am i sure this only shows characteristics of seasonal stochastic trend of my series... it is because there is a unit root in other phi intervals then my data has seasonal unit root and it need to be seasonal differenced to properly modelled in an ARIMA model...

Thank you very much

### Re: HEGY Seasonal Unit Root Testing for Monthly Series

Posted: Sun Jun 17, 2012 11:57 pm
Hello!

I am running the subroutine code proposed above but I get the error message near singular matrix error, regressors may be perfectly collinear. Do you know how I can solve this problem? I need to test for seasonal unit roots in my monthly series.

Thank you!