```-------------------------------------------------------------------------------
help for johans, lrjtest, wjtest                                       [P.Joly]
-------------------------------------------------------------------------------

Johansen's maximum likelihood cointegration rank test

johans depvarlist [if exp] [in range] [, lags(#) noconstant trend
exog(varlist) nonormal standard regress level(#) ]

lrjtest varlist   [, cir(#) restrict ]

wjtest varlist    [, cir(#) ]

johans is for use with time-series data.  You must tsset your data before using
johans; see help tsset.  Your version of Stata must also be up-to-date.  Type
update query to find out whether updating is required; see help update.

johans may 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 with johans; see help by.

depvarlist and varlist may contain time-series operators; see help varlist.

Description

johans calculates the eigenvalues and the maximal eigenvalue and trace
statistics for the VAR defined by depvarlist.  These statistics can be used to
test for the number of cointegrating vectors in the system.  If option normal
or standard is specified, maximum likelihood estimates of the cointegrating
vectors and of the matrix of weights are displayed.  johans uses Johansen's
method for computing the estimates and test statistics.  See the references for
more information on the method.

lrjtest and wjtest are used after johans to test the null hypothesis that one
or more of the variables in the VAR do not enter the cointegrating
relationship(s).  lrjtest calculates the likelihood-ratio test.  wjtest
calculates the Wald test.

Options

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

noconstant suppresses the constant in the first stage VAR.

trend includes a trend term in each equation of the VAR.

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

nonormal suppresses the display of the normalized Alpha and Beta' matrices.

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

regress indicates that the VAR estimates are to be displayed.

cir(#) is for use with lrjtest and wjtest and indicates the number of
cointegrating relationships in the system.  The default is 1.

restrict is relevant only with lrjtest and 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 & Formulas

Consider a vector autoregression of order k, VAR(k),

k
x_t =  SUM B_i * x_t-i  + f * D_t  + m_0  + m_1 * t  + e_t
i=1

(t = 1,...,T )

where
x_t       (p x1) vector of p stochastic variables;
B_i       (p xp ) matrix of coefficients;
D_t       (optional) matrix of zero-mean seasonal dummies with
corresponding coefficient vector f; and
m_0, m_1  (optional) (p x1) vectors of coefficients on intercept and trend
terms, respectively.

Any such VAR(k) may be re-parameterized as

k-1
d.x_t =  SUM G_i * d.x_t-i  + P * x_t-1  + f * D_t  + m_0  + m_1 * t  + e_t
i=1

P = ab'

where "d." represents the first-difference operator and G_i, P, are (p xp )
matrices of coefficients.  As shown above, matrix P can be further decomposed
into the product ab' where b' represents the matrix of (r) cointegrating
vectors and a, the matrix of weights on the vectors in each equation of the
system.  Both a and b are of dimension (p xr ).  (The notation P = 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-eigenvalue statistic tests the null hypothesis that there are at most
(r) cointegrating vectors against the alternative of (r+1) vectors.  The trace
statistic tests the same null hypothesis against the alternative that there are
at most p cointegrating relations (where is p is always equal to the number of
variables in the x_t vector).  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),
let y_t represent 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 * t

The precise form of this y_t term depends on the assumptions regarding the
presence of intercept or trend terms and whether such terms appear within or
outside the cointegrating equation(s) (CE).  By outside it is meant that a
deterministic term lies in the remainder of 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 trend
y_t = ab' * x_t-1

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

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

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

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

where b_0 and b_1 are of dimension (r x 1).  The case number refers to the
table identifier in Osterwald-Lenum.  The corresponding critical values are
reported by johans.  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 in
x_t do 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 in johans.

For instance, using the first of the examples provided in the Examples section
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

References

Johansen, S. (1988). "Statistical Analysis of Cointegration Vectors".  Journal
of 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.

Acknowledgements

Thanks to Richard Sperling for suggestions on the displayed output.

Author

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

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

Also see

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

```