*! version 1.0.0 08jul2026

Title

xthkrcoint postestimation -- Postestimation tools, graphs and stored
results for xthkrcoint

Description

xthkrcoint is a test command: everything it produces is left behind in
r() (it does not post an e() estimation vector). This page documents
the stored objects, the graphs, and how to assemble publication-ready tables and
figures from them.

Graphs

The graph option draws a two-panel dashboard, each panel stored under a
name derived from name() (default stub xthkr):

stub_units - a forest / caterpillar plot of the
per-unit bias-corrected statistics S~K,i with vertical reference
lines at the 5% (1.645) and 1% (2.326) one-sided critical values. Units that
reject cointegration at 5% are drawn in a contrasting colour.

stub_ksens - the pooled S~K and
SK as functions of the lag order K, with horizontal critical
values and a marker at the reported K.

stub - the two panels combined side by side.

Because the panels are stored graphs, you can recall, restyle, combine or export
them after the command:

. xthkrcoint y x, graph name(fig1)

. graph display fig1_units

. graph export figure1.png, replace width(2000)

Supply your journal's scheme with scheme() (for example a black-and-white
scheme for print):

. xthkrcoint y x, graph scheme(s1mono)

Working with stored results

The full per-unit matrix r(indiv) (N×9) and the sensitivity
grid r(ksens) can be pulled into the data for custom plotting:

. xthkrcoint y x, ksens(5(3)26)

. matrix S = r(ksens)

. preserve

. clear

. svmat double S, name(col)

. twoway line S_bc K, yline(1.645 2.326)

. restore

Building a journal table

A compact top-journal-style results block can be produced directly from the
scalars. For example, to loop the test over several lag orders and print one
row each:

. foreach k in 10 15 20 {

. quietly xthkrcoint y x, k(`k')

. di as res %4.0f `k' _col(10) %9.3f r(Sbc) _col(24) %7.3f r(pbc)

. }

To collect the per-unit statistics into a labelled table for export with
estout / esttab (if installed), post them as a matrix and use
matlist or write them to a frame.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane