*! version 1.0.0 21may2026
help mixi12 (Stata)

Title

mixi12 -- Full library for cointegration analysis of systems
containing both I(1) and I(2) variables

Package contents

The mixi12 library bundles every estimator and every test the
literature has proposed for cointegrated systems with a mixture of I(1)
and I(2) variables. Click any sub-command below to open its dedicated
help page.

mixi12 - main: orchestrator that runs the full pipeline.

mixi12_unit - cross-variable integration-order summary; delegates per-variable Dickey-Pantula, Hasza-Fuller and Haldrup Z(F*) testing to dptest.

mixi12_haldrup - Haldrup (1994) single-equation residual-based ADF cointegration test for mixed I(1)/I(2) systems; delegates to dptest, test(coint).

mixi12_johansen - two-step Johansen (1995, 1997) I(2) VAR estimation plus Paruolo (1996) joint Q(r, s_1) rank test.

mixi12_trans - Kongsted (2005) / Kurita (2011) I(2)-to-I(1) transformation LR test.

mixi12_sw - Stock-Watson (1993) triangular estimator for mixed I(1)/I(2) systems.

mixi12_mco - multicointegration estimation (OLS / FM-OLS / DOLS / CCR / IM-OLS / TAOLS) for I(1) flows whose cumulants are I(2); delegates to multicoint.

mixi12_mco_compare - side-by-side comparison of all six multicointegration estimators and all three tests.

mixi12_gl - Granger-Lee (1989, 1990) two-step multicointegration test.

mixi12_egh - Engsted-Gonzalo-Haldrup (1997) one-step residual ADF multicointegration test.

mixi12_sim - simulator for Doornik-Mosconi-Paruolo (2017) Formula I(1)/I(2) and Kurita-style money-multiplier DGPs.

mixi12_graph - diagnostic plots (levels/differences, cointegration relations, common-trend proxies).

mixi12_cv - critical-value lookup (Haldrup, chi-squared, Pantula).

Syntax

mixi12 varlist [if] [in] [, options]

mixi12 subcommand ...

Pipeline
unit run the unit-root battery only

haldrup run the Haldrup test only

johansen run the joint Q + two-step Johansen only

all run all three (default)

