/*
@HEGY12(lags=-1/[0]/..,det=none/constant/sd/trend/[strend],alpha=1/2/[3]/4,[notrace]/trace) SERIES START END

use alpha = 1/2/[3]/4 for 0.01/0.025/[0.05]/0.1 significance level


                                            Juin 1998 -  07/08/98
                                    Jean-Philip BELLOTTEAU - RATP/CML/RRC


Computes Beaulieu & Miron (1993) seasonal unit root tests for monthly
time series, with and without intercept, seasonal dummies, and/or trend
from the regression:

  a(B)Y13(t) = DET + PI1 Y1(t-1) + PI2 Y2(t-1) + PI3 Y3(t-1) +  PI4 Y4(t-1)  +  PI5 Y5(t-1)  +  PI6 Y6(t-1) 
                   + PI7 Y7(t-1) + PI8 Y8(t-1) + PI9 Y9(t-1) + PI10 Y10(t-1) + PI11 Y11(t-1) + PI12 Y12(t-1) + e(t)

Please note: This procedure is written for use with monthly time series.
             see HEGY4 for quaterly data.

The following OPTIONS are available:

DET   = NONE,CONS,SD,TREND,STREND

         Select the determinstic componant. NONE sets the determinstic
         componant to zero; CONS includes intercept only; SD includes CONS
         and (11) seasonal dummies; TREND includes CONS and trend; STREND
         includes CONS, SD, and Trend

LAGS  = [0]      Controls default lag length
                 With the option LAGS=-1, the procedure determines the number
                 of lags by S-BIC criteria with maxlag = Schwert information



The procedure reports a Lagrange Multiplier of order 1-12  & a Ljung-Box test for autocorrelation in
the error term 

REFERENCES:
J.J. Beaulieu, J.A. Miron, "Seasonal unit roots in aggregate U.S. data" - Journal of Econometrics [1993]

monthly version by                      Jean-Philip Bellotteau
Send comments and suggestions to:       Jean-Philip.bellotteau@ratp.fr
*/

