*! version 1.0.1 21aug2026

Title

gvar avgcorr -- average pairwise cross-section correlations

Syntax

gvar avgcorr [, block(string) graph name(name) nosummary saving(name)]

options

block(string) which blocks to report: levels, diff, resid. Default all three.

graph scatter the residual against the level correlations.

name(name) graph name.

nosummary suppress the tables.

saving(name) save the results matrix.

Description

gvar avgcorr reports, for each variable and unit, the average
correlation with the same variable in every other unit - in the levels, the
first differences and the VECMX* residuals.

This is the check that the foreign variables did their job. Including them
should soak up the cross-section dependence, so the residual correlations
ought to be far smaller than those of the data. If they are not, the country
models are not conditionally independent and the generalized impulse
responses are not trustworthy.

Options

block(spec) which block to compute the correlations over -- the levels,
the first differences, or the residuals.

The comparison is the point. Including the foreign variables is what soaks up
the cross-section dependence that would otherwise invalidate estimating each
country model separately. So the number to look at is not either level but the
fall between them: on the shipped demo the average pairwise correlation goes
from 0.6514 in the levels to 0.0484 in the residuals. A residual correlation that
stays high means the foreign block has not done its job, and every standard error
in the model is then optimistic.

graph, name(), saving() and nosummary as elsewhere.

Remarks

What a good result looks like. In the shipped demo the average pairwise
correlation falls from 0.6514 in the levels to 0.0484 in the residuals, a
reduction of about thirteen times. The bucketed distribution beneath each
table, following BGVAR's avg.pair.cc, shows how many cells fall in each
band of |rho|.

The graph plots residual against level correlation with the
forty-five-degree line. Points should sit well inside it. A point on or above
the line is a series whose cross-section dependence the foreign variables
failed to absorb.

Examples

. gvar avgcorr
. gvar avgcorr, block(levels resid) graph

Stored results

gvar avgcorr stores the following in r():

r(avgcorr) the correlations by variable and unit

Source

Toolbox avgcorrs.m, corrmat.m; GVARX averageCORgvar; the
bucketed summary follows BGVAR avg.pair.cc.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane