RATS 11.1
RATS 11.1

@HEGY computes the Hylleberg, et. al. (1990) seasonal unit root tests for quarterly time series with extensions by Ghysels, et. al. (1994) to include additional tests.

@HEGY( options )  series start end

Parameters

series

series to analyze

start  end

range of series to use. By default, the defined range of series.

Options

DET=NONE/CONSTANT/SD/TREND/STREND/[ALL]

Select the deterministic component. NONE sets the deterministic component to zero; CONSTANT includes intercept only; SD includes constant and 3 seasonal dummies, TREND includes constant and linear trend, STREND includes constant, trend and seasonal dummies, ALL (the default) reports all.
 

LAGS=lag length [4]

Controls default lag length. Can be overridden for particular deterministic models using the other "lags" options listed below.

 

NLAGS=Number of lags when DET=NONE  [LAGS]    

ILAGS=Number of lags when DET=CONSTANT [LAGS]

SLAGS=Number of lags when DET=SD  [LAGS]

TLAGS=Number of lags when DET=TREND  [LAGS]

STLAGS=Number of lags when DET=STREND  [LAGS]

Note that for these 5 options, the default setting is controlled by the LAGS option described above (its default value is 4).

 

TITLE="title of report" ["HEGY Seasonal Unit Root Test, Series xxx"]

Description

The procedure runs the regression:
 