PROCEDURE HEGY12 SERIES START END
   TYPE SERIES SERIES
   TYPE INTEGER START END
   *
   OPTION INTEGER LAGS     0
   OPTION CHOICE  DET      5  NONE CONStant SD TREND STREND
   OPTION CHOICE  alpha    3  0.01 0.025 0.05 0.1
   OPTION switch  trace      0
   OPTION switch  graph      0
   *
   LOCAL INTEGER             STARTL ENDL
   LOCAL VEC[SERIES]        y
   LOCAL VEC[REAL]           pi f
   LOCAL REC[REAL]           cv
   LOCAL SERIES             TREND SDUM et
   LOCAL REAL                r3 r32 qlb plb qlm plm sbic minsbic
   LOCAL INT                i j k l retard l12 nobs
   LOCAL VEC[INT]          reg aux
   LOCAL VEC[VEC[INT]]       regexc
   LOCAL   equation            hg lm hg2
   LOCAL   VEC[LABEL]         testcv al
	local	string				ch1

   *
   if %defined(series)
   {
      INQUIRE(SERIES=SERIES) STARTL>>START ENDL>>END
      *

      dim y(13) pi(12) f(16) cv(6,20) regexc(16) testcv(16) al(4)
      com al(1) = '1%', al(2) = '2.5%', al(3) = '5%', al(4) = '10%'
      do i=1,13
         clear y(i)
         label y(i)
         # 'Y'+%string(i)
      endo i
      do i=1,16
         com testcv(i) = ' '
      endo i

      COM CV = || 0.01,  0.025,  0.05,   0.10,    0.01,  0.025,  0.05,   0.10,    0.01,  0.025,  0.05,   0.10,    0.01,  0.025,  0.05,   0.10,    0.9,  0.95,  0.975,   0.99 |  $
                 -2.51, -2.18,  -1.89,  -1.58,   -2.53, -2.16,  -1.87,  -1.57,   -2.50, -2.16,  -1.88,  -1.55,   -2.31, -1.95,  -1.63,  -1.27,   2.34,  3.03,  3.71,    4.6  |  $
                 -3.35, -3.06,  -2.80,  -2.51,   -2.48, -2.15,  -1.89,  -1.57,   -2.51, -2.16,  -1.87,  -1.54,   -2.30, -1.93,  -1.62,  -1.27,   2.32,  3.01,  3.68,    4.6  |  $
                 -3.32, -3.02,  -2.76,  -2.47,   -3.28, -3.01,  -2.76,  -2.48,   -3.83, -3.51,  -3.25,  -2.95,   -2.61, -2.21,  -1.85,  -1.45,   5.27,  6.26,  7.19,    8.35 |  $
                 -3.87, -3.58,  -3.32,  -3.06,   -2.52, -2.18,  -1.88,  -1.55,   -2.49, -2.16,  -1.88,  -1.54,   -2.28, -1.93,  -1.61,  -1.25,   2.30,  2.90,  3.64,    4.53 |  $
                 -3.83, -3.54,  -3.28,  -2.99,   -3.31, -3.02,  -2.75,  -2.47,   -3.79, -3.50,  -3.24,  -2.95,   -2.57, -2.18,  -1.85,  -1.45,   5.25,  6.23,  7.14,    8.33 ||
		* Critical values for 240 observations

      com r32 = sqrt(3)/2.0, r3 = sqrt(3)
      if lags>0
         com retard = lags
      else
         com retard = 0

      SET Y(1)   =          SERIES  + SERIES{1} + SERIES{2}  + SERIES{3}  + SERIES{4} + SERIES{5}  + SERIES{6}  + SERIES{7} + SERIES{8}  + SERIES{9}  + SERIES{10} + SERIES{11}
      SET Y(2)   =      -   SERIES  + SERIES{1} - SERIES{2}  + SERIES{3}  - SERIES{4} + SERIES{5}  - SERIES{6}  + SERIES{7} - SERIES{8}  + SERIES{9}  - SERIES{10} + SERIES{11}
      SET Y(3)   =                  - SERIES{1}              + SERIES{3}              - SERIES{5}               + SERIES{7}              - SERIES{9}               + SERIES{11}
      SET Y(4)   =      -   SERIES              + SERIES{2}               - SERIES{4}              + SERIES{6}              - SERIES{8}               + SERIES{10}
      SET Y(5)   = 0.5*(-   SERIES  - SERIES{1}+2*SERIES{2}  - SERIES{3}  - SERIES{4}+2*SERIES{5}  - SERIES{6}  - SERIES{7}+2*SERIES{8}  - SERIES{9}  - SERIES{10}+2*SERIES{11}            )
      SET Y(6)   = r32*(    SERIES  - SERIES{1}              + SERIES{3}  - SERIES{4}              + SERIES{6}  - SERIES{7}              + SERIES{9}  - SERIES{10}                         )
      SET Y(7)   = 0.5*(    SERIES  - SERIES{1}-2*SERIES{2}  - SERIES{3}  + SERIES{4}+2*SERIES{5}  + SERIES{6}  - SERIES{7}-2*SERIES{8}  - SERIES{9}  + SERIES{10}+2*SERIES{11}            )
      SET Y(8)   = r32*(-   SERIES  - SERIES{1}              + SERIES{3}  + SERIES{4}              - SERIES{6}  - SERIES{7}              + SERIES{9}  + SERIES{10}                         )
      SET Y(9)   = 0.5*(-r3*SERIES  + SERIES{1}              - SERIES{3}+r3*SERIES{4}-2*SERIES{5}+r3*SERIES{6}  - SERIES{7}              + SERIES{9}-r3*SERIES{10}+2*SERIES{11}            )
      SET Y(10)  = 0.5*(    SERIES-r3*SERIES{1}+2*SERIES{2}-r3*SERIES{3}  + SERIES{4}              - SERIES{6}+r3*SERIES{7}-2*SERIES{8}+r3*SERIES{9}  - SERIES{10}                         )
      SET Y(11)  = 0.5*( r3*SERIES  + SERIES{1}              - SERIES{3}-r3*SERIES{4}-2*SERIES{5}-r3*SERIES{6}  - SERIES{7}              + SERIES{9}+r3*SERIES{10}+2*SERIES{11}            )
      SET Y(12)  = 0.5*(-   SERIES-r3*SERIES{1}-2*SERIES{2}-r3*SERIES{3}  - SERIES{4}              + SERIES{6}+r3*SERIES{7}+2*SERIES{8}+r3*SERIES{9}  - SERIES{10}                         )
      SET Y(13)  =          SERIES                                                                                                                                             - SERIES{12}

      if graph
      {
         spgraph(hfields=3,vfields=5)
            graph 1
            # series
            do i=1,13
               graph 1
               # y(i)
            enddo i
         spgraph(done)
      }

      clear et trend sdum
      SET TREND STARTL ENDL = T
      SEA SDUM
      *
      com nobs = endl-startl+1
      DIS
      DIS @20 'Monthly seasonal unit root by HEGY procedure (Beaulieu - Miron [1993])'
      dis
      dis 'Series'  %LABEL(SERIES) @-1 '.' %DATELABEL(startl) @-1 '-' @-1 %DATELABEL(endl) ',' nobs 'Obs.'
      dis

      enter(varying) reg
      # Y(1){1} Y(2){1} Y(3){1} Y(4){1} Y(5){1} Y(6){1} Y(7){1} Y(8){1} Y(9){1} Y(10){1} Y(11){1} Y(12){1}

      com k = %rows(reg)
      do i=1,11
         dim regexc(i)(k)
         do j=1,k
            com regexc(i)(j) = reg(j+%rows(reg)-k)
         enddo j
         com k = k - 4
      enddo i

      com i = 12
      do j=9,41,8
         dim regexc(i)(8)
         do l=1,8
            com regexc(i)(l) = reg(j+l-1)
         enddo l
         com i = i + 1
      enddo j

      if det<>1
      {
         if det==2
            enter(varying) aux
            # constant
         else if det==3
            enter(varying) aux
            # constant sdum{-10 to 0}
         else if det==4
            enter(varying) aux
            # constant trend
         else if det==5
            enter(varying) aux
            # constant sdum{-10 to 0} trend

         if retard==0
         {
            equation hg Y(13)
            # reg aux
            enter(varying) aux
            # reg aux
            equation lm et
            # et{1 to 12} reg aux
         }
         else
         {
            equation hg Y(13)
            # reg Y(13){1 to retard} aux
            enter(varying) aux
            # reg Y(13){1 to retard} aux
            equation lm et
            # et{1 to 12} reg Y(13){1 to retard} aux
         }
      }
      else
      {
         if retard==0
         {
            equation hg Y(13)
            # reg
            enter(varying) aux
            # reg
            equation lm et
            # et{1 to 12} reg
         }
         else
         {
            equation hg Y(13)
            # reg Y(13){1 to retard}
            enter(varying) aux
            # reg Y(13){1 to retard}
            equation lm et
            # et{1 to 12} reg Y(13){1 to retard}
         }
      }

      if lags==-1
      {
         dis
         dis 'Set of the number of lags by S-BIC criteria (and no serial correlation). Sample' %DATELABEL(startl+12+l12) @-1 '-' @-1 %DATELABEL(endl) @-1 ',' endl-startl-12-l12+1 'Obs.'
         dis
         dis 'Lag         S-BIC  p(Q°=0)'
         dis '**************************'

         if 12*((0.01*nobs)**0.25) - fix(12*((0.01*nobs)**0.25))<0.5
            com l12 = fix(12*((0.01*nobs)**0.25))
         else
            com l12 = fix(12*((0.01*nobs)**0.25))+1 ; * Schwert information [1987]
         com minsbic = 1e8
         do i=0,l12
            if i>0
               LINREG(noprint) Y(13) STARTL+12+l12 ENDL et
               # reg aux Y(13){1 to i}
            else
               LINREG(noprint) Y(13) STARTL+12+l12 ENDL et
               # reg aux
            com sbic = %nobs*log(%seesq*%nobs)+%nreg*log(%nobs)
            if (sbic < minsbic).and.(%qsignif>0.1)
               com minsbic = sbic, retard = i
            dis ## i @4 sbic #####.## %qsignif
         enddo i
         dis
         dis 'Optimal lag :' retard
         if retard>0
            linreg(noprint,create,define=hg) Y(13)
            # reg aux Y(13){1 to retard}
      }

        LINREG(print=trace,equation=hg) Y(13) STARTL+12+retard ENDL et
      do i=1,12
         COM pi(i) = %BETA(i)/SQRT(%SEESQ*%XX(i,i))

         if i==1
         {
            if pi(i)<cv(det+1,alpha)
               com testcv(i) = '*'
         }
         else if i==2
         {
            if pi(i)<cv(det+1,alpha+4)
               com testcv(i) = '*'
         }
         else if (float(i)/2.0)<>fix(float(i)/2.0)
         {
            if pi(i)<cv(det+1,alpha+8)
               com testcv(i) = '*'
         }
         else
         {
            if pi(i)<cv(det+1,alpha+12)
               com testcv(i) = '*'
         }
      enddo i
      com qlb = %qstat , plb = %qsignif
      do i=1,16
         exclude(noprint)
         # regexc(i)
         com f(i) = %CDSTAT

         if f(i)>cv(det+1,21-alpha)
            com testcv(i) = '*'
      enddo i

       
		com ch1 = ''
      if testcv(1)=='*'
         dis(store=ch1) 'SI(0,'
      else
         dis(store=ch1) 'SI(1,'
      if testcv(16)=='*'
         dis(store=ch1) ch1 @-2 '1)'
      else
         dis(store=ch1) ch1 @-2 '0)'


      LINREG(noprint,equation=lm) et STARTL+retard+24 ENDL
      cdf(noprint) chisqr %trsq 12
      com qlm = %cdstat, plm = %signif


      dis 'Freq.                 0     pi    -- pi/2 --    -- 2pi/3 -    -- pi/3 --    -- 5pi/6 -   -- pi/6 ---    pi/2   2pi/3    pi/3   5pi/6     pi/6'
      dis 'Roots       Lag     PI1    PI2    PI3    PI4    PI5    PI6    PI7    PI8    PI9   PI10   PI11   PI12  F[3-4]  F[5-6]  F[7-8] F[9-10] F[11-12]'
      dis '*********************************************************************************************************************************************'

      dis %label(series) @13 ## retard @18 ##.## pi(1) @-1 testcv(1) @25 ##.## pi(2) @-1 testcv(2) @32 ##.## pi(3) @-1 testcv(3) @39 ##.## pi(4) @-1 testcv(4) @46 ##.## pi(5) @-1 testcv(5) @53 ##.## pi(6) @-1 testcv(6) $
          @60 ##.## pi(7) @-1 testcv(7) @67 ##.## pi(8) @-1 testcv(8) @74 ##.## pi(9) @-1 testcv(9) @81 ##.## pi(10) @-1 testcv(10) @88 ##.## pi(11) @-1 testcv(11) @95 ##.## pi(12) @-1 testcv(12) $
          @102 ###.## f(12) @-1 testcv(12) @110 ###.## f(13) @-1 testcv(13) @118 ###.## f(14) @-1 testcv(14) @126 ###.## f(15) @-1 testcv(15) @134 ###.## f(16) @-1 testcv(16)
      dis
      dis  'with a significance level of' al(alpha)
      dis
      dis  'Ljung-Box test for serial correlation' @40 ##.## qlb ', significance level of' #.## plb
      dis  'LM test for serial correlation' @40 ##.## qlm ', significance level of' #.## plm

      release y pi f cv reg aux regexc
   }
   else
      dis '@HEGY12(lags=-1/[0]/..,det=none/constant/sd/trend/[strend],alpha=0.01/0.025/[0.05]/01,[notrace]/trace) SERIES START END'
