print.westerlund_test: Print Method for Westerlund ECM Panel Cointegration Tests

View source: R/Westerlund.R

print.westerlund_testR Documentation

Print Method for Westerlund ECM Panel Cointegration Tests

Description

This function provides a clean and concise console output for objects of class westerlund_test. Instead of displaying the raw list structure, it summarizes the key results of the Westerlund (2007) panel cointegration test, including the four observed test statistics and information regarding the bootstrap replications if they were performed.

Usage

## S3 method for class 'westerlund_test'
print(x, ...)

Arguments

x

An object of class westerlund_test. This is typically the output returned by a call to westerlund_test or a manually constructed list assigned that class.

...

Further arguments passed to or from other methods. Currently unused but maintained for S3 generic compatibility.

Details

The print method is designed to enhance readability by presenting the test results in a formatted table-like structure. It first identifies the test type and then displays the observed values for the group-mean statistics (G_t and G_a) and the pooled panel statistics (P_t and P_a). This summary provides an immediate overview of the test's findings without requiring the user to navigate the internal list structure of the object.

If the test was conducted with a bootstrap distribution, the method also reports the total number of successful replications. This is particularly useful for verifying that the requested number of bootstrap draws was attained after accounting for any non-finite results. Finally, the output includes a brief instructional note suggesting the use of the plot() method for visual inference, which is the recommended way to interpret the bootstrap results relative to the observed statistics.

Value

The function returns the input object x invisibly (via invisible(x)). Its primary purpose is the side effect of printing a formatted summary to the R console.

References

Westerlund, J. (2007). Testing for error correction in panel data. Oxford Bulletin of Economics and Statistics, 69(6), 709–748.

See Also

westerlund_test, plot.westerlund_test

Examples

## Example: generating a mock westerlund_test object
set.seed(123)
mock_res <- list(
  test_stats = list(Gt = -3.14, Ga = -10.22, Pt = -2.71, Pa = -7.89),
  bootstrap_distributions = matrix(rnorm(400), ncol = 4)
)
class(mock_res) <- "westerlund_test"

## Calling the object directly invokes print.westerlund_test
mock_res

## Or call it explicitly
print(mock_res)

Westerlund documentation built on April 12, 2026, 5:07 p.m.