I have found the program file for Johansen et al (2000) from Prof. Dave Giles website. However, I am not sure on how can I conduct the test. Hope you can help.

http://web.uvic.ca/~dgiles/downloads/johansen/' COMPUTATION OF ASYMPTOTIC CRITICAL VALUES FOR THE H(c) and H(L) COINTEGRATION TESTS WHEN THERE ARE 2 or 3 STRUCTURAL BREAKS

' =============================================================

' Written by David Giles, Dept. of Economics, University of Victoria.

' Last Modified: 28 June, 2011.

' The total sample size is T. The number of sub-samples due to the structural breaks is "q". So, q=2 corresponds to one structural break, and q=3 corresponds to 2 structural breaks. If q=1 there are no structural breaks.

' The break-points occur at T1, when q=2, and at T1 and T2, when q=3.

' The break-point proportions are V1=(T1/T), when q=2; and V1 and V2=(T2/T), when q=3.

' (If q=2, the value of V2 below is not used)

' r = cointegrating rank

' p = no. of variables in system

' To cross-check the results for the H(c) test with the last column of Table 5 in Johansen et al., set q=1 (V1 and V2 can be left at their current values as they will not be used)

'===================================

' EDIT THE NEXT 3 LINES, AS APPROPRIATE:

scalar q=3

scalar V1=0.3

scalar V2=0.85

'================================

'EDIT THE NEXT 2 LINES IF P-VALUES ARE REQUIRED

scalar traceL=123.6

scalar traceC=114.7

'================================

vector(2) c2

vector(3) c3

vector(2) c4

vector(2) c5

vector(2) c6

scalar a

scalar b

' The values of "a" and "b" depend on the number (q-1) of structural breaks.

' When q=2, we set a=0 in Table 4 of Johansen et al. (2000) & b = min[ V1 , (1-V1)]

' When q=3, we set a=min[V1, (V2-V1), (1-V2)] & b = min[remaining two V expressions ]

if q=2 then

c2.fill v1, 1-v1

a=0

b=@min(c2)

endif

if q=3 then

c3.fill v1, v2-v1, 1-v2

a=@min(c3)

b=@median(c3)

endif

if q=1 then

a=0

b=0

endif

' Let pr denote (p-r)

vector(10) pr

vector(10) lmL

vector(10) lvL

vector(10) meanL

vector(10) varL

vector(10) lmC

vector(10) lvC

vector(10) meanC

vector(10) varC

vector(10) theta

vector(10) k

vector(10) crit_HL90

vector(10) crit_HL95

vector(10) crit_HL99

vector(10) crit_HC90

vector(10) crit_HC95

vector(10) crit_HC99

vector(10) pvalL

vector(10) pvalC

' lm denotes the logarithm of the mean of the asymptotic distribution

' lv denotes the logarithm of the variance of the asymptotic distribution

' See Table 4 of Johansen et al. (2000). We then add L or C to the names to reflect the H(L) test or the H(c) test.

' First construct critical values for the H(L) test, and then for the H(c) test

for !pr = 1 to 10

pr(!pr)=!pr

lmL(!pr)=3.06+0.456*!pr+1.47*a+0.993*b-0.0269*!pr^2-0.0363*a*!pr-0.0195*b*!pr-4.21*a^2-2.35*b^2+0.000840*!pr^3+6.01*a^3-1.33*a^2*b+2.04*b^3-2.05/!pr-0.304*a/!pr+1.06*b/!pr+9.35*a^2/!pr+3.82*a*b/!pr+2.12*b^2/!pr-22.8*a^3/!pr-7.15*a*b^2/!pr-4.95*b^3/!pr+0.681/!pr^2-0.828*b/!pr^2-5.43*a^2/!pr^2+13.1*a^3/!pr^2+1.5*b^3/!pr^2