\(\begin{array}{l}

 {y_{4,t}} = {\rm{det}}\,{\rm{terms + }}{\pi _1}{y_{1,t - 1}} + {\pi _2}{y_{2,t - 1}} + {\pi _3}{y_{3,t - 2}} + {\pi _4}{y_{3,t - 1}} + {\rm{lags}}\,{\rm{of }}{y_{4,t}} \\

 {y_{1,t}} = {y_t} + {y_{t - 1}} + {y_{t - 2}} + {y_{t - 3}} \\

 {y_{2,t}} =  - {y_t} + {y_{t - 1}} - {y_{t - 2}} + {y_{t - 3}} \\

 {y_{3,t}} =  - {y_t} + {(y_{t - 2}} \\

 {y_{4,t}} = {y_t} - {y_{\scriptstyle t - 4 \hfill \atop

  \scriptstyle  \hfill}} \\

 \end{array}\)

 

The tests reported are t-statistics on \(\pi_1\), \(\pi_2 \), \(\pi_3\), and \(\pi_4\) and an F-statistic on \(\pi_3=\pi_4=0\). These all have non-standard distributions and critical values for these in the original HEGY paper. Also reported are the extensions of HEGY method in the Ghysels paper. These

are denoted F234 for \(\pi_2=\pi_3=\pi_4=0\) and F1234 for \(\pi_1=\pi_2=\pi_3=\pi_4=0\).

 

It also reports a Lagrange Multiplier test for autocorrelation in the error term of order 1-4 (thus a test for whether there is residual autocorrelation) and (if appropriate) the significance of the last lag on the seasonal differences (thus a test for whether you might have included too many lags).

Example

This does the HEGY regression directly by generating the required series and running a LINREG and doing the tests, and also by simply using the @HEGY procedure. The direct regression does just the full set of deterministics (constant, trend, seasonals), while the procedure generates a full table of tests for deterministic components (the default is DET=ALL).

 

*

* Enders, Applied Econometric Time Series, 4th edition

* Example from Chapter 4, pages 226-227

* HEGY test

*

open data quarterly.xls

calendar(q) 1960:1

data(format=xls,org=columns) 1960:01 2012:04 m1nsa m2nsa

*

set trend = t

*

set y = log(m1nsa)

set ysdiff = y-y{4}

set y1t    = y+y{1}+y{2}+y{3}

set y2t    = -y+y{1}-y{2}+y{3}

set y3t    = -y+y{2}

seasonal seasons

*

* Pick the lag length on the seasonal differences by general-to-specific

* with maximum lags of 12 and a significance level of .05.

*

stwise(method=gtos,force=9,slstay=.05) ysdiff

# constant trend y1t{1} y2t{1} y3t{1 2} seasons{0 to -2} ysdiff{1 to 12}

*

* Rerun with the chosen number of lags. (The estimates will be slightly

* different because the previous regression uses the range that allows

* for 12 lags). Note that the coefficients on the deterministic

* variables depend upon the precise way in which the seasonal dummies

* are generated; that will not, however, have any effect on the other

* coefficients.

*

linreg ysdiff

# constant trend y1t{1} y2t{1} y3t{1 2} seasons{0 to -2} ysdiff{1 to 8}

compute forunit=%tstats(3)

compute forsemiannual=%tstats(4)

exclude(noprint)

# y3t{1 2}

compute forseasonal=%cdstat

*

disp "HEGY Test Statistics"

disp "Non-Seasonal Unit Root" @30 ###.### forunit

disp "Semi-Annual Unit Root"  @30 ###.### forsemiannual

disp "Annual Unit Root"       @30 ###.### forseasonal

*

* The @HEGY procedure will do the test. Each line in the output has a

* different set of deterministic variables. The one which matches the

* result above is the last line (Intercept, Seasonal Dummies and Trend).

*

@hegy(lags=8) y

Output

The procedure output is at the end, where the final row is the one that matches the other calculations. The first block of output is from an STWISE instruction which does a general-to-specific pruning of the lags on the seasonally differenced data.

 

 Stepping Out with P= 0.549613 Variable YSDIFF{12}

 Stepping Out with P= 0.923267 Variable YSDIFF{11}

 Stepping Out with P= 0.179607 Variable YSDIFF{10}

 Stepping Out with P= 0.305906 Variable YSDIFF{9}


 

Stepwise Regression

Dependent Variable YSDIFF

Quarterly Data From 1964:01 To 2012:04

Usable Observations                       196

Degrees of Freedom                        179

Centered R^2                        0.9400205

R-Bar^2                             0.9346592

Uncentered R^2                      0.9776523

Mean of Dependent Variable       0.0556573287

Std Error of Dependent Variable  0.0430003391

Standard Error of Estimate       0.0109916807

Sum of Squared Residuals         0.0216262511

Regression F(16,179)                 175.3345

Significance Level of F             0.0000000

Log Likelihood                       614.8603

Durbin-Watson Statistic                1.9650
 

    Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

1.  Constant                      0.055858495  0.030207594      1.84915  0.06608469

2.  TREND                         0.000189377  0.000087165      2.17263  0.03112235

3.  Y1T{1}                       -0.003414505  0.001571643     -2.17257  0.03112716

4.  Y2T{1}                       -0.689355735  0.162357564     -4.24591  0.00003492

5.  Y3T{1}                       -0.292252504  0.099972313     -2.92333  0.00391041

6.  Y3T{2}                       -0.227173162  0.099665212     -2.27936  0.02382578

7.  SEASONS{-2}                   0.019740651  0.005393804      3.65988  0.00033187

8.  SEASONS{-1}                   0.005885074  0.003114509      1.88957  0.06043244

9.  SEASONS                       0.024879203  0.005226092      4.76058  0.00000397

10. YSDIFF{1}                     0.504376052  0.177609610      2.83980  0.00503684

11. YSDIFF{2}                     0.046309609  0.181853148      0.25465  0.79928277

12. YSDIFF{3}                    -0.439920339  0.178977475     -2.45796  0.01492463

13. YSDIFF{4}                     0.033559513  0.153320818      0.21888  0.82698958

14. YSDIFF{5}                     0.324517792  0.137319448      2.36323  0.01918896

15. YSDIFF{6}                     0.068490152  0.140526326      0.48738  0.62658324

16. YSDIFF{7}                    -0.424236529  0.135829357     -3.12331  0.00208618

17. YSDIFF{8}                     0.235110963  0.076568307      3.07060  0.00246936


 


 

Linear Regression - Estimation by Least Squares

Dependent Variable YSDIFF

Quarterly Data From 1963:01 To 2012:04

Usable Observations                       200

Degrees of Freedom                        183

Centered R^2                        0.9397546

R-Bar^2                             0.9344872

Uncentered R^2                      0.9774654

Mean of Dependent Variable       0.0551413477

Std Error of Dependent Variable  0.0427324225

Standard Error of Estimate       0.0109375632

Sum of Squared Residuals         0.0218923428

Regression F(16,183)                 178.4109

Significance Level of F             0.0000000

Log Likelihood                       628.2059

Durbin-Watson Statistic                1.9759

 

    Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

1.  Constant                      0.056232110  0.030054862      1.87098  0.06294382

2.  TREND                         0.000187656  0.000086565      2.16781  0.03146474

3.  Y1T{1}                       -0.003395525  0.001563390     -2.17190  0.03114969

4.  Y2T{1}                       -0.668391667  0.160387335     -4.16736  0.00004747

5.  Y3T{1}                       -0.280015237  0.097245586     -2.87946  0.00445856

6.  Y3T{2}                       -0.216868536  0.097029507     -2.23508  0.02662157

7.  SEASONS{-2}                   0.018748674  0.005310243      3.53066  0.00052446

8.  SEASONS{-1}                   0.005628604  0.003080844      1.82697  0.06933364

9.  SEASONS                       0.023943359  0.005143959      4.65466  0.00000621

10. YSDIFF{1}                     0.535704154  0.175387949      3.05440  0.00259186

11. YSDIFF{2}                     0.030286711  0.180000098      0.16826  0.86656502

12. YSDIFF{3}                    -0.419033142  0.175888503     -2.38238  0.01822614

13. YSDIFF{4}                     0.004912332  0.150857076      0.03256  0.97405871

14. YSDIFF{5}                     0.345588010  0.135864030      2.54363  0.01179775

15. YSDIFF{6}                     0.048956539  0.138698617      0.35297  0.72451669

16. YSDIFF{7}                    -0.399560684  0.133286787     -2.99775  0.00309773

17. YSDIFF{8}                     0.221207191  0.075200442      2.94157  0.00368775


 

HEGY Test Statistics

Non-Seasonal Unit Root        -2.172

Semi-Annual Unit Root         -4.167

Annual Unit Root               6.812
 

HEGY Seasonal Unit Root Test, Series Y

Sample from 1960:01 to 2012:04

Observations    212

             PI1    PI2    PI3    PI4    F34    F234   F1234  Lags AR(1-4) Signif Last Lag t Signif

None          2.542 -1.589 -1.867 -2.101  4.001  3.575  4.516    8   2.051  0.089      2.031 0.043625

I Only       -0.139 -1.579 -1.855 -2.070  3.911  3.501  2.638    8   2.091  0.084      1.985 0.048597

I,SD         -0.194 -4.134 -2.146 -2.909  6.693 11.199  8.412    8   1.170  0.326      2.650 0.008759

I,Tr         -2.095 -1.597 -1.919 -2.058  4.009  3.588  3.784    8   1.760  0.139      2.269 0.024428

I,SD,Tr      -2.172 -4.167 -2.235 -2.879  6.812 11.393  9.752    8   0.804  0.524      2.942 0.003688


 


Copyright © 2026 Thomas A. Doan