Internal reporting helper that prints two Stata-style coefficient tables:
(1) the mean-group error-correction model (short-run ECM output) and
(2) the estimated long-run relationship with short-run adjustment.
This function delegates all table computation and formatting to
westerlund_test_reg.
westerlund_test_mg(b, V, b2, V2, auto, verbose = FALSE)A named list containing two matrices:
A numeric matrix containing the Mean-group ECM results (coefficients, SE, z, p-values, and CI).
A numeric matrix containing the long-run relationship and adjustment results.
A numeric vector of coefficients for the long-run relationship and short-run adjustment terms (as reported in the second table).
A numeric variance-covariance matrix corresponding to b.
A numeric vector of coefficients for the mean-group error-correction model (as reported in the first table).
A numeric variance-covariance matrix corresponding to b2.
Logical/integer. If non-zero, prints a note indicating that short-run coefficients (apart from the error-correction term) are omitted because selected lag/lead lengths may differ across units.
Logical. If TRUE, prints additional output.
This section shows the expected calling pattern for westerlund_test_mg()
and explains the role of the auto flag.
In mean-group implementations, it is common to show:
a short-run ECM table (possibly with omitted coefficients when lag/lead lengths differ by unit),
a long-run relationship table with the short-run adjustment term.
westerlund_test_mg() prints these tables sequentially.
## Long-run relationship table inputs
b <- c(alpha = -0.20, beta = 1.05)
V <- diag(c(0.03^2, 0.10^2))
rownames(V) <- colnames(V) <- names(b)## Mean-group ECM table inputs b2 <- c(ec = -0.18) V2 <- matrix(0.04^2, nrow = 1, ncol = 1) rownames(V2) <- colnames(V2) <- names(b2)
## Print both sections (auto = TRUE prints the omission note) westerlund_test_mg(b, V, b2, V2, auto = TRUE, verbose = FALSE)
What it prints. The function prints two sections:
Mean-group error-correction model: This corresponds to reporting the mean-group ECM coefficients (often denoted b2 with variance V2). If auto is non-zero, a note is printed to remind that short-run coefficients may be omitted due to unit-specific lag/lead selection.
Estimated long-run relationship and short run adjustment: This corresponds to reporting the long-run relationship and the adjustment dynamics (b with variance V).
In each section, westerlund_test_reg is called to compute standard
errors, z-statistics, two-sided p-values, and 95% confidence intervals, and to
print the formatted coefficient table using stats::printCoefmat().
Intended use. This is an internal display helper used in Stata-aligned reporting flows. It is not required for computing the Westerlund test statistics themselves.
westerlund_test_reg,
westerlund_test