end

/*
@HEGY4 (lags=-1/[0]/..,det=none/constant/sd/[strend]/all,alpha=[0.05]/0.1,[notrace]/trace) SERIES START END


                                            Juin 1998 -  16/04/99
                                    Jean-Philip BELLOTTEAU - RATP/CML/RRC


Computes HEGY (1990) seasonal unit root tests for quaterly
time series, with/and without intercept, trend and seasonal dummies
from the regression:

  a(B)Y5(t) = DET + PI1*Y1(t-1) + PI2*Y2(t-1) + PI3*Y3(t-1) +  PI4*Y4(t-1) + e(t)

Please note: This procedure is written for use with quaterly time series.
             see HEGY12 for quaterly data.

The following OPTIONS are available:

DET   = NONE,CONSTANT,STREND,ALL

LAGS  = [0]      Controls default lag length. Can be overridden for
                 With the option LAGS=-1, the procedure determines the number
                 of lags by S-BIC criteria



The procedure reports a Lagrange Multiplier of order 1-4  & a Ljung-Box test for autocorrelation in
the error term 

quaterly version based on Suliman Al-Turki
Send comments and suggestions to:       Jean-Philip.bellotteau@ratp.fr
*/



PROCEDURE HEGY4 SERIES START END
   TYPE SERIES                SERIES
   TYPE INTEGER               START END
   *
   OPTION INTEGER LAGS        0
   OPTION CHOICE  DET         4  none constant sd strend all
   OPTION CHOICE  alpha       1  0.05 0.1
   OPTION switch  trace       0
   OPTION switch  graph       0
   *
   LOCAL INTEGER              STARTL ENDL
   LOCAL VEC[SERIES]          y
   LOCAL VEC[REAL]            pi f
   LOCAL REC[REAL]            cv
   LOCAL SERIES               TREND sd et
   LOCAL REAL                 qlb plb qlm plm sbic minsbic
   LOCAL INT                  i j k l m n retard l4 nobs det2 det3
   local string               ch1
   LOCAL VEC[INT]             aux
   LOCAL equation             hg lm hg2
   LOCAL VEC[LABEL]           testcv
   LOCAL VEC[string]          labser

   *
   if %defined(series)
   {
      INQUIRE(SERIES=SERIES) STARTL>>START ENDL>>END
      *

      dim y(5) pi(4) f(1) cv(5,10) testcv(5) labser(5)
      do i=1,5
         clear y(i)
         label y(i)
         # 'Y'+%string(i)
      endo i
      do i=1,3
         com testcv(i) = ' '
      endo i

      COM CV = || 0.05, 0.10,  0.05, 0.10,  0.05, 0.10,  0.05, 0.10,  0.05, 0.10   |  $
                 -1.97,-1.61, -1.92,-1.57, -1.90,-1.53, -1.68,-1.32,  3.12, 2.39   |  $
                 -2.88,-2.58, -1.95,-1.60, -1.90,-1.54, -1.68,-1.30,  3.08, 2.35   |  $
                 -2.95,-2.63, -2.94,-2.63, -3.44,-3.14, -1.96,-1.53,  6.57, 5.56   |  $
                 -3.53,-3.22, -2.94,-2.63, -3.48,-3.14, -1.94,-1.51,  6.60, 5.52   ||
     *             t(PI1)        t(PI2)       t(PI3)       t(PI4)     F(PI3,PI4)
     * source : HEGY - T = 100

      if lags>0
         com retard = lags
      else
         com retard = 0

      SET Y(1) startl+4 endl  =  SERIES{1} + SERIES{2} + SERIES{3} + series{4}
      SET Y(2) startl+4 endl  = -SERIES{1} + SERIES{2} - SERIES{3} + series{4}
      SET Y(3) startl+4 endl  = -SERIES{1} + SERIES{3}
      SET Y(4) startl+4 endl  = -SERIES{2} + SERIES{4}
      SET Y(5) startl+4 endl  =  SERIES - series{4}

      com labser = ||'(B + B**2 + B**3 + B**4)'|'-(B - B**2 + B**3 - B**4)'|'-(B - B**3)'|'-(B**2 - B**4)'|'(1-B**4)'||

      if graph
      {
         spgraph(hfields=2,vfields=3)
            graph(vlabel=%label(series)) 1
            # series
            do i=1,5
               graph(vlabel=labser(i)) 1
               # y(i)
            enddo i
         spgraph(done)
      }

      clear et trend sd
      SET TREND STARTL ENDL = T
      SEA sd
      *
      com nobs = endl-startl+1
      DIS
      DIS @20 'Quaterly seasonal unit root by HEGY procedure ([1990])'
      dis
      dis 'Series'  %LABEL(SERIES) @-1 '.' %DATELABEL(startl) @-1 '-' @-1 %DATELABEL(endl) ',' nobs 'Obs. (' @-1 fix(nobs/4) 'years)'

      if det<>5
         com det2 = det3 = det
      else
         com det2 = 1, det3 = 4
      do m=det2,det3
         if m==2
         {
            enter(varying) aux
            # constant
            if (det<>5).or.(det==5.and.trace)
               dis 'Input : constant'
         }
         else if m==3
         {
            enter(varying) aux
            # constant sd{-2 to 0}
            if (det<>5).or.(det==5.and.trace)
                dis 'Input : constant + seasonal dummies'
         }
         else if m==4
         {
            enter(varying) aux
            # constant sd{-2 to 0} trend
            if (det<>5).or.(det==5.and.trace)
               dis 'Input : constant + seasonal dummies + trend'
         }
         else
         {
            dim aux(0)
            if (det<>5).or.(det==5.and.trace)
               dis 'No input'
         }

         if lags==-1
         {
            com l4 = %imin(nobs/4,12)
            com minsbic = 1e8
            if trace
            {
               dis
               dis 'Set of the number of lags by S-BIC criteria (and no serial correlation).'
               dis 'Sample' %DATELABEL(startl+4+l4) @-1 '-' @-1 %DATELABEL(endl) @-1 ',' endl-startl-4-l4+1 'Obs.'
               dis
               dis 'Lag         S-BIC  p(Q°=0)'
               dis '**************************'
            }
            do i=0,l4
               if i>0
                  LINREG(noprint) Y(5) STARTL+4+l4 ENDL et
                  # Y(1) Y(2) Y(3) Y(4) aux Y(5){1 to i}
               else
                  LINREG(noprint) Y(5) STARTL+4+l4 ENDL et
                  # Y(1) Y(2) Y(3) Y(4) aux
               com sbic = %nobs*log(%seesq*%nobs)+%nreg*log(%nobs)
               if (sbic < minsbic).and.(%qsignif>0.1)
                  com minsbic = sbic, retard = i
               if trace
                  dis ## i @4 sbic #####.## %qsignif
            enddo i
            if trace
            {
               dis
               dis 'Optimal lag :' retard
            }
         }

         if retard==0
         {
            equation hg Y(5)
            # Y(1) Y(2) Y(3) Y(4) aux
            equation lm et
            # et{1 to 4} Y(1) Y(2) Y(3) Y(4) aux
         }
         else
         {
            equation hg Y(5)
            # Y(1) Y(2) Y(3) Y(4) aux Y(5){1 to retard}
            equation lm et
            # et{1 to 4} Y(1) Y(2) Y(3) Y(4) aux Y(5){1 to retard}
         }

           LINREG(print=trace,equation=hg) Y(5) STARTL+4+retard ENDL et

         com n=0
         do i=1,4
            COM pi(i) = %BETA(i)/SQRT(%SEESQ*%XX(i,i))
            if pi(i)<cv(m+1,n+alpha)
               com testcv(i) = '*'
            com n = n + 2
         enddo i
         com qlb = %qstat , plb = %qsignif

         exclude(noprint)
         # y(3) y(4)

         com f(1) = %CDSTAT
         if f(1)>cv(m+1,8+alpha)
            com testcv(5) = '*'

         LINREG(noprint,equation=lm) et STARTL+4+retard+12 ENDL
         cdf(noprint) chisqr %trsq 12
         com qlm = %cdstat, plm = %signif

         com ch1 = ''
         if testcv(1)=='*'
            dis(store=ch1) 'SI(0,'
         else
            dis(store=ch1) 'SI(1,'

         if (testcv(2)=='*').and.(testcv(5)=='*')
            dis(store=ch1) ch1 @-2 '1)'
         else
            dis(store=ch1) ch1 @-2 '0)'

         if (det<>5).or.(det==5.and.m==1.and..not.trace)
         {
            dis
            dis 'Ang. Freq.(w)         0     pi    -- pi/2 --    pi/2'
            dis 'Freq.     (v)         0    1/2    --- 1/4 --     1/4'
            dis 'Périod    (T)        oo      2    ---- 4 ---       4'
            dis 'Roots       Lag     PI1    PI2    PI3    PI4  F[3-4]  |  LB    LM | ccl'
            dis '--------------------------------------------------------------------------'
         }
         dis %label(series) '(' @-1 m @-1 ')' @13 ## retard @18 ##.## pi(1) @-1 testcv(1) @25 ##.## pi(2) @-1 testcv(2) @32 ##.## pi(3) @-1 testcv(3) @39 ##.## pi(4) @-1 testcv(4) @46 ###.## f(1) @-1 testcv(5) @54 '|' @-1 #.## plb ##.## plm '|' ch1

         if (det<>5).or.(det==5.and.m==4.and..not.trace)
         {
            dis '--------------------------------------------------------------------------'
            if alpha==1
               dis ' * Significant at 5% level'
            else
               dis ' * Significant at 10% level'
            dis
         }
      enddo m
      release y pi f cv aux
   }
   else
      dis '@HEGY4(lags=-1/[0]/..,det=constant/sd/strend/[all],alpha=[0.05]/0.1,[notrace]/trace) SERIES START END'
end
