------------------------------------------------------------------------------- help forjohans,lrjtest,wjtest[P.Joly] -------------------------------------------------------------------------------

Johansen's maximum likelihood cointegration rank test

johansdepvarlist[ifexp] [inrange] [,lags(#)noconstanttrendexog(varlist)nonormalstandardregresslevel(#)]

lrjtestvarlist[,cir(#)restrict]

wjtestvarlist[,cir(#)]

johansis for use with time-series data. You musttssetyour data before usingjohans; see help tsset. Your version of Stata must also be up-to-date. Typeupdate queryto find out whether updating is required; see help update.

johansmay be used with panel data if the estimation sample is restricted to a single panel. Observations for which the panel variable is missing are omitted from the sample.

by...:may be used withjohans; see help by.

depvarlistandvarlistmay contain time-series operators; see help varlist.

Description

johanscalculates the eigenvalues and the maximal eigenvalue and trace statistics for the VAR defined bydepvarlist. These statistics can be used to test for the number of cointegrating vectors in the system. If optionnormalorstandardis specified, maximum likelihood estimates of the cointegrating vectors and of the matrix of weights are displayed.johansuses Johansen's method for computing the estimates and test statistics. See the references for more information on the method.

lrjtestandwjtestare used afterjohansto test the null hypothesis that one or more of the variables in the VAR do not enter the cointegrating relationship(s).lrjtestcalculates the likelihood-ratio test.wjtestcalculates the Wald test.

Options

lags(#)specifies the number of lags in the original VAR (in levels). The default is 1.

noconstantsuppresses the constant in the first stage VAR.

trendincludes a trend term in each equation of the VAR.

exog(varlist)specifies exogenous variables that enter each equation of the VAR.

nonormalsuppresses the display of the normalized Alpha and Beta' matrices.

standardrequests the display of the standardized Alpha and Beta' matrices instead of the normalized matrices.

regressindicates that the VAR estimates are to be displayed.

cir(#)is for use withlrjtestandwjtestand indicates the number of cointegrating relationships in the system. The default is 1.

restrictis relevant only withlrjtestand requests the display of the restricted estimates of the eigenvalues and of the Alpha and Beta' matrices.

level(#)specifies the confidence level, in percent, for confidence intervals of the test statistics.#must be one of 50, 80, 90, 95, 97.5, or 99; 95 is the default.

Methods & FormulasConsider a vector autoregression of order

k, VAR(k),

kx_t= SUMB_i*x_t-i+f*D_t+m_0+m_1*t+e_ti=1(

t= 1,...,T)where

x_t(px1) vector ofpstochastic variables;B_i(pxp) matrix of coefficients;D_t(optional) matrix of zero-mean seasonal dummies with corresponding coefficient vectorf; andm_0,m_1(optional) (px1) vectors of coefficients on intercept and trend terms, respectively.Any such VAR(

k) may be re-parameterized as

k-1 d.x_t= SUMG_i* d.x_t-i+P*x_t-1+f*D_t+m_0+m_1*t+e_ti=1

P=ab'where "d." represents the first-difference operator and

G_i,P, are (pxp) matrices of coefficients. As shown above, matrixPcan be further decomposed into the productab'whereb'represents the matrix of (r) cointegrating vectors anda, the matrix of weights on the vectors in each equation of the system. Bothaandbare of dimension (pxr). (The notationP=ab'is a departure from the convention of using uppercase (lowercase) letters for matrices (scalars) but has become embedded in the cointegration literature so we stick to it.)The Johansen cointegration rank test is a test of the rank of the

ab'matrix. If, after inference, the rank is deemed to be (r), then there are (r) cointegrating relationships or vectors in the system. The rank of any matrix can be determined by the number of non-zero eigenvalues for that matrix.Two features of the Johansen procedure are worth noting. First, the test is really a sequence of tests. The null hypothesis of rank (r)=0 (i.e. no cointegrating relationship) is first tested and, if rejected, subsequent null hypotheses (Ho: r=1, Ho: r=2, etc.) are tested until a null can no longer be rejected. This is eminently sensible since we must first enquire whether any cointegrating relation exists at all, and only in the affirmative are we interested in finding out exactly how many can be identified.

The second distinguishing feature of the procedure is that it provides two ways (two test statistics, that is) of testing the same null hypothesis. The difference lies in the alternative hypotheses implied by each. The

maximum-eigenvaluestatistic tests the null hypothesis that there areat most(r) cointegrating vectors against the alternative of (r+1) vectors. Thetracestatistic tests the same null hypothesis against the alternative that there are at mostpcointegrating relations (where ispis always equal to the number of variables in thex_tvector). It is important to note that the two statistics may lead to conflicting results.However, before making inference using the max-lambda and trace statistics, certain assumptions regarding the deterministic components (intercept, trend terms) must be made. These assumptions will determine which table of critical values should be used. Following Osterwald-Lenum's notation (see

references), lety_trepresent a subset or portion of the re-parameterized VAR (the 2nd equation above), specifically, let

y_t=ab'*x_t-1+m_0+m_1*tThe precise form of this

y_tterm depends on the assumptions regarding the presence of intercept or trend terms and whether such terms appearwithinoroutsidethe cointegrating equation(s) (CE). Byoutsideit is meant that a deterministic term lies in theremainderof the VAR, that is, that portion of the VAR other than the CE. The possible assumptions or cases are:

Table/Case 0:no intercept, no trendy_t=ab'*x_t-1

Table/Case 1*:intercept in CE onlyy_t=a(b',b_0) * (x'_t-1, 1)'

Table/Case 1:intercept in VARy_t=ab'*x_t-1+m_0

Table/Case 2*:intercept in VAR, trend in CE onlyy_t=a(b',b_1) * (x'_t-1,t)' +m_0

Table/Case 2:intercept in VAR, trend in VARy_t=ab'*x_t-1+m_0+m_1*twhere

b_0 andb_1 are of dimension (rx 1). The case number refers to the table identifier in Osterwald-Lenum. The corresponding critical values are reported byjohans. This may seem confusing but it shouldn't be. Recall that a constant (trend) in an equation in difference-form implies a trend (quadratic trend) in levels. Therefore, cases 0 and 1* are appropriate when the series inx_tdo not exhibit some apparent trend (when plotted in levels); otherwise cases 1 and 2* should be used. Case 2 is rare and only consistent with explosive series. Case 1 is the most common and is the default injohans.For instance, using the first of the examples provided in the

Examplessection below,. use http://fmwww.bc.edu/ec-p/data/macro/wgmacro.dta, clear (Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1)

. johans investment income consumption, l(4) nonormal Johansen-Juselius cointegration rank test Sample: 1960q4 to 1982q4 Number of obs = 88 H1: H0: | Max-lambda Trace Eigenvalues rank<=(r) | statistics statistics (lambda) r | (rank<=(r+1)) (rank<=(p=3)) ------------------------+-------------------------------- .21617042 0 | 21.433602 33.527577 .11390069 1 | 10.64151 12.093974 .01636981 2 | 1.4524647 1.4524647

Osterwald-Lenum Critical values (95% interval):

Table/Case: 1* (assumption: intercept in CE)

H0: | Max-lambda Trace -----------+-------------------------------- 0 | 22.00 34.91 1 | 15.67 19.96 2 | 9.24 9.24

Table/Case: 1 (assumption: intercept in VAR)

H0: | Max-lambda Trace -----------+-------------------------------- 0 | 20.97 29.68 1 | 14.07 15.41 2 | 3.76 3.76

If we believe there is an intercept term in the VAR but not in the CE, we refer to the quantiles in Table 1 of Osterwald-Lenum. Using the Max-lambda statistic, we test the null hypothesis that (r) = 0 against the alternative that (r) is at most 1. Our test statistic of 21.43 exceeds the critical value of 20.97 which leads to the rejection of the hypothesis of no cointegrating relationship. The Trace statistic of 33.53 also exceeds its corresponding critical value of 29.68 which is consistent with the result using the Max-lambda statistic.

We now move on to testing the null hypothesis that the rank of

ab'is 1. In this instance however, the Max-lambda statistic of 10.64 is smaller than the critical value of 14.07 and we cannot reject the null hypothesis. The Trace test leads to the same conclusion. Therefore, regardless of which statistic is used, we cannot reject the hypothesis that we have 1 cointegrating vector.

Examples. use http://fmwww.bc.edu/ec-p/data/macro/wgmacro.dta, clear

. johans investment income consumption, l(4) . lrjtest investment, c(1) . wjtest investment, c(1) . lrjtest income, c(1)

. * generate zero-mean (centered) seasonal dummies . forvalues i = 1/4 { gen byte q`i' = 0 } . forvalues i = 1/4 { replace q`i' = 1 if quarter(dofq(qtr))==`i' } . forvalues i = 1/4 { replace q`i' = q4-q`i' } . johans investment income consumption, l(4) exog(q1 q2 q3)

With longitudinal data, for each unit of a panel,

. use http://fmwww.bc.edu/ec-p/data/Greene2000/TBL15-1, clear

. tsset firm year, yearly . by firm: johans i f c, l(3)

. johans i f c if firm==3, l(3) . lrjtest i, c(1) restrict . lrjtest c, c(1) restrict

ReferencesJohansen, S. (1988). "Statistical Analysis of Cointegration Vectors".

Journalof Economic Dynamics and Control.12. 231-254.Johansen, S. and K. Juselius. (1990). "Maximum Likelihood Estimation and Inference on Cointegration - With Applications to the Demand for Money".

Oxford Bulletin of Economics and Statistics.52. 169-210.For inference, the most comprehensive set of critical values can be found in:

Osterwald-Lenum, M. (1992). "A Note with Quantiles of the Asymptotic Distribution of the Maximum Likelihood Cointegration Rank Test Statistics".

Oxford Bulletin of Economics and Statistics.54. 461-472.

AcknowledgementsThanks to Richard Sperling for suggestions on the displayed output.

AuthorKen Heinecke and Charles Morris, Federal Reserve Bank of Kansas City

Patrick Joly, Industry Canada pat.joly@utoronto.ca

Also seeOn-line: help for vecar (if installed), vececm (if installed), dfuller, pperron