Common
lags(#) VAR / ADF lag length (default 2)

trend(spec) deterministics: none, c, ct

saving(file) export results to file.dta

varlist is a time-series-set varlist; the first variable is treated
as the dependent variable when the Haldrup single-equation test is run.

Description

mixi12 provides a one-stop pipeline for the empirical analysis of
multivariate systems where the integration order of the variables is
unknown and may be a mixture of I(1) and I(2). Such systems arise
naturally for nominal stock variables (broad money, monetary base,
price indices) once levels - not growth rates - are taken; the
benchmark applications are long-run money demand and purchasing-power
parity.

There are two distinct branches of the mixed-integration literature
covered by this package:

1. Direct I(2) - the I(2) variables are observed in levels (e.g.
nominal money, prices). The toolbox here is the Johansen two-step
VAR with two reduced-rank conditions, Haldrup's single-equation
residual ADF, and Kongsted's I(2)-to-I(1) transformation test.

2. Multicointegration - the I(2) variables are not directly
observed but are constructed as cumulants of underlying I(1) flow
variables (production-sales-inventory, consumption-income-wealth).
The toolbox here is the Granger-Lee 2-step, Engsted-Gonzalo-Haldrup
1-step, and Sun et al. TAOLS adaptive tests, together with OLS /
FM-OLS / DOLS / CCR / IM-OLS / TAOLS estimators.

Methods

1. Per-variable integration order

mixi12_unit delegates to dptest (Roudane 2026) which
combines four univariate diagnostics:

ADF on levels and differences (Dickey & Fuller 1979).

Dickey-Pantula (1987) sequential t* - starts from the most
non-stationary hypothesis (I(d_max)) and tests downwards until a
unit-root is rejected. Avoids the size distortions of the original
ADF when applied directly to I(2) data.

Hasza-Fuller (1979) joint F - Phi_2(2) for an intercept-only
specification. Tests H_0: alpha = beta = 1 against H_1: at most one
unit root. Critical values from Hasza & Fuller (1979, Table 4.1).

Haldrup (1994 JBES) semi-parametric Z(F*) - applies a
Newey-West / Bartlett correction to the Hasza-Fuller F so that the
test remains valid under MA error structure. Same critical values as
the parametric Hasza-Fuller F.

2. Haldrup (1994 JoE) single-equation cointegration

mixi12_haldrup runs the static OLS regression

y_t = alpha + delta'·c_t + beta_1' x1_t + beta_2' x2_t + u_t

where x1_t are I(1) and x2_t are I(2) regressors, then applies
an ADF test to the residual. Critical values come from Haldrup (1994
J. Econometrics 63, Table 1) and are indexed by (m_1, m_2, T), the
numbers of I(1) and I(2) regressors and the sample size. The test
generalises Engle-Granger / Phillips-Ouliaris to mixed I(1)/I(2)
regression and is consistent under the null of no cointegration even
when the levels regression is spurious.

3. Johansen two-step I(2) VAR + Paruolo joint Q test

mixi12_johansen estimates the cointegrated VAR

Delta^2 X_t = alpha beta' X_ + Gamma Delta X_ + Sigma_i Psi_i Delta^2 X_ + mu + eps_t

with two reduced-rank conditions:

Step 1 (Johansen 1988): Pi = alpha beta' of rank r.

Step 2 (Johansen 1997): alpha_perp' Gamma beta_perp =
phi eta' of rank s_1, with s_2 = p - r - s_1 the
number of common I(2) stochastic trends.

The Paruolo (1996) joint Q(r, s_1) statistic combines the trace
statistics from both steps:

Q(r, s_1) = TRACE(r) + TRACE(s_1 | r)

and is asymptotically chi-squared under the joint null. It is the
recommended test for I(2) rank determination in Juselius (2006),
Kurita (2011) and Majsterek (2012) because it has correct asymptotic
size whereas the sequential trace test does not.

The output decomposes the data into:

- r cointegrating relations beta'X_t ~ I(1);

- s_1 common stochastic trends of order I(1);

- s_2 common stochastic trends of order I(2).

4. Kongsted I(2)-to-I(1) transformation test

mixi12_trans tests, after mixi12_johansen has produced
beta_perp_2, the null

H_0: sp(tau) = sp(G)

where tau = (beta, beta_perp_1) and G is a user-supplied
p x q matrix of candidate linear combinations. If the null is
not rejected, the linear combinations in G constitute a valid
transformation that reduces the I(2) system to I(1) without loss of
information. Examples:

- Money multiplier m2 - mb on (m2, mb, p, R): G = (1, -1, 0, 0)'.

- Long-run price homogeneity on (m, p, y, R): G = (1, -1, 0, 0)'.

- Nominal-to-real on (m, p, y): G = (1, -1, 0)'.

The LR statistic is asymptotically chi-squared (Johansen 2006;
Kongsted 2005; Kurita 2011).

5. Stock-Watson (1993) triangular estimator

mixi12_sw estimates the single-equation regression

y_t = alpha + delta·t + beta_1' x1_t + beta_2' x2_t + Sigma_j gamma_j Delta x_ + u_t

augmented with leads and lags of the differences of all regressors.
The augmentation removes long-run endogeneity, so the limiting
distribution of the long-run coefficients is mixed-Gaussian and
standard t / F inference is asymptotically valid.

6. Multicointegration (I(1) flow / I(2) stock)

mixi12_mco (and its standalone twins mixi12_gl,
mixi12_egh, mixi12_mco_compare) cover the special case in
which the I(2) variables are not observed but constructed as cumulants
of I(1) flows. The regression actually estimated is

Y_t = alpha + delta_1·t + delta_2·t^2 + beta'·X_t + gamma'·x_t + u_t

with Y_t = Sigma y_s and X_t = Sigma x_s both I(2),
x_t the original I(1) flows, and u_t ~ I(0) under
multicointegration. Six estimators are available:

- OLS (Haldrup 1994): super-super-consistent at rate T^2.

- FM-OLS (Phillips & Hansen 1990): kernel HAC correction for endogeneity.

- DOLS (Saikkonen 1991; Stock & Watson 1993): leads/lags augmentation.

- CCR (Park 1992): canonical cointegrating regression.

- IM-OLS (Vogelsang & Wagner 2014): integrated-modified OLS.

- TAOLS (Hwang & Sun 2018; Sun et al. 2025, 2026): orthonormal Fourier basis transformation; exact normal-theory inference.

Three tests are available:

- Granger-Lee (1989, 1990): two-step ADF on the cumulated residual of a stage-1 cointegrating regression.

- Engsted-Gonzalo-Haldrup (1997): one-step ADF on the residual of the multicointegration regression; critical values from EGH 1997, Tables 1-2.

- TAOLS adaptive F (Sun et al. 2026): combines the Wald statistic under both the multicointegration regression and the conventional cointegration regression with a data-driven weight; asymptotically F-distributed under either regime.

Dependencies

mixi12_unit and mixi12_haldrup delegate to dptest
(Roudane 2026), which ships every per-variable I(2) unit-root
statistic (Dickey-Pantula sequential t*, Hasza-Fuller joint F, Haldrup
semi-parametric Z(F*)) and the Haldrup (1994 JoE) residual-based ADF
cointegration test. mixi12_mco, mixi12_mco_compare,
mixi12_gl and mixi12_egh delegate to multicoint
(Roudane 2026) for the I(1) flow / I(2) stock multicointegration case.
Install both with:

. ssc install dptest

. ssc install multicoint

All other commands (mixi12_johansen, mixi12_trans,
mixi12_sw, mixi12_sim, mixi12_graph,
mixi12_cv) are self-contained.

Stored results

Scalars

e(N) sample size

e(p) number of variables in the system

e(rank) cointegration rank r (Johansen)

e(s1) number of I(1) common stochastic trends

e(s2) number of I(2) common stochastic trends

e(lags) lag length used

Matrices

e(beta) cointegrating matrix (p x r)

e(alpha) loadings (p x r)

e(beta1) I(1) common-trend weights (p x s_1)

e(beta2) I(2) common-trend weights (p x s_2)

e(Q) Paruolo joint Q(r, s_1) table

Examples

1. Simulate a Kurita-style monetary system and run the full pipeline

mixi12_sim, dgp(km) n(160) seed(42) clear

mixi12 m2 mb p rd, lags(3) trend(c) all

2. Classify integration orders

mixi12_unit m2 mb p rd, det(const) level(5)

3. Single-equation Haldrup test

mixi12_haldrup m2, i1(rd) i2(mb p) det(trend)

4. Joint Paruolo Q + two-step Johansen I(2) VAR

mixi12_johansen m2 mb p rd, lags(3) trend(c) joint

5. Test the money multiplier as an I(2)-to-I(1) transformation

matrix G = (1 \ -1 \ 0 \ 0)

mixi12_trans, g(G)

6. Stock-Watson triangular estimator

mixi12_sw m2, i1(rd) i2(mb p) leads(2) lagsdiff(2) trend(c)

7. Multicointegration — all six estimators side-by-side

mixi12_mco_compare y x, trend(c) leads(2) dlags(2)

8. Diagnostic plots

mixi12_graph levels m2 mb p

mixi12_graph cointspace

References

Dickey, D.A. & Fuller, W.A. (1979). Distribution of the estimators
for autoregressive time series with a unit root. J. American
Statistical Association 74, 427-431.

Dickey, D.A. & Pantula, S.G. (1987). Determining the order of
differencing in autoregressive processes. J. Business & Economic
Statistics 5, 455-461.

Doornik, J.A., Mosconi, R. & Paruolo, P. (2017). Formula I(1) and
I(2): Race tracks for likelihood maximization algorithms of I(1) and
I(2) cointegrated VAR models. Econometrics 5, 49.

Engle, R.F. & Granger, C.W.J. (1987). Co-integration and error
correction: Representation, estimation and testing. Econometrica
55, 251-276.

Engsted, T., Gonzalo, J. & Haldrup, N. (1997). Testing for
multicointegration. Economics Letters 56, 259-266.

Engsted, T. & Haldrup, N. (1999). Multicointegration in stock-flow
models. Oxford Bulletin of Economics and Statistics 61, 237-254.

Granger, C.W.J. & Lee, T.-H. (1989). Investigation of production,
sales and inventory relationships using multicointegration and
non-symmetric error correction models. J. Applied Econometrics
4, S145-S159.

Granger, C.W.J. & Lee, T.-H. (1990). Multicointegration. In
G.F. Rhodes & T.B. Fomby (eds.), Advances in Econometrics 8, 71-84.

Haldrup, N. (1994a). Semi-parametric tests for double unit roots.
J. Business & Economic Statistics 12, 109-122.

Haldrup, N. (1994b). The asymptotics of single-equation cointegration
regressions with I(1) and I(2) variables. J. Econometrics 63,
153-181.

Hasza, D.P. & Fuller, W.A. (1979). Estimation for autoregressive
processes with unit roots. Annals of Statistics 7, 1106-1120.

Hwang, J. & Sun, Y. (2018). Should we go one step further? An
accurate comparison of size and power for cointegrating regressions.
J. Econometrics.

Johansen, S. (1988). Statistical analysis of cointegration vectors.
J. Economic Dynamics and Control 12, 231-254.

Johansen, S. (1992). A representation of vector autoregressive
processes integrated of order 2. Econometric Theory 8, 188-202.

Johansen, S. (1995). Likelihood-Based Inference in Cointegrated
Vector Autoregressive Models. Oxford University Press.

Johansen, S. (1997). Likelihood analysis of the I(2) model.
Scandinavian Journal of Statistics 24, 433-462.

Johansen, S. (2006). Statistical analysis of hypotheses on the
cointegrating relations in the I(2) model. J. Econometrics 132,
81-115.

Juselius, K. (2006). The Cointegrated VAR Model: Methodology and
Applications. Oxford University Press.

Kongsted, H.C. (2005). Testing the nominal-to-real transformation.
J. Econometrics 124, 205-225.

Kurita, T. (2011). Modelling time series data of monetary aggregates
using I(2) and I(1) cointegration analysis. Bulletin of Economic
Research.

Maddala, G.S. & Kim, I.-M. (1998). Unit Roots, Cointegration, and
Structural Change. Cambridge University Press.

Majsterek, M. (2012). Cointegration analysis in the case of I(2) -
general overview. Central European Journal of Economic Modelling
and Econometrics 4, 215-252.

Pantula, S.G. (1986). Comments on "Modelling the persistence of
conditional variances". Econometric Reviews 5, 71-74.

Park, J.Y. (1992). Canonical cointegrating regressions.
Econometrica 60, 119-143.

Paruolo, P. (1996). On the determination of integration indices in
I(2) systems. J. Econometrics 72, 313-356.

Phillips, P.C.B. & Hansen, B.E. (1990). Statistical inference in
instrumental variables regression with I(1) processes. Review of
Economic Studies 57, 99-125.

Phillips, P.C.B. & Ouliaris, S. (1990). Asymptotic properties of
residual based tests for cointegration. Econometrica 58, 165-193.

Saikkonen, P. (1991). Asymptotically efficient estimation of
cointegrating regressions. Econometric Theory 7, 1-21.

Stock, J.H. & Watson, M.W. (1993). A simple estimator of cointegrating
vectors in higher order integrated systems. Econometrica 61,
783-820.

Sun, Y., Hwang, J., et al. (2025, 2026). TAOLS: Adaptive F and t tests
for cointegration and multicointegration. Working paper.

Vogelsang, T.J. & Wagner, M. (2014). Integrated modified OLS
estimation and fixed-b inference for cointegrating regressions.
J. Econometrics 178, 741-760.

Author

Dr Merwan Roudane

Department of Economics (Independent Researcher)

Email: merwanroudane920@gmail.com

mixi12 v1.0.0 - 21 May 2026. Bug reports and questions welcome.

Also see

Companion commands:
mixi12_unit, mixi12_haldrup, mixi12_johansen,
mixi12_trans, mixi12_sw, mixi12_mco,
mixi12_mco_compare, mixi12_gl, mixi12_egh,
mixi12_sim, mixi12_graph, mixi12_cv.

Engines: dptest, multicoint.