lvL(!pr)= 3.97+0.314*!pr+1.79*a+0.256*b-0.00898*!pr^2-0.0688*a*!pr-4.08*a^2+4.75*a^3-0.587*b^3-2.47/!pr+1.62*a/!pr+3.13*b/!pr-4.52*a^2/!pr-1.21*a*b/!pr-5.87*b^2/!pr+4.89*b^3/!pr+0.874/!pr^2-0.865*b/!pr^2

meanL(!pr)=exp(lmL(!pr))-(3-q)*!pr

varL(!pr)=exp(lvL(!pr))-2*(3-q)*!pr

' Use the asymptotic mean and variance to obtain the shape and scale parameters of the gamma distribution to be used to approximate the asymptotic distribution of the test statistic, and hence obtain the desired quantiles under the null:

theta(!pr)=(varL(!pr)/meanL(!pr))

k(!pr)=meanL(!pr)^2/varL(!pr)

crit_HL90(!pr)=@qgamma(0.90, theta(!pr),k(!pr))

crit_HL95(!pr)=@qgamma(0.95, theta(!pr),k(!pr))

crit_HL99(!pr)=@qgamma(0.99, theta(!pr),k(!pr))

if traceL>0 then

pvalL(!pr)=1-@cgamma(traceL, theta(!pr),k(!pr))

endif

lmC(!pr)=2.80+0.501*!pr+1.43*a+0.399*b-0.0309*!pr^2-0.0600*a*!pr-5.72*a^2-1.12*a*b-1.70*b^2+0.000974*!pr^3+0.168*a^2*!pr+6.34*a^3+1.89*a*b^2+1.85*b^3-2.19/!pr-0.438*a/!pr+1.79*b/!pr+6.03*a^2/!pr+3.08*a*b/!pr-1.97*b^2/!pr-8.08*a^3/!pr-5.79*a*b^2/!pr+0.717/!pr^2-1.29*b/!pr^2-1.52*a^2/!pr^2+2.87*b^2/!pr^2-2.03*b^3/!pr^2

lvC(!pr)= 3.78+0.346*!pr+0.859*a-0.0106*!pr^2-0.0339*a*!pr-2.35*a^2+3.95*a^3-0.282*b^3-2.73/!pr+0.874*a/!pr+2.36*b/!pr-2.88*a^2/!pr-4.44*b^2/!pr+4.31*b^3/!pr+1.02/!pr^2-0.807*b/!pr^2

meanC(!pr)=exp(lmC(!pr))-(3-q)*!pr

varC(!pr)=exp(lvC(!pr))-2*(3-q)*!pr

' use the asymptotic mean and variance to obtain the shape and scale parameters of the gamma distribution to be used to approximate the asymptotic distribution of the test statistic, and hence obtain the desired quantiles under the null:

theta(!pr)=varC(!pr)/meanC(!pr)

k(!pr)=meanC(!pr)^2/varC(!pr)

crit_HC90(!pr)=@qgamma(0.90, theta(!pr),k(!pr))

crit_HC95(!pr)=@qgamma(0.95, theta(!pr),k(!pr))

crit_HC99(!pr)=@qgamma(0.99, theta(!pr),k(!pr))

if traceC>0 then

pvalC(!pr)=1-@cgamma(traceC, theta(!pr),k(!pr))

endif

next

smpl 1 10

mtos(pr,p_minus_r)

mtos(crit_HL90, crit_HL_90)

mtos(crit_HL95, crit_HL_95)

mtos(crit_HL99, crit_HL_99)

mtos(crit_HC90, crit_HC_90)

mtos(crit_HC95, crit_HC_95)

mtos(crit_HC99, crit_HC_99)

group crit_vals p_minus_r crit_HL_90 crit_HL_95 crit_HL_99 crit_HC_90 crit_HC_95 crit_HC_99

show crit_vals

if traceL>0 then

mtos(pvalL,p_val_HL)

group pval_HL p_minus_r p_val_HL

show pval_HL

endif

if traceC>0 then

mtos(pvalC,p_val_HC)

group pval_HC p_minus_r p_val_HC

show pval_HC